svn merge -r117314:117337

svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1

QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge
master
Adam Moss 2009-04-16 23:45:35 +00:00
parent 868250bdd7
commit b01c75cb42
119 changed files with 1376 additions and 1047 deletions

View File

@ -24,18 +24,24 @@ Aimee Trescothick
VWR-6550
VWR-6583
VWR-6482
VWR-7109
VWR-7109
VWR-7383
VWR-8341
VWR-8430
VWR-8482
VWR-9255
VWR-11844
VWR-10990
VWR-11100
VWR-11111
VWR-11844
Alejandro Rosenthal
VWR-1184
Aleric Inglewood
VWR-10001
VWR-10759
VWR-10837
Ales Beaumont
VWR-9352
Alissa Sabre
VWR-81
VWR-83
@ -82,6 +88,8 @@ Angus Boyd
VWR-592
Argent Stonecutter
VWR-68
Armin Weatherwax
VWR-8436
Asuka Neely
VWR-3434
VWR-8179
@ -109,6 +117,7 @@ Carjay McGinnis
VWR-4070
VWR-4212
VWR-6154
VWR-9400
Catherine Pfeffer
VWR-1282
VWR-8624
@ -184,6 +193,7 @@ Gigs Taggart
VWR-2502
VWR-2331
VWR-8781
VWR-8783
Ginko Bayliss
VWR-4
Grazer Kline
@ -236,10 +246,14 @@ Kage Pixel
Kerutsen Sellery
VWR-1350
Khyota Wulluf
VWR-2085
VWR-9256
VWR-9966
Kunnis Basiat
VWR-82
VWR-102
Latif Khalifa
VWR-5370
Lockhart Cordoso
VWR-108
maciek marksman
@ -257,6 +271,7 @@ McCabe Maxsted
VWR-1318
VWR-4065
VWR-4826
VWR-6518
VWR-7827
VWR-7877
VWR-7893

View File

@ -50,9 +50,9 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
if (EXISTS ${LIBS_CLOSED_DIR}llkdu AND NOT STANDALONE)
if (EXISTS ${LIBS_CLOSED_DIR}llkdu)
add_subdirectory(${LIBS_CLOSED_PREFIX}llkdu)
endif (EXISTS ${LIBS_CLOSED_DIR}llkdu AND NOT STANDALONE)
endif (EXISTS ${LIBS_CLOSED_DIR}llkdu)
add_subdirectory(${LIBS_OPEN_PREFIX}lscript)

View File

@ -190,8 +190,10 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
if (!llfinite(focus_pt.magVecSquared()))
{
LLVector3 tmp = mCharacter->getCharacterPosition() ;
llerrs << "Non finite focus point in editing motion. focus point: " << focus_pt << " and character position: " <<
tmp << " and pointAtPt: " << *pointAtPt << llendl;
LL_WARNS_ONCE("Animation") << "Non finite focus point in editing motion. focus point: " << focus_pt << " and character position: " <<
tmp << " and pointAtPt: " << pointAtPt <<
" - ignoring anim" << LL_ENDL;
return FALSE;
}
// propagate joint positions to kinematic chain

View File

@ -468,7 +468,7 @@ LLMotion *LLKeyframeMotion::create(const LLUUID &id)
//-----------------------------------------------------------------------------
LLPointer<LLJointState>& LLKeyframeMotion::getJointState(U32 index)
{
llassert_always (index < (S32)mJointStates.size());
llassert_always (index < mJointStates.size());
return mJointStates[index];
}
@ -477,7 +477,7 @@ LLPointer<LLJointState>& LLKeyframeMotion::getJointState(U32 index)
//-----------------------------------------------------------------------------
LLJoint* LLKeyframeMotion::getJoint(U32 index)
{
llassert_always (index < (S32)mJointStates.size());
llassert_always (index < mJointStates.size());
LLJoint* joint = mJointStates[index]->getJoint();
llassert_always (joint);
return joint;

View File

@ -364,18 +364,13 @@ BOOL LLKeyframeMotionParam::loadMotions()
}
// allocate a text buffer
char *text = new char[ fileSize+1 ];
if ( !text )
{
llinfos << "ERROR: can't allocated keyframe text buffer." << llendl;
return FALSE;
}
std::vector<char> text(fileSize+1);
//-------------------------------------------------------------------------
// load data from file into buffer
//-------------------------------------------------------------------------
bool error = false;
char *p = text;
char *p = &text[0];
while ( 1 )
{
if (apr_file_eof(fp) == APR_EOF)
@ -399,12 +394,11 @@ BOOL LLKeyframeMotionParam::loadMotions()
//-------------------------------------------------------------------------
// check for error
//-------------------------------------------------------------------------
llassert( p <= (text+fileSize) );
llassert( p <= (&text[0] + fileSize) );
if ( error )
{
llinfos << "ERROR: error while reading from " << path << llendl;
delete [] text;
return FALSE;
}
@ -413,7 +407,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
//-------------------------------------------------------------------------
// parse the text and build keyframe data structures
//-------------------------------------------------------------------------
p = text;
p = &text[0];
S32 num;
char strA[80]; /* Flawfinder: ignore */
char strB[80]; /* Flawfinder: ignore */
@ -432,7 +426,6 @@ BOOL LLKeyframeMotionParam::loadMotions()
if ((num != 3))
{
llinfos << "WARNING: can't read parametric motion" << llendl;
delete [] text;
return FALSE;
}
@ -453,7 +446,6 @@ BOOL LLKeyframeMotionParam::loadMotions()
num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
}
delete [] text;
return TRUE;
}

View File

@ -1083,29 +1083,6 @@ namespace LLError
#endif
prefix << site.mFunction << ": ";
if (site.mPrintOnce)
{
std::map<std::string, unsigned int>::iterator messageIter = s.uniqueLogMessages.find(message);
if (messageIter != s.uniqueLogMessages.end())
{
messageIter->second++;
unsigned int num_messages = messageIter->second;
if (num_messages == 10 || num_messages == 50 || (num_messages % 100) == 0)
{
prefix << "ONCE (" << num_messages << "th time seen): ";
}
else
{
return;
}
}
else
{
prefix << "ONCE: ";
s.uniqueLogMessages[message] = 1;
}
}
if (site.mPrintOnce)
{
std::map<std::string, unsigned int>::iterator messageIter = s.uniqueLogMessages.find(message);
@ -1210,14 +1187,17 @@ namespace LLError
void crashAndLoop(const std::string& message)
{
// Now, we go kaboom!
int* crash = NULL;
int* make_me_crash = NULL;
*crash = 0;
*make_me_crash = 0;
while(true)
{
// Loop forever, in case the crash didn't work?
}
// this is an attempt to let Coverity and other semantic scanners know that this function won't be returning ever.
exit(EXIT_FAILURE);
}
#if LL_WINDOWS
#pragma optimize("", on)

View File

@ -103,17 +103,14 @@ const int LL_ERR_PRICE_MISMATCH = -23018;
#define llwarning(msg, num) llwarns << "Warning # " << num << ": " << msg << llendl;
#ifdef SHOW_ASSERT
#define llassert(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
#else
#define llassert(func)
#endif
#define llassert_always(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
#ifdef SHOW_ASSERT
#define llverify(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl;
#define llassert(func) llassert_always(func)
#define llverify(func) llassert_always(func)
#else
#define llverify(func) (func); // get rid of warning C4189
#define llassert(func)
#define llverify(func) do {if (func) {}} while(0)
#endif
// handy compile-time assert - enforce those template parameters!

View File

@ -1502,7 +1502,7 @@ void LLSDBinaryFormatter::formatString(
*/
int deserialize_string(std::istream& istr, std::string& value, S32 max_bytes)
{
char c = istr.get();
int c = istr.get();
if(istr.fail())
{
// No data in stream, bail out but mention the character we
@ -1544,7 +1544,7 @@ int deserialize_string_delim(
while (true)
{
char next_char = istr.get();
int next_byte = istr.get();
++count;
if(istr.fail())
@ -1553,6 +1553,8 @@ int deserialize_string_delim(
value = write_buffer.str();
return LLSDParser::PARSE_FAILURE;
}
char next_char = (char)next_byte; // Now that we know it's not EOF
if(found_escape)
{
@ -1641,7 +1643,7 @@ int deserialize_string_raw(
char buf[BUF_LEN]; /* Flawfinder: ignore */
istr.get(buf, BUF_LEN - 1, ')');
count += istr.gcount();
char c = istr.get();
int c = istr.get();
c = istr.get();
count += 2;
if(((c == '"') || (c == '\'')) && (buf[0] == '('))

View File

@ -327,6 +327,7 @@ U64 LLStatAccum::sScaleTimes[NUM_SCALES] =
LLStatAccum::LLStatAccum(bool useFrameTimer)
: mUseFrameTimer(useFrameTimer),
mRunning(FALSE),
mLastTime(0),
mLastSampleValue(0.0),
mLastSampleValid(FALSE)
{
@ -347,7 +348,7 @@ void LLStatAccum::reset(U64 when)
{
mBuckets[i].accum = 0.0;
mBuckets[i].endTime = when + sScaleTimes[i];
mBuckets[i].lastValid = FALSE;
mBuckets[i].lastValid = false;
}
}
@ -395,7 +396,7 @@ void LLStatAccum::sum(F64 value, U64 when)
{
F64 valueLeft = value * timeLeft / timeSpan;
bucket.lastValid = TRUE;
bucket.lastValid = true;
bucket.lastAccum = bucket.accum + (value - valueLeft);
bucket.accum = valueLeft;
bucket.endTime += timeScale;
@ -404,7 +405,7 @@ void LLStatAccum::sum(F64 value, U64 when)
{
U64 timeTail = timeLeft % timeScale;
bucket.lastValid = TRUE;
bucket.lastValid = true;
bucket.lastAccum = value * timeScale / timeSpan;
bucket.accum = value * timeTail / timeSpan;
bucket.endTime += (timeLeft - timeTail) + timeScale;

View File

@ -96,11 +96,18 @@ public:
struct Bucket
{
F64 accum;
U64 endTime;
Bucket() :
accum(0.0),
endTime(0),
lastValid(false),
lastAccum(0.0)
{}
BOOL lastValid;
F64 lastAccum;
F64 accum;
U64 endTime;
bool lastValid;
F64 lastAccum;
};
Bucket mBuckets[NUM_SCALES];

View File

@ -45,7 +45,7 @@
// skips spaces and tabs
bool skip_whitespace(std::istream& input_stream)
{
char c = input_stream.peek();
int c = input_stream.peek();
while (('\t' == c || ' ' == c) && input_stream.good())
{
input_stream.get();
@ -57,7 +57,7 @@ bool skip_whitespace(std::istream& input_stream)
// skips whitespace, newlines, and carriage returns
bool skip_emptyspace(std::istream& input_stream)
{
char c = input_stream.peek();
int c = input_stream.peek();
while ( input_stream.good()
&& ('\t' == c || ' ' == c || '\n' == c || '\r' == c) )
{
@ -72,7 +72,7 @@ bool skip_comments_and_emptyspace(std::istream& input_stream)
{
while (skip_emptyspace(input_stream))
{
char c = input_stream.peek();
int c = input_stream.peek();
if ('#' == c )
{
while ('\n' != c && input_stream.good())
@ -90,7 +90,7 @@ bool skip_comments_and_emptyspace(std::istream& input_stream)
bool skip_line(std::istream& input_stream)
{
char c;
int c;
do
{
c = input_stream.get();
@ -100,7 +100,7 @@ bool skip_line(std::istream& input_stream)
bool skip_to_next_word(std::istream& input_stream)
{
char c = input_stream.peek();
int c = input_stream.peek();
while ( input_stream.good()
&& ( (c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
@ -132,7 +132,7 @@ bool skip_to_end_of_next_keyword(const char* keyword, std::istream& input_stream
while (input_stream.good())
{
skip_emptyspace(input_stream);
char c = input_stream.get();
int c = input_stream.get();
if (keyword[0] != c)
{
skip_line(input_stream);
@ -181,7 +181,7 @@ bool skip_to_start_of_next_keyword(const char* keyword, std::istream& input_stre
while (input_stream.good())
{
skip_emptyspace(input_stream);
char c = input_stream.get();
int c = input_stream.get();
if (keyword[0] != c)
{
skip_line(input_stream);
@ -229,7 +229,7 @@ bool skip_to_start_of_next_keyword(const char* keyword, std::istream& input_stre
bool get_word(std::string& output_string, std::istream& input_stream)
{
skip_emptyspace(input_stream);
char c = input_stream.peek();
int c = input_stream.peek();
while ( !isspace(c)
&& '\n' != c
&& '\r' != c
@ -246,7 +246,7 @@ bool get_word(std::string& output_string, std::istream& input_stream, int n)
{
skip_emptyspace(input_stream);
int char_count = 0;
char c = input_stream.peek();
int c = input_stream.peek();
while (!isspace(c)
&& '\n' != c
&& '\r' != c
@ -265,7 +265,7 @@ bool get_word(std::string& output_string, std::istream& input_stream, int n)
bool get_line(std::string& output_string, std::istream& input_stream)
{
output_string.clear();
char c = input_stream.get();
int c = input_stream.get();
while (input_stream.good())
{
output_string += c;
@ -285,7 +285,7 @@ bool get_line(std::string& output_string, std::istream& input_stream, int n)
{
output_string.clear();
int char_count = 0;
char c = input_stream.get();
int c = input_stream.get();
while (input_stream.good() && char_count < n)
{
char_count++;
@ -436,7 +436,7 @@ void get_keyword_and_value(std::string& keyword,
while (line_index < line_size)
{
c = line[line_index];
if (!isspace(c))
if (!LLStringOps::isSpace(c))
{
break;
}
@ -448,7 +448,7 @@ void get_keyword_and_value(std::string& keyword,
while (line_index < line_size)
{
c = line[line_index];
if (isspace(c) || '\r' == c || '\n' == c)
if (LLStringOps::isSpace(c) || '\r' == c || '\n' == c)
{
break;
}

View File

@ -226,8 +226,8 @@ LLOSInfo::LLOSInfo() :
else if (ostype == "Linux")
{
// Only care about major and minor Linux versions, truncate at second '.'
S32 idx1 = mOSStringSimple.find_first_of(".", 0);
S32 idx2 = (idx1 != std::string::npos) ? mOSStringSimple.find_first_of(".", idx1+1) : std::string::npos;
std::string::size_type idx1 = mOSStringSimple.find_first_of(".", 0);
std::string::size_type idx2 = (idx1 != std::string::npos) ? mOSStringSimple.find_first_of(".", idx1+1) : std::string::npos;
std::string simple = mOSStringSimple.substr(0, idx2);
if (simple.length() > 0)
mOSStringSimple = simple;

View File

@ -141,7 +141,9 @@ const U64 GP_NOTICES_SEND = 0x1LL << 42; // Send Notices
const U64 GP_NOTICES_RECEIVE = 0x1LL << 43; // Receive Notices and View Notice History
// Proposals
// TODO: _DEPRECATED suffix as part of vote removal - DEV-24856:
const U64 GP_PROPOSAL_START = 0x1LL << 44; // Start Proposal
// TODO: _DEPRECATED suffix as part of vote removal - DEV-24856:
const U64 GP_PROPOSAL_VOTE = 0x1LL << 45; // Vote on Proposal
// Group chat moderation related
@ -152,20 +154,17 @@ const U64 GP_SESSION_MODERATOR = 0x1LL << 37; //can mute people's session
const U64 GP_DEFAULT_MEMBER = GP_ACCOUNTING_ACCOUNTABLE
| GP_LAND_ALLOW_SET_HOME
| GP_NOTICES_RECEIVE
| GP_PROPOSAL_START
| GP_PROPOSAL_VOTE
| GP_SESSION_JOIN
| GP_SESSION_JOIN
| GP_SESSION_VOICE
;
const U64 GP_DEFAULT_OFFICER = GP_ACCOUNTING_ACCOUNTABLE
const U64 GP_DEFAULT_OFFICER = GP_DEFAULT_MEMBER // Superset of GP_DEFAULT_MEMBER
| GP_GROUP_CHANGE_IDENTITY
| GP_LAND_ADMIN
| GP_LAND_ALLOW_EDIT_LAND
| GP_LAND_ALLOW_FLY
| GP_LAND_ALLOW_CREATE
| GP_LAND_ALLOW_LANDMARK
| GP_LAND_ALLOW_SET_HOME
| GP_LAND_CHANGE_IDENTITY
| GP_LAND_CHANGE_MEDIA
| GP_LAND_DEED
@ -187,17 +186,12 @@ const U64 GP_DEFAULT_OFFICER = GP_ACCOUNTING_ACCOUNTABLE
| GP_MEMBER_INVITE
| GP_MEMBER_OPTIONS
| GP_MEMBER_VISIBLE_IN_DIR
| GP_NOTICES_RECEIVE
| GP_NOTICES_SEND
| GP_OBJECT_DEED
| GP_OBJECT_MANIPULATE
| GP_OBJECT_SET_SALE
| GP_PROPOSAL_START
| GP_PROPOSAL_VOTE
| GP_ROLE_ASSIGN_MEMBER_LIMITED
| GP_ROLE_PROPERTIES
| GP_SESSION_MODERATOR
| GP_SESSION_JOIN
| GP_SESSION_VOICE
;
#endif

View File

@ -417,22 +417,17 @@ void LLImageRaw::verticalFlip()
{
LLMemType mt1((LLMemType::EMemType)mMemType);
S32 row_bytes = getWidth() * getComponents();
U8* line_buffer = new U8[row_bytes];
if (!line_buffer )
{
llerrs << "Out of memory in LLImageRaw::verticalFlip()" << llendl;
return;
}
llassert(row_bytes > 0);
std::vector<U8> line_buffer(row_bytes);
S32 mid_row = getHeight() / 2;
for( S32 row = 0; row < mid_row; row++ )
{
U8* row_a_data = getData() + row * row_bytes;
U8* row_b_data = getData() + (getHeight() - 1 - row) * row_bytes;
memcpy( line_buffer, row_a_data, row_bytes ); /* Flawfinder: ignore */
memcpy( row_a_data, row_b_data, row_bytes ); /* Flawfinder: ignore */
memcpy( row_b_data, line_buffer, row_bytes ); /* Flawfinder: ignore */
memcpy( &line_buffer[0], row_a_data, row_bytes );
memcpy( row_a_data, row_b_data, row_bytes );
memcpy( row_b_data, &line_buffer[0], row_bytes );
}
delete[] line_buffer;
}
@ -560,22 +555,21 @@ void LLImageRaw::compositeScaled4onto3(LLImageRaw* src)
llassert( (4 == src->getComponents()) && (3 == dst->getComponents()) );
// Vertical: scale but no composite
S32 temp_data_size = src->getWidth() * dst->getHeight() * src->getComponents();
U8* temp_buffer = new U8[ temp_data_size ];
llassert_always(temp_data_size > 0);
std::vector<U8> temp_buffer(temp_data_size);
// Vertical: scale but no composite
for( S32 col = 0; col < src->getWidth(); col++ )
{
copyLineScaled( src->getData() + (src->getComponents() * col), temp_buffer + (src->getComponents() * col), src->getHeight(), dst->getHeight(), src->getWidth(), src->getWidth() );
copyLineScaled( src->getData() + (src->getComponents() * col), &temp_buffer[0] + (src->getComponents() * col), src->getHeight(), dst->getHeight(), src->getWidth(), src->getWidth() );
}
// Horizontal: scale and composite
for( S32 row = 0; row < dst->getHeight(); row++ )
{
compositeRowScaled4onto3( temp_buffer + (src->getComponents() * src->getWidth() * row), dst->getData() + (dst->getComponents() * dst->getWidth() * row), src->getWidth(), dst->getWidth() );
compositeRowScaled4onto3( &temp_buffer[0] + (src->getComponents() * src->getWidth() * row), dst->getData() + (dst->getComponents() * dst->getWidth() * row), src->getWidth(), dst->getWidth() );
}
// Clean up
delete[] temp_buffer;
}
@ -805,23 +799,21 @@ void LLImageRaw::copyScaled( LLImageRaw* src )
return;
}
// Vertical
S32 temp_data_size = src->getWidth() * dst->getHeight() * getComponents();
llassert_always(temp_data_size > 0);
U8* temp_buffer = new U8[ temp_data_size ];
std::vector<U8> temp_buffer(temp_data_size);
// Vertical
for( S32 col = 0; col < src->getWidth(); col++ )
{
copyLineScaled( src->getData() + (getComponents() * col), temp_buffer + (getComponents() * col), src->getHeight(), dst->getHeight(), src->getWidth(), src->getWidth() );
copyLineScaled( src->getData() + (getComponents() * col), &temp_buffer[0] + (getComponents() * col), src->getHeight(), dst->getHeight(), src->getWidth(), src->getWidth() );
}
// Horizontal
for( S32 row = 0; row < dst->getHeight(); row++ )
{
copyLineScaled( temp_buffer + (getComponents() * src->getWidth() * row), dst->getData() + (getComponents() * dst->getWidth() * row), src->getWidth(), dst->getWidth(), 1, 1 );
copyLineScaled( &temp_buffer[0] + (getComponents() * src->getWidth() * row), dst->getData() + (getComponents() * dst->getWidth() * row), src->getWidth(), dst->getWidth(), 1, 1 );
}
// Clean up
delete[] temp_buffer;
}
@ -842,12 +834,14 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
if (scale_image_data)
{
// Vertical
S32 temp_data_size = old_width * new_height * getComponents();
U8* temp_buffer = new U8[ temp_data_size ];
llassert_always(temp_data_size > 0);
std::vector<U8> temp_buffer(temp_data_size);
// Vertical
for( S32 col = 0; col < old_width; col++ )
{
copyLineScaled( getData() + (getComponents() * col), temp_buffer + (getComponents() * col), old_height, new_height, old_width, old_width );
copyLineScaled( getData() + (getComponents() * col), &temp_buffer[0] + (getComponents() * col), old_height, new_height, old_width, old_width );
}
deleteData();
@ -857,25 +851,15 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
// Horizontal
for( S32 row = 0; row < new_height; row++ )
{
copyLineScaled( temp_buffer + (getComponents() * old_width * row), new_buffer + (getComponents() * new_width * row), old_width, new_width, 1, 1 );
copyLineScaled( &temp_buffer[0] + (getComponents() * old_width * row), new_buffer + (getComponents() * new_width * row), old_width, new_width, 1, 1 );
}
// Clean up
delete[] temp_buffer;
}
else
{
// copy out existing image data
S32 temp_data_size = old_width * old_height * getComponents();
U8* temp_buffer = new U8[ temp_data_size ];
if (!temp_buffer)
{
llwarns << "Out of memory in LLImageRaw::scale: old (w, h, c) = (" << old_width << ", " << old_height << ", " << (S32)getComponents() <<
") ; new (w, h, c) = (" << new_width << ", " << new_height << ", " << (S32)getComponents() << ")" << llendl;
return FALSE ;
}
memcpy(temp_buffer, getData(), temp_data_size); /* Flawfinder: ignore */
std::vector<U8> temp_buffer(temp_data_size);
memcpy(&temp_buffer[0], getData(), temp_data_size);
// allocate new image data, will delete old data
U8* new_buffer = allocateDataSize(new_width, new_height, getComponents());
@ -884,7 +868,7 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
{
if (row < old_height)
{
memcpy(new_buffer + (new_width * row * getComponents()), temp_buffer + (old_width * row * getComponents()), getComponents() * llmin(old_width, new_width)); /* Flawfinder: ignore */
memcpy(new_buffer + (new_width * row * getComponents()), &temp_buffer[0] + (old_width * row * getComponents()), getComponents() * llmin(old_width, new_width));
if (old_width < new_width)
{
// pad out rest of row with black
@ -897,9 +881,6 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
memset(new_buffer + (new_width * row * getComponents()), 0, new_width * getComponents());
}
}
// Clean up
delete[] temp_buffer;
}
return TRUE ;
@ -1239,7 +1220,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
llassert(image.notNull());
U8 *buffer = image->allocateData(length);
ifs.read ((char*)buffer, length); /* Flawfinder: ignore */
ifs.read ((char*)buffer, length);
ifs.close();
image->updateData();

View File

@ -1257,23 +1257,19 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
// Early exit on an empty binary bucket.
if (bin_bucket_size <= 1) return;
// Convert the bin_bucket into a string.
char* item_buffer = new char[bin_bucket_size+1];
if ((item_buffer != NULL) && (bin_bucket != NULL))
if (NULL == bin_bucket)
{
memcpy(item_buffer, bin_bucket, bin_bucket_size); /* Flawfinder: ignore */
}
else
{
llerrs << "unpackBinaryBucket failed. item_buffer or bin_bucket is Null." << llendl;
delete[] item_buffer;
llerrs << "unpackBinaryBucket failed. bin_bucket is NULL." << llendl;
return;
}
item_buffer[bin_bucket_size] = '\0';
std::string str(item_buffer);
lldebugs << "item buffer: " << item_buffer << llendl;
delete[] item_buffer;
// Convert the bin_bucket into a string.
std::vector<char> item_buffer(bin_bucket_size+1);
memcpy(&item_buffer[0], bin_bucket, bin_bucket_size); /* Flawfinder: ignore */
item_buffer[bin_bucket_size] = '\0';
std::string str(&item_buffer[0]);
lldebugs << "item buffer: " << str << llendl;
// Tokenize the string.
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;

View File

@ -426,6 +426,7 @@ bool LLCacheName::importFile(std::istream& istr)
entry->mFirstName = agent[FIRST].asString();
entry->mLastName = agent[LAST].asString();
impl.mCache[id] = entry;
++count;
}
llinfos << "LLCacheName loaded " << count << " agent names" << llendl;

View File

@ -77,6 +77,8 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
mPacketsOutID(0),
mPacketsInID(in_id),
mHighestPacketID(in_id),
mTimeoutCallback(NULL),
mTimeoutUserData(NULL),
mTrusted(FALSE),
mbAllowTimeout(TRUE),
mbAlive(TRUE),
@ -102,11 +104,12 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
mBytesOutLastPeriod(0),
mBytesInThisPeriod(0),
mBytesOutThisPeriod(0),
mPeakBPSIn(0),
mPeakBPSOut(0),
mPeakBPSIn(0.f),
mPeakBPSOut(0.f),
mPeriodTime(0.0),
mExistenceTimer(),
mCurrentResendCount(0),
mLastPacketGap(0),
mHeartbeatInterval(circuit_heartbeat_interval),
mHeartbeatTimeout(circuit_timeout)
{
@ -121,9 +124,6 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
mNextPingSendTime = mLastPingSendTime + 0.95*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval);
mPeriodTime = mt_sec;
mTimeoutCallback = NULL;
mTimeoutUserData = NULL;
mLocalEndPointID.generate();
}

View File

@ -74,7 +74,7 @@
//////////////////////////////////////////////////////////////////////////////
static const S32 EASY_HANDLE_POOL_SIZE = 5;
static const U32 EASY_HANDLE_POOL_SIZE = 5;
static const S32 MULTI_PERFORM_CALL_REPEAT = 5;
static const S32 CURL_REQUEST_TIMEOUT = 30; // seconds
static const S32 MAX_ACTIVE_REQUEST_COUNT = 100;

View File

@ -1896,7 +1896,12 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
if (mFP)
{
fpos_t last_pos;
fgetpos(mFP, &last_pos);
if (0 != fgetpos(mFP, &last_pos)) // 0==success for fgetpos
{
llwarns << "Data packer failed to fgetpos" << llendl;
return FALSE;
}
if (fgets(buffer, DP_BUFSIZE, mFP) == NULL)
{
buffer[0] = '\0';

View File

@ -161,10 +161,9 @@ namespace
fstream.seekg(0, std::ios::end);
U32 fileSize = fstream.tellg();
fstream.seekg(0, std::ios::beg);
char* fileBuffer;
fileBuffer = new char [fileSize];
fstream.read(fileBuffer, fileSize);
ostream.write(fileBuffer, fileSize);
std::vector<char> fileBuffer(fileSize);
fstream.read(&fileBuffer[0], fileSize);
ostream.write(&fileBuffer[0], fileSize);
fstream.close();
eos = true;
return STATUS_DONE;

View File

@ -74,6 +74,7 @@ enum EInstantMessage
// Group vote
// Name is name of person who called vote.
// ID is vote ID used for internal tracking
// TODO: _DEPRECATED suffix as part of vote removal - DEV-24856
IM_GROUP_VOTE = 7,
// Group message

View File

@ -677,7 +677,11 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
// default to 0s.
U32 size = mvci.getSize();
std::vector<U8> data(size);
memset(&(data[0]), 0, size);
if(size)
{
// Nonsense test to get past GCC 4.3.1 bug with -O3
memset(&(data[0]), 0, size);
}
cur_data_block->addData(mvci.getName(), &(data[0]),
size, mvci.getType());
}

View File

@ -209,7 +209,7 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
{ //read back channel locations
//read back reserved channels first
for (U32 i = 0; i < (S32) LLShaderMgr::instance()->mReservedAttribs.size(); i++)
for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++)
{
const char* name = LLShaderMgr::instance()->mReservedAttribs[i].c_str();
S32 index = glGetAttribLocationARB(mProgramObject, (const GLcharARB *)name);

View File

@ -99,7 +99,7 @@ mCurrAlphaSrc1(TBS_TEX_ALPHA), mCurrAlphaSrc2(TBS_PREV_ALPHA),
mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0),
mHasMipMaps(false)
{
llassert_always(index < LL_NUM_TEXTURE_LAYERS);
llassert_always(index < (S32)LL_NUM_TEXTURE_LAYERS);
mIndex = index;
}
@ -141,7 +141,7 @@ void LLTexUnit::activate(void)
{
if (mIndex < 0) return;
if (gGL.mCurrTextureUnitIndex != mIndex || gGL.mDirty)
if ((S32)gGL.mCurrTextureUnitIndex != mIndex || gGL.mDirty)
{
glActiveTextureARB(GL_TEXTURE0_ARB + mIndex);
gGL.mCurrTextureUnitIndex = mIndex;
@ -821,7 +821,7 @@ void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor)
LLTexUnit* LLRender::getTexUnit(U32 index)
{
if ((index >= 0) && (index < mTexUnits.size()))
if (index < mTexUnits.size())
{
return mTexUnits[index];
}

View File

@ -811,7 +811,7 @@ U8* LLVertexBuffer::mapBuffer(S32 access)
GLint buff;
glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
if (buff != mGLBuffer)
if ((GLuint)buff != mGLBuffer)
{
llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
}
@ -824,7 +824,7 @@ U8* LLVertexBuffer::mapBuffer(S32 access)
{
GLint buff;
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
if (buff != mGLIndices)
if ((GLuint)buff != mGLIndices)
{
llerrs << "Invalid GL index buffer bound: " << buff << llendl;
}
@ -1020,13 +1020,13 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
{
GLint buff;
glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
if (buff != mGLBuffer)
if ((GLuint)buff != mGLBuffer)
{
llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
}
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
if (buff != mGLIndices)
if ((GLuint)buff != mGLIndices)
{
llerrs << "Invalid GL index buffer bound: " << buff << llendl;
}
@ -1038,13 +1038,13 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
{
GLint buff;
glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
if (buff != mGLBuffer)
if ((GLuint)buff != mGLBuffer)
{
llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
}
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
if (buff != mGLIndices)
if ((GLuint)buff != mGLIndices)
{
llerrs << "Invalid GL index buffer bound: " << buff << llendl;
}

View File

@ -93,3 +93,44 @@ BOOL LLClipboard::canPasteString() const
{
return LLView::getWindow()->isClipboardTextAvailable();
}
void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id )
{
mSourceID = source_id;
mString = src.substr(pos, len);
LLView::getWindow()->copyTextToPrimary( mString );
}
const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id )
{
if( mSourceID.notNull() )
{
LLWString temp_string;
LLView::getWindow()->pasteTextFromPrimary(temp_string);
if( temp_string != mString )
{
mSourceID.setNull();
mString = temp_string;
}
}
else
{
LLView::getWindow()->pasteTextFromPrimary(mString);
}
if( source_id )
{
*source_id = mSourceID;
}
return mString;
}
BOOL LLClipboard::canPastePrimaryString() const
{
return LLView::getWindow()->isPrimaryTextAvailable();
}

View File

@ -44,10 +44,19 @@ public:
LLClipboard();
~LLClipboard();
/* We support two flavors of clipboard. The default is the explicitly
copy-and-pasted clipboard. The second is the so-called 'primary' clipboard
which is implicitly copied upon selection on platforms which expect this
(i.e. X11/Linux). */
void copyFromSubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
BOOL canPasteString() const;
const LLWString& getPasteWString(LLUUID* source_id = NULL);
void copyFromPrimarySubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
BOOL canPastePrimaryString() const;
const LLWString& getPastePrimaryWString(LLUUID* source_id = NULL);
private:
LLUUID mSourceID;
LLWString mString;

View File

@ -1193,6 +1193,12 @@ BOOL LLFloater::handleRightMouseDown(S32 x, S32 y, MASK mask)
return was_minimized || LLPanel::handleRightMouseDown( x, y, mask );
}
BOOL LLFloater::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
bringToFront( x, y );
return LLPanel::handleMiddleMouseDown( x, y, mask );
}
// virtual
BOOL LLFloater::handleDoubleClick(S32 x, S32 y, MASK mask)
@ -2188,7 +2194,7 @@ BOOL LLFloaterView::allChildrenClosed()
LLView* viewp = *it;
LLFloater* floaterp = (LLFloater*)viewp;
if (floaterp->getVisible() && !floaterp->isDead() && floaterp->canClose())
if (floaterp->getVisible() && !floaterp->isDead() && floaterp->isCloseable())
{
return false;
}

View File

@ -195,7 +195,7 @@ public:
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask);
virtual void draw();
virtual void onOpen() {}

View File

@ -489,6 +489,9 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
// delay cursor flashing
mKeystrokeTimer.reset();
// take selection to 'primary' clipboard
updatePrimary();
return TRUE;
}
@ -571,6 +574,17 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask)
return TRUE;
}
BOOL LLLineEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
// llinfos << "MiddleMouseDown" << llendl;
setFocus( TRUE );
if( canPastePrimary() )
{
setCursorAtLocalPos(x);
pastePrimary();
}
return TRUE;
}
BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask)
{
@ -665,6 +679,9 @@ BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask)
{
// delay cursor flashing
mKeystrokeTimer.reset();
// take selection to 'primary' clipboard
updatePrimary();
}
return handled;
@ -868,7 +885,12 @@ BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask)
}
}
if(handled)
{
// take selection to 'primary' clipboard
updatePrimary();
}
return handled;
}
@ -877,7 +899,7 @@ void LLLineEditor::deleteSelection()
if( !mReadOnly && hasSelection() )
{
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 selection_length = abs( mSelectionStart - mSelectionEnd );
S32 selection_length = llabs( mSelectionStart - mSelectionEnd );
mText.erase(left_pos, selection_length);
deselect();
@ -900,7 +922,7 @@ void LLLineEditor::cut()
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = abs( mSelectionStart - mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
gClipboard.copyFromSubstring( mText.getWString(), left_pos, length );
deleteSelection();
@ -931,7 +953,7 @@ void LLLineEditor::copy()
if( canCopy() )
{
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = abs( mSelectionStart - mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
gClipboard.copyFromSubstring( mText.getWString(), left_pos, length );
}
}
@ -941,20 +963,50 @@ BOOL LLLineEditor::canPaste() const
return !mReadOnly && gClipboard.canPasteString();
}
// paste from clipboard
void LLLineEditor::paste()
{
if (canPaste())
bool is_primary = false;
pasteHelper(is_primary);
}
void LLLineEditor::pastePrimary()
{
bool is_primary = true;
pasteHelper(is_primary);
}
// paste from primary (is_primary==true) or clipboard (is_primary==false)
void LLLineEditor::pasteHelper(bool is_primary)
{
bool can_paste_it;
if (is_primary)
{
LLWString paste = gClipboard.getPasteWString();
can_paste_it = canPastePrimary();
}
else
{
can_paste_it = canPaste();
}
if (can_paste_it)
{
LLWString paste;
if (is_primary)
{
paste = gClipboard.getPastePrimaryWString();
}
else
{
paste = gClipboard.getPasteWString();
}
if (!paste.empty())
{
// Prepare for possible rollback
LLLineEditorRollback rollback(this);
// Delete any selected characters
if (hasSelection())
if ((!is_primary) && hasSelection())
{
deleteSelection();
}
@ -990,7 +1042,7 @@ void LLLineEditor::paste()
clean_string = clean_string.substr(0, wchars_that_fit);
reportBadKeystroke();
}
mText.insert(getCursor(), clean_string);
setCursor( getCursor() + (S32)clean_string.length() );
deselect();
@ -1011,7 +1063,30 @@ void LLLineEditor::paste()
}
}
// copy selection to primary
void LLLineEditor::copyPrimary()
{
if( canCopy() )
{
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
gClipboard.copyFromPrimarySubstring( mText.getWString(), left_pos, length );
}
}
BOOL LLLineEditor::canPastePrimary() const
{
return !mReadOnly && gClipboard.canPastePrimaryString();
}
void LLLineEditor::updatePrimary()
{
if(canCopy() )
{
copyPrimary();
}
}
BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
{
BOOL handled = FALSE;

View File

@ -90,6 +90,7 @@ public:
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask);
/*virtual*/ BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask);
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask );
/*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char);
/*virtual*/ void onMouseCaptureLost();
@ -97,13 +98,16 @@ public:
// LLEditMenuHandler overrides
virtual void cut();
virtual BOOL canCut() const;
virtual void copy();
virtual BOOL canCopy() const;
virtual void paste();
virtual BOOL canPaste() const;
virtual void updatePrimary();
virtual void copyPrimary();
virtual void pastePrimary();
virtual BOOL canPastePrimary() const;
virtual void doDelete();
virtual BOOL canDoDelete() const;
@ -217,6 +221,9 @@ public:
private:
// private helper methods
void pasteHelper(bool is_primary);
void removeChar();
void addChar(const llwchar c);
void setCursorAtLocalPos(S32 local_mouse_x);

View File

@ -931,7 +931,8 @@ LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name,
void* user_data,
KEY key, MASK mask ) :
LLMenuItemCallGL( name, label, clicked_cb, enabled_cb, user_data, key, mask ),
mCheckCallback( NULL )
mCheckCallback( NULL ),
mChecked(FALSE)
{
setControlName(control_name, context);
}

View File

@ -257,6 +257,8 @@ std::string LLResMgr::getMonetaryString( S32 input ) const
// On the Mac, locale support is broken before 10.4, which causes things to go all pear-shaped.
// Fake up a conv structure with some reasonable values for the fields this function uses.
struct lconv fakeconv;
char fake_neg[2] = "-";
char fake_mon_group[4] = "\x03\x03\x00"; // commas every 3 digits
if(conv->negative_sign[0] == 0) // Real locales all seem to have something here...
{
fakeconv = *conv; // start with what's there.
@ -265,8 +267,8 @@ std::string LLResMgr::getMonetaryString( S32 input ) const
default: // Unknown -- use the US defaults.
case LLLOCALE_USA:
case LLLOCALE_UK: // UK ends up being the same as US for the items used here.
fakeconv.negative_sign = "-";
fakeconv.mon_grouping = "\x03\x03\x00"; // commas every 3 digits
fakeconv.negative_sign = fake_neg;
fakeconv.mon_grouping = fake_mon_group;
fakeconv.n_sign_posn = 1; // negative sign before the string
break;
}

View File

@ -835,6 +835,12 @@ void LLScrollListCtrl::updateLayout()
mItemListRect.mRight = getRect().getWidth() - mBorderThickness - SCROLLBAR_SIZE;
}
// don't allow scrolling off bottom
if (mScrollLines + mPageLines > getItemCount())
{
setScrollPos(llmax(0, getItemCount() - mPageLines));
}
mScrollbar->reshape(SCROLLBAR_SIZE, mItemListRect.getHeight() + (mDisplayColumnHeaders ? mHeadingHeight : 0));
mScrollbar->setPageSize( mPageLines );
mScrollbar->setDocSize( getItemCount() );
@ -2663,6 +2669,11 @@ void LLScrollListCtrl::scrollToShowSelected()
return;
}
if (needsSorting() && !isSorted())
{
sortItems();
}
S32 index = getFirstSelectedIndex();
if (index < 0)
{

View File

@ -933,7 +933,7 @@ BOOL LLTextEditor::selectionContainsLineBreaks()
if (hasSelection())
{
S32 left = llmin(mSelectionStart, mSelectionEnd);
S32 right = left + abs(mSelectionStart - mSelectionEnd);
S32 right = left + llabs(mSelectionStart - mSelectionEnd);
const LLWString &wtext = mWText;
for( S32 i = left; i < right; i++ )
@ -989,7 +989,7 @@ void LLTextEditor::indentSelectedLines( S32 spaces )
{
const LLWString &text = mWText;
S32 left = llmin( mSelectionStart, mSelectionEnd );
S32 right = left + abs( mSelectionStart - mSelectionEnd );
S32 right = left + llabs( mSelectionStart - mSelectionEnd );
BOOL cursor_on_right = (mSelectionEnd > mSelectionStart);
S32 cur = left;
@ -1203,6 +1203,18 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
}
BOOL LLTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
setFocus( TRUE );
if( canPastePrimary() )
{
setCursorAtLocalPos( x, y, TRUE );
pastePrimary();
}
return TRUE;
}
BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask)
{
BOOL handled = FALSE;
@ -1323,8 +1335,6 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
setCursorAtLocalPos( x, y, TRUE );
endSelection();
updateScrollFromCursor();
}
if( !hasSelection() )
@ -1332,6 +1342,9 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
handleMouseUpOverSegment( x, y, mask );
}
// take selection to 'primary' clipboard
updatePrimary();
handled = TRUE;
}
@ -1394,8 +1407,12 @@ BOOL LLTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
// delay cursor flashing
resetKeystrokeTimer();
// take selection to 'primary' clipboard
updatePrimary();
handled = TRUE;
}
return handled;
}
@ -1691,6 +1708,12 @@ BOOL LLTextEditor::handleSelectionKey(const KEY key, const MASK mask)
}
}
if( handled )
{
// take selection to 'primary' clipboard
updatePrimary();
}
return handled;
}
@ -1818,7 +1841,7 @@ void LLTextEditor::deleteSelection(BOOL group_with_next_op )
if( getEnabled() && hasSelection() )
{
S32 pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = abs( mSelectionStart - mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
remove( pos, length, group_with_next_op );
@ -1841,7 +1864,7 @@ void LLTextEditor::cut()
return;
}
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = abs( mSelectionStart - mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
gClipboard.copyFromSubstring( mWText, left_pos, length, mSourceID );
deleteSelection( FALSE );
@ -1861,7 +1884,7 @@ void LLTextEditor::copy()
return;
}
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = abs( mSelectionStart - mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
gClipboard.copyFromSubstring(mWText, left_pos, length, mSourceID);
}
@ -1870,22 +1893,56 @@ BOOL LLTextEditor::canPaste() const
return !mReadOnly && gClipboard.canPasteString();
}
// paste from clipboard
void LLTextEditor::paste()
{
if (!canPaste())
bool is_primary = false;
pasteHelper(is_primary);
}
// paste from primary
void LLTextEditor::pastePrimary()
{
bool is_primary = true;
pasteHelper(is_primary);
}
// paste from primary (itsprimary==true) or clipboard (itsprimary==false)
void LLTextEditor::pasteHelper(bool is_primary)
{
bool can_paste_it;
if (is_primary)
{
can_paste_it = canPastePrimary();
}
else
{
can_paste_it = canPaste();
}
if (!can_paste_it)
{
return;
}
LLUUID source_id;
LLWString paste = gClipboard.getPasteWString(&source_id);
LLWString paste;
if (is_primary)
{
paste = gClipboard.getPastePrimaryWString(&source_id);
}
else
{
paste = gClipboard.getPasteWString(&source_id);
}
if (paste.empty())
{
return;
}
// Delete any selected characters (the paste replaces them)
if( hasSelection() )
if( (!is_primary) && hasSelection() )
{
deleteSelection(TRUE);
}
@ -1919,6 +1976,32 @@ void LLTextEditor::paste()
}
// copy selection to primary
void LLTextEditor::copyPrimary()
{
if( !canCopy() )
{
return;
}
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
gClipboard.copyFromPrimarySubstring(mWText, left_pos, length, mSourceID);
}
BOOL LLTextEditor::canPastePrimary() const
{
return !mReadOnly && gClipboard.canPastePrimaryString();
}
void LLTextEditor::updatePrimary()
{
if (canCopy())
{
copyPrimary();
}
}
BOOL LLTextEditor::handleControlKey(const KEY key, const MASK mask)
{
BOOL handled = FALSE;
@ -1994,6 +2077,11 @@ BOOL LLTextEditor::handleControlKey(const KEY key, const MASK mask)
}
}
if (handled)
{
updatePrimary();
}
return handled;
}
@ -4330,13 +4418,34 @@ S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse)
}
else
{
// adjust the search slightly, to allow matching parenthesis inside the URL
S32 paren_count = 0;
for (int index=pos; index<(S32)line.length(); index++)
{
char c = line[index];
S32 m2 = closers.find(c);
if (m2 >= 0)
if (c == '(')
{
return index;
paren_count++;
}
else if (c == ')')
{
if (paren_count <= 0)
{
return index;
}
else
{
paren_count--;
}
}
else
{
S32 m2 = closers.find(c);
if (m2 >= 0)
{
return index;
}
}
}
return line.length();

View File

@ -84,6 +84,8 @@ public:
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask );
virtual BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask);
virtual BOOL handleKeyHere(KEY key, MASK mask );
virtual BOOL handleUnicodeCharHere(llwchar uni_char);
@ -112,12 +114,19 @@ public:
virtual BOOL canUndo() const;
virtual void redo();
virtual BOOL canRedo() const;
virtual void cut();
virtual BOOL canCut() const;
virtual void copy();
virtual BOOL canCopy() const;
virtual void paste();
virtual BOOL canPaste() const;
virtual void updatePrimary();
virtual void copyPrimary();
virtual void pastePrimary();
virtual BOOL canPastePrimary() const;
virtual void doDelete();
virtual BOOL canDoDelete() const;
virtual void selectAll();
@ -430,6 +439,8 @@ private:
//
// Methods
//
void pasteHelper(bool is_primary);
void updateSegments();
void pruneSegments();

View File

@ -987,6 +987,30 @@ BOOL LLView::handleRightMouseUp(S32 x, S32 y, MASK mask)
}
return handled;
}
BOOL LLView::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
LLView* handled_view = childrenHandleMiddleMouseDown( x, y, mask );
BOOL handled = (handled_view != NULL);
if( !handled && blockMouseEvent(x, y) )
{
handled = TRUE;
handled_view = this;
}
return handled;
}
BOOL LLView::handleMiddleMouseUp(S32 x, S32 y, MASK mask)
{
BOOL handled = childrenHandleMiddleMouseUp( x, y, mask ) != NULL;
if( !handled && blockMouseEvent(x, y) )
{
handled = TRUE;
}
return handled;
}
LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks)
{
@ -1148,6 +1172,34 @@ LLView* LLView::childrenHandleRightMouseDown(S32 x, S32 y, MASK mask)
return handled_view;
}
LLView* LLView::childrenHandleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
LLView* handled_view = NULL;
if (getVisible() && getEnabled() )
{
for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
{
LLView* viewp = *child_it;
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
if (viewp->pointInView(local_x, local_y) &&
viewp->getVisible() &&
viewp->getEnabled() &&
viewp->handleMiddleMouseDown( local_x, local_y, mask ))
{
if (sDebugMouseHandling)
{
sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage;
}
handled_view = viewp;
break;
}
}
}
return handled_view;
}
LLView* LLView::childrenHandleDoubleClick(S32 x, S32 y, MASK mask)
{
LLView* handled_view = NULL;
@ -1233,6 +1285,32 @@ LLView* LLView::childrenHandleRightMouseUp(S32 x, S32 y, MASK mask)
return handled_view;
}
LLView* LLView::childrenHandleMiddleMouseUp(S32 x, S32 y, MASK mask)
{
LLView* handled_view = NULL;
if( getVisible() && getEnabled() )
{
for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
{
LLView* viewp = *child_it;
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
if (viewp->pointInView(local_x, local_y) &&
viewp->getVisible() &&
viewp->getEnabled() &&
viewp->handleMiddleMouseUp( local_x, local_y, mask ))
{
if (sDebugMouseHandling)
{
sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage;
}
handled_view = viewp;
break;
}
}
}
return handled_view;
}
void LLView::draw()
{

View File

@ -465,6 +465,8 @@ public:
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
@ -603,6 +605,8 @@ protected:
LLView* childrenHandleHover(S32 x, S32 y, MASK mask);
LLView* childrenHandleMouseUp(S32 x, S32 y, MASK mask);
LLView* childrenHandleMouseDown(S32 x, S32 y, MASK mask);
LLView* childrenHandleMiddleMouseUp(S32 x, S32 y, MASK mask);
LLView* childrenHandleMiddleMouseDown(S32 x, S32 y, MASK mask);
LLView* childrenHandleDoubleClick(S32 x, S32 y, MASK mask);
LLView* childrenHandleScrollWheel(S32 x, S32 y, S32 clicks);
LLView* childrenHandleRightMouseDown(S32 x, S32 y, MASK mask);

View File

@ -354,18 +354,17 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename
(mIndexFP = openAndLock(mIndexFilename, file_mode, mReadOnly))
)
{
U8 *buffer = new U8[fbuf.st_size];
size_t nread = fread(buffer, 1, fbuf.st_size, mIndexFP);
U8 *tmp_ptr = buffer;
std::vector<U8> buffer(fbuf.st_size);
size_t buf_offset = 0;
size_t nread = fread(&buffer[0], 1, fbuf.st_size, mIndexFP);
std::vector<LLVFSFileBlock*> files_by_loc;
while (tmp_ptr < buffer + nread)
while (buf_offset < nread)
{
LLVFSFileBlock *block = new LLVFSFileBlock();
block->deserialize(tmp_ptr, (S32)(tmp_ptr - buffer));
block->deserialize(&buffer[buf_offset], (S32)buf_offset);
// Do sanity check on this block.
// Note that this skips zero size blocks, which helps VFS
@ -389,7 +388,6 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename
LL_WARNS("VFS") << "Length: " << block->mLength << "\tLocation: " << block->mLocation << "\tSize: " << block->mSize << LL_ENDL;
LL_WARNS("VFS") << "File has bad data - VFS removed" << LL_ENDL;
delete[] buffer;
delete block;
unlockAndClose( mIndexFP );
@ -412,15 +410,13 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename
else
{
// this is a null or bad entry, skip it
S32 index_loc = (S32)(tmp_ptr - buffer);
mIndexHoles.push_back(index_loc);
mIndexHoles.push_back(buf_offset);
delete block;
}
tmp_ptr += LLVFSFileBlock::SERIAL_SIZE;
buf_offset += LLVFSFileBlock::SERIAL_SIZE;
}
delete[] buffer;
std::sort(
files_by_loc.begin(),
@ -861,20 +857,18 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
if (block->mSize > 0)
{
// move the file into the new block
U8 *buffer = new U8[block->mSize];
std::vector<U8> buffer(block->mSize);
fseek(mDataFP, block->mLocation, SEEK_SET);
if (fread(buffer, block->mSize, 1, mDataFP) == 1)
if (fread(&buffer[0], block->mSize, 1, mDataFP) == 1)
{
fseek(mDataFP, new_data_location, SEEK_SET);
if (fwrite(buffer, block->mSize, 1, mDataFP) != 1)
if (fwrite(&buffer[0], block->mSize, 1, mDataFP) != 1)
{
llwarns << "Short write" << llendl;
}
} else {
llwarns << "Short read" << llendl;
}
delete[] buffer;
}
}
@ -1698,32 +1692,32 @@ void LLVFS::audit()
fflush(mIndexFP);
fseek(mIndexFP, 0, SEEK_END);
long index_size = ftell(mIndexFP);
size_t index_size = ftell(mIndexFP);
fseek(mIndexFP, 0, SEEK_SET);
BOOL vfs_corrupt = FALSE;
U8 *buffer = new U8[index_size];
std::vector<U8> buffer(index_size);
if (fread(buffer, 1, index_size, mIndexFP) != index_size)
if (fread(&buffer[0], 1, index_size, mIndexFP) != index_size)
{
llwarns << "Index truncated" << llendl;
vfs_corrupt = TRUE;
}
U8 *tmp_ptr = buffer;
size_t buf_offset = 0;
std::map<LLVFSFileSpecifier, LLVFSFileBlock*> found_files;
U32 cur_time = (U32)time(NULL);
std::vector<LLVFSFileBlock*> audit_blocks;
while (!vfs_corrupt && tmp_ptr < buffer + index_size)
while (!vfs_corrupt && buf_offset < index_size)
{
LLVFSFileBlock *block = new LLVFSFileBlock();
audit_blocks.push_back(block);
block->deserialize(tmp_ptr, (S32)(tmp_ptr - buffer));
tmp_ptr += block->SERIAL_SIZE;
block->deserialize(&buffer[buf_offset], (S32)buf_offset);
buf_offset += block->SERIAL_SIZE;
// do sanity check on this block
if (block->mLength >= 0 &&
@ -1782,8 +1776,6 @@ void LLVFS::audit()
}
}
delete[] buffer;
if (!vfs_corrupt)
{
for (fileblock_map::iterator it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it)
@ -2078,21 +2070,21 @@ void LLVFS::dumpFiles()
{
LLUUID id = file_spec.mFileID;
LLAssetType::EType type = file_spec.mFileType;
U8* buffer = new U8[size];
std::vector<U8> buffer(size);
unlockData();
getData(id, type, buffer, 0, size);
getData(id, type, &buffer[0], 0, size);
lockData();
std::string extension = get_extension(type);
std::string filename = id.asString() + extension;
llinfos << " Writing " << filename << llendl;
LLAPRFile outfile ;
LLAPRFile outfile;
outfile.open(filename, LL_APR_WB);
outfile.write(buffer, size);
outfile.write(&buffer[0], size);
outfile.close();
delete[] buffer;
files_extracted++;
}
}

View File

@ -46,6 +46,7 @@ set(llwindows_HEADER_FILES
set(viewer_SOURCE_FILES
llwindow.cpp
llmousehandler.cpp
)
set(viewer_HEADER_FILES

View File

@ -0,0 +1,63 @@
/**
* @file llmousehandler.cpp
* @brief LLMouseHandler class implementation
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2007, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlife.com/developers/opensource/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at http://secondlife.com/developers/opensource/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llmousehandler.h"
//virtual
BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down)
{
BOOL handled = FALSE;
if (down)
{
switch (clicktype)
{
case CLICK_LEFT: handled = handleMouseDown(x, y, mask); break;
case CLICK_RIGHT: handled = handleRightMouseDown(x, y, mask); break;
case CLICK_MIDDLE: handled = handleMiddleMouseDown(x, y, mask); break;
case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
default:
llwarns << "Unhandled enum." << llendl;
}
}
else
{
switch (clicktype)
{
case CLICK_LEFT: handled = handleMouseUp(x, y, mask); break;
case CLICK_RIGHT: handled = handleRightMouseUp(x, y, mask); break;
case CLICK_MIDDLE: handled = handleMiddleMouseUp(x, y, mask); break;
case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
default:
llwarns << "Unhandled enum." << llendl;
}
}
return handled;
}

View File

@ -33,9 +33,10 @@
#ifndef LL_MOUSEHANDLER_H
#define LL_MOUSEHANDLER_H
#include "llstring.h"
#include "linden_common.h"
#include "llrect.h"
// Abstract interface.
// Mostly-abstract interface.
// Intended for use via multiple inheritance.
// A class may have as many interfaces as it likes, but never needs to inherit one more than once.
@ -49,13 +50,23 @@ public:
SHOW_IF_NOT_BLOCKED,
SHOW_ALWAYS,
} EShowToolTip;
typedef enum {
CLICK_LEFT,
CLICK_MIDDLE,
CLICK_RIGHT,
CLICK_DOUBLELEFT
} EClickType;
virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) = 0;
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0;
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) = 0;
virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) = 0;
virtual EShowToolTip getShowToolTip() { return SHOW_IF_NOT_BLOCKED; };
virtual const std::string& getName() const = 0;

View File

@ -308,6 +308,28 @@ void *LLWindow::getMediaWindow()
return getPlatformWindow();
}
//virtual
void LLWindow::processMiscNativeEvents()
{
// do nothing unless subclassed
}
//virtual
BOOL LLWindow::isPrimaryTextAvailable()
{
return FALSE; // no
}
//virtual
BOOL LLWindow::pasteTextFromPrimary(LLWString &dst)
{
return FALSE; // fail
}
// virtual
BOOL LLWindow::copyTextToPrimary(const LLWString &src)
{
return FALSE; // fail
}
// static
std::vector<std::string> LLWindow::getDynamicFallbackFontList()
{
@ -322,12 +344,6 @@ std::vector<std::string> LLWindow::getDynamicFallbackFontList()
#endif
}
//virtual
void LLWindow::processMiscNativeEvents()
{
// do nothing unless subclassed
}
#define UTF16_IS_HIGH_SURROGATE(U) ((U16)((U) - 0xD800) < 0x0400)
#define UTF16_IS_LOW_SURROGATE(U) ((U16)((U) - 0xDC00) < 0x0400)
#define UTF16_SURROGATE_PAIR_TO_UTF32(H,L) (((H) << 10) + (L) - (0xD800 << 10) - 0xDC00 + 0x00010000)

View File

@ -144,9 +144,15 @@ public:
virtual void captureMouse() = 0;
virtual void releaseMouse() = 0;
virtual void setMouseClipping( BOOL b ) = 0;
virtual BOOL isClipboardTextAvailable() = 0;
virtual BOOL pasteTextFromClipboard(LLWString &dst) = 0;
virtual BOOL copyTextToClipboard(const LLWString &src) = 0;
virtual BOOL isPrimaryTextAvailable();
virtual BOOL pasteTextFromPrimary(LLWString &dst);
virtual BOOL copyTextToPrimary(const LLWString &src);
virtual void flashIcon(F32 seconds) = 0;
virtual F32 getGamma() = 0;
virtual BOOL setGamma(const F32 gamma) = 0; // Set the gamma

View File

@ -2527,19 +2527,33 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
}
mCallbacks->handleFocusLost(this);
break;
case kEventWindowBoundsChanging:
{
// This is where we would constrain move/resize to a particular screen
const S32 MIN_WIDTH = 320;
const S32 MIN_HEIGHT = 240;
Rect currentBounds;
Rect previousBounds;
GetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &currentBounds);
GetEventParameter(event, kEventParamPreviousBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &previousBounds);
// This is where we would constrain move/resize to a particular screen
if(0)
if ((currentBounds.right - currentBounds.left) < MIN_WIDTH)
{
SetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, sizeof(Rect), &currentBounds);
currentBounds.right = currentBounds.left + MIN_WIDTH;
}
if ((currentBounds.bottom - currentBounds.top) < MIN_HEIGHT)
{
currentBounds.bottom = currentBounds.top + MIN_HEIGHT;
}
SetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, sizeof(Rect), &currentBounds);
result = noErr;
}
break;
@ -2597,7 +2611,6 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
// BringToFront(mWindow);
// result = noErr;
break;
}
break;

View File

@ -222,8 +222,8 @@ LLWindowSDL::LLWindowSDL(const std::string& title, S32 x, S32 y, S32 width,
ll_try_gtk_init();
#endif // LL_GTK
// Get the original aspect ratio of the main device.
mOriginalAspectRatio = 1024.0 / 768.0; // !!! *FIX: ? //(double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay);
// Assume 4:3 aspect ratio until we know better
mOriginalAspectRatio = 1024.0 / 768.0;
if (title.empty())
mWindowTitle = "SDL Window"; // *FIX: (???)
@ -444,14 +444,20 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
<< int(r_sdl_version->minor) << "."
<< int(r_sdl_version->patch) << llendl;
const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo( );
if (!videoInfo)
const SDL_VideoInfo *video_info = SDL_GetVideoInfo( );
if (!video_info)
{
llinfos << "SDL_GetVideoInfo() failed! " << SDL_GetError() << llendl;
setupFailure("SDL_GetVideoInfo() failed, Window creation error", "Error", OSMB_OK);
return FALSE;
}
if (video_info->current_h > 0)
{
mOriginalAspectRatio = (float)video_info->current_w / (float)video_info->current_h;
llinfos << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << llendl;
}
SDL_EnableUNICODE(1);
SDL_WM_SetCaption(mWindowTitle.c_str(), mWindowTitle.c_str());
@ -643,7 +649,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
// fallback to letting SDL detect VRAM.
// note: I've not seen SDL's detection ever actually find
// VRAM != 0, but if SDL *does* detect it then that's a bonus.
gGLManager.mVRAM = videoInfo->video_mem / 1024;
gGLManager.mVRAM = video_info->video_mem / 1024;
if (gGLManager.mVRAM != 0)
{
llinfos << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << llendl;
@ -1272,6 +1278,49 @@ BOOL LLWindowSDL::copyTextToClipboard(const LLWString &text)
return FALSE; // failure
}
BOOL LLWindowSDL::isPrimaryTextAvailable()
{
if (ll_try_gtk_init())
{
GtkClipboard * const clipboard =
gtk_clipboard_get(GDK_SELECTION_PRIMARY);
return gtk_clipboard_wait_is_text_available(clipboard) ?
TRUE : FALSE;
}
return FALSE; // failure
}
BOOL LLWindowSDL::pasteTextFromPrimary(LLWString &text)
{
if (ll_try_gtk_init())
{
GtkClipboard * const clipboard =
gtk_clipboard_get(GDK_SELECTION_PRIMARY);
gchar * const data = gtk_clipboard_wait_for_text(clipboard);
if (data)
{
text = LLWString(utf8str_to_wstring(data));
g_free(data);
return TRUE;
}
}
return FALSE; // failure
}
BOOL LLWindowSDL::copyTextToPrimary(const LLWString &text)
{
if (ll_try_gtk_init())
{
const std::string utf8 = wstring_to_utf8str(text);
GtkClipboard * const clipboard =
gtk_clipboard_get(GDK_SELECTION_PRIMARY);
gtk_clipboard_set_text(clipboard, utf8.c_str(), utf8.length());
return TRUE;
}
return FALSE; // failure
}
#else
BOOL LLWindowSDL::isClipboardTextAvailable()
@ -1288,6 +1337,22 @@ BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s)
{
return FALSE; // unsupported
}
BOOL LLWindowSDL::isPrimaryTextAvailable()
{
return FALSE; // unsupported
}
BOOL LLWindowSDL::pasteTextFromPrimary(LLWString &dst)
{
return FALSE; // unsupported
}
BOOL LLWindowSDL::copyTextToPrimary(const LLWString &s)
{
return FALSE; // unsupported
}
#endif // LL_GTK
LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_resolutions)
@ -1962,14 +2027,14 @@ void LLWindowSDL::captureMouse()
// window, and in a less obnoxious way than SDL_WM_GrabInput
// which would confine the cursor to the window too.
//llinfos << "LLWindowSDL::captureMouse" << llendl;
lldebugs << "LLWindowSDL::captureMouse" << llendl;
}
void LLWindowSDL::releaseMouse()
{
// see LWindowSDL::captureMouse()
//llinfos << "LLWindowSDL::releaseMouse" << llendl;
lldebugs << "LLWindowSDL::releaseMouse" << llendl;
}
void LLWindowSDL::hideCursor()

View File

@ -80,9 +80,15 @@ public:
/*virtual*/ void captureMouse();
/*virtual*/ void releaseMouse();
/*virtual*/ void setMouseClipping( BOOL b );
/*virtual*/ BOOL isClipboardTextAvailable();
/*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst);
/*virtual*/ BOOL copyTextToClipboard(const LLWString & src);
/*virtual*/ BOOL isPrimaryTextAvailable();
/*virtual*/ BOOL pasteTextFromPrimary(LLWString &dst);
/*virtual*/ BOOL copyTextToPrimary(const LLWString & src);
/*virtual*/ void flashIcon(F32 seconds);
/*virtual*/ F32 getGamma();
/*virtual*/ BOOL setGamma(const F32 gamma); // Set the gamma

View File

@ -312,7 +312,7 @@ void LLScriptScriptCodeChunk::build(LLFILE *efp, LLFILE *bcfp)
set_register(mCompleteCode, LREG_TM, mTotalSize);
if (fwrite(mCompleteCode, 1, mTotalSize, bcfp) != mTotalSize)
if (fwrite(mCompleteCode, 1, mTotalSize, bcfp) != (size_t)mTotalSize)
{
llwarns << "Short write" << llendl;
}

View File

@ -77,7 +77,7 @@ const U64 LSL_HTTP_REQUEST_TIMEOUT = 25 * USEC_PER_SEC;
LLScriptExecuteLSL2::LLScriptExecuteLSL2(LLFILE *fp)
{
U8 sizearray[4];
S32 filesize;
size_t filesize;
S32 pos = 0;
if (fread(&sizearray, 1, 4, fp) != 4)
{

View File

@ -39,7 +39,7 @@
LLScriptLSOParse::LLScriptLSOParse(LLFILE *fp)
{
U8 sizearray[4];
S32 filesize;
size_t filesize;
S32 pos = 0;
if (fread(&sizearray, 1, 4, fp) != 4)
{

View File

@ -68,8 +68,8 @@ EventHandlerRef gEventHandler = NULL;
OSStatus gFailure = noErr;
Boolean gCancelled = false;
char *gUpdateURL;
char *gProductName;
const char *gUpdateURL;
const char *gProductName;
void *updatethreadproc(void*);
@ -1032,7 +1032,7 @@ void *updatethreadproc(void*)
if(!mountOutput.empty())
{
const char *s = mountOutput.c_str();
char *prefix = "/dev/";
const char *prefix = "/dev/";
char *sub = strstr(s, prefix);
if(sub != NULL)

View File

@ -279,7 +279,6 @@ set(viewer_SOURCE_FILES
llpanelgrouplandmoney.cpp
llpanelgroupnotices.cpp
llpanelgrouproles.cpp
llpanelgroupvoting.cpp
llpanelinput.cpp
llpanelinventory.cpp
llpanelland.cpp
@ -683,7 +682,6 @@ set(viewer_HEADER_FILES
llpanelgrouplandmoney.h
llpanelgroupnotices.h
llpanelgrouproles.h
llpanelgroupvoting.h
llpanelinput.h
llpanelinventory.h
llpanelland.h

View File

@ -11,6 +11,17 @@
<key>Value</key>
<string>The Resident you messaged is in &apos;busy mode&apos; which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing.</string>
</map>
<key>BusyModeResponse2</key>
<map>
<key>Comment</key>
<string>Auto response to instant messages while in busy mode, clean (unencoded) version of BusyModeResponse</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>|TOKEN COPY BusyModeResponse|</string>
</map>
<key>IMLogTimestamp</key>
<map>
<key>Comment</key>

View File

@ -41,7 +41,7 @@ applications such as the Second Life Viewer, as follows:
* Ubuntu or Gentoo Linux Configuration:
For a quick start, you can simply paste the following line into a terminal
before plugging in your SpaceNavigator - this only needs to be done once:
sudo bash -c 'echo KERNEL==\"event[0-9]*\", SYSFS{idVendor}==\"046d\", SYSFS{idProduct}==\"c626\", SYMLINK+=\"input/spacenavigator\", GROUP=\"plugdev\", MODE=\"664\" >> /etc/udev/rules.d/91-spacenavigator.rules'
sudo bash -c 'echo KERNEL==\"event[0-9]*\", SYSFS{idVendor}==\"046d\", SYSFS{idProduct}==\"c626\", SYMLINK+=\"input/spacenavigator\", GROUP=\"plugdev\", MODE=\"664\" > /etc/udev/rules.d/91-spacenavigator-LL.rules ; echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><deviceinfo version=\"0.2\"><device><match key=\"info.product\" contains=\"3Dconnexion SpaceNavigator\"><merge key=\"input.x11_driver\" type=\"string\"></merge></match></device></deviceinfo>" > /etc/hal/fdi/policy/3Dconnexion_SpaceNavigator_LL.fdi'
For more comprehensive Linux SpaceNavigator configuration information please
see the section 'Installing SpaceNavigator without the official driver' here:

View File

@ -76,6 +76,7 @@
#include "llfloaterdirectory.h"
#include "llfloatergroupinfo.h"
#include "llfloatergroups.h"
#include "llfloaterland.h"
#include "llfloatermap.h"
#include "llfloatermute.h"
#include "llfloatersnapshot.h"
@ -3835,7 +3836,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit)
if(constrain)
{
F32 max_dist = ( CAMERA_MODE_CUSTOMIZE_AVATAR == mCameraMode ) ?
APPEARANCE_MAX_ZOOM : MAX_CAMERA_DISTANCE_FROM_AGENT;
APPEARANCE_MAX_ZOOM : mDrawDistance;
LLVector3d camera_offset = camera_position_global
- gAgent.getPositionGlobal();
@ -5950,6 +5951,9 @@ bool LLAgent::teleportCore(bool is_local)
LLFloaterWorldMap::hide(NULL);
LLFloaterDirectory::hide(NULL);
// hide land floater too - it'll be out of date
LLFloaterLand::hideInstance();
LLViewerParcelMgr::getInstance()->deselectLand();
// Close all pie menus, deselect land, etc.

View File

@ -202,7 +202,6 @@ const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user fl
F32 gSimLastTime; // Used in LLAppViewer::init and send_stats()
F32 gSimFrames;
BOOL gAllowIdleAFK = TRUE;
BOOL gAllowTapTapHoldRun = TRUE;
BOOL gShowObjectUpdates = FALSE;
BOOL gUseQuickTime = TRUE;
@ -301,7 +300,7 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ;
void idle_afk_check()
{
// check idle timers
if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout")))
if (gSavedSettings.getBOOL("AllowIdleAFK") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout")))
{
gAgent.setAFK();
}
@ -394,7 +393,6 @@ static void settings_to_globals()
gAgent.mHideGroupTitle = gSavedSettings.getBOOL("RenderHideGroupTitle");
gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc");
gAllowIdleAFK = gSavedSettings.getBOOL("AllowIdleAFK");
gAllowTapTapHoldRun = gSavedSettings.getBOOL("AllowTapTapHoldRun");
gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates");
gMapScale = gSavedSettings.getF32("MapScale");
@ -507,6 +505,7 @@ LLTextureFetch* LLAppViewer::sTextureFetch = NULL;
LLAppViewer::LLAppViewer() :
mMarkerFile(),
mLogoutMarkerFile(NULL),
mReportedCrash(false),
mNumSessions(0),
mPurgeCache(false),
@ -2158,7 +2157,6 @@ void LLAppViewer::cleanupSavedSettings()
gSavedSettings.setBOOL("DebugWindowProc", gDebugWindowProc);
gSavedSettings.setBOOL("AllowIdleAFK", gAllowIdleAFK);
gSavedSettings.setBOOL("AllowTapTapHoldRun", gAllowTapTapHoldRun);
gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates);
@ -3497,7 +3495,7 @@ void LLAppViewer::idleShutdown()
S32 finished_uploads = total_uploads - pending_uploads;
F32 percent = 100.f * finished_uploads / total_uploads;
gViewerWindow->setProgressPercent(percent);
gViewerWindow->setProgressString("Saving final data...");
gViewerWindow->setProgressString("Saving your settings...");
return;
}
@ -3669,7 +3667,7 @@ void LLAppViewer::idleNetwork()
// Check that the circuit between the viewer and the agent's current
// region is still alive
LLViewerRegion *agent_region = gAgent.getRegion();
if (agent_region)
if (agent_region && (LLStartUp::getStartupState()==STATE_STARTED))
{
LLUUID this_region_id = agent_region->getRegionID();
bool this_region_alive = agent_region->isAlive();

View File

@ -251,7 +251,6 @@ const S32 AGENT_UPDATES_PER_SECOND = 10;
extern LLSD gDebugInfo;
extern BOOL gAllowIdleAFK;
extern BOOL gAllowTapTapHoldRun;
extern BOOL gShowObjectUpdates;

View File

@ -165,14 +165,14 @@ static inline BOOL do_basic_glibc_backtrace()
// amazing backtrace.
static inline BOOL do_basic_glibc_backtrace()
{
void *array[MAX_STACK_TRACE_DEPTH];
void *stackarray[MAX_STACK_TRACE_DEPTH];
size_t size;
char **strings;
size_t i;
BOOL success = FALSE;
size = backtrace(array, MAX_STACK_TRACE_DEPTH);
strings = backtrace_symbols(array, size);
size = backtrace(stackarray, MAX_STACK_TRACE_DEPTH);
strings = backtrace_symbols(stackarray, size);
std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log");
llinfos << "Opening stack trace file " << strace_filename << llendl;
@ -186,8 +186,13 @@ static inline BOOL do_basic_glibc_backtrace()
if (size)
{
for (i = 0; i < size; i++)
fputs((std::string(strings[i])+"\n").c_str(),
StraceFile);
{
// the format of the StraceFile is very specific, to allow (kludgy) machine-parsing
fprintf(StraceFile, "%-3d ", i);
fprintf(StraceFile, "%-32s\t", "unknown");
fprintf(StraceFile, "%p ", stackarray[i]);
fprintf(StraceFile, "%s\n", strings[i]);
}
success = TRUE;
}
@ -205,7 +210,7 @@ static inline BOOL do_basic_glibc_backtrace()
// extraction without exporting symbols (which'd cause subtle, fatal bugs).
static inline BOOL do_elfio_glibc_backtrace()
{
void *array[MAX_STACK_TRACE_DEPTH];
void *stackarray[MAX_STACK_TRACE_DEPTH];
size_t btsize;
char **strings;
BOOL success = FALSE;
@ -222,8 +227,8 @@ static inline BOOL do_elfio_glibc_backtrace()
}
// get backtrace address list and basic symbol info
btsize = backtrace(array, MAX_STACK_TRACE_DEPTH);
strings = backtrace_symbols(array, btsize);
btsize = backtrace(stackarray, MAX_STACK_TRACE_DEPTH);
strings = backtrace_symbols(stackarray, btsize);
// create ELF reader for our app binary
IELFI* pReader;
@ -257,7 +262,8 @@ static inline BOOL do_elfio_glibc_backtrace()
size_t btpos;
for (btpos = 0; btpos < btsize; ++btpos)
{
fprintf(StraceFile, "%d:\t", btpos);
// the format of the StraceFile is very specific, to allow (kludgy) machine-parsing
fprintf(StraceFile, "%-3d ", btpos);
int symidx;
for (symidx = 0; symidx < nSymNo; ++symidx)
{
@ -266,9 +272,13 @@ static inline BOOL do_elfio_glibc_backtrace()
bind, type, section))
{
// check if trace address within symbol range
if (uintptr_t(array[btpos]) >= value &&
uintptr_t(array[btpos]) < value+ssize)
if (uintptr_t(stackarray[btpos]) >= value &&
uintptr_t(stackarray[btpos]) < value+ssize)
{
// symbol is inside viewer
fprintf(StraceFile, "%-32s\t", "com.secondlife.indra.viewer");
fprintf(StraceFile, "%p ", stackarray[btpos]);
char *demangled_str = NULL;
int demangle_result = 1;
demangled_str =
@ -278,20 +288,19 @@ static inline BOOL do_elfio_glibc_backtrace()
if (0 == demangle_result &&
NULL != demangled_str) {
fprintf(StraceFile,
"ELF(%s", demangled_str);
"%s", demangled_str);
free(demangled_str);
}
else // failed demangle; print it raw
{
fprintf(StraceFile,
"ELF(%s", name.c_str());
"%s", name.c_str());
}
// print offset from symbol start
fprintf(StraceFile,
"+0x%lx) [%p]\n",
uintptr_t(array[btpos]) -
value,
array[btpos]);
" + %lu\n",
uintptr_t(stackarray[btpos]) -
value);
goto got_sym; // early escape
}
}
@ -299,6 +308,8 @@ static inline BOOL do_elfio_glibc_backtrace()
// Fallback:
// Didn't find a suitable symbol in the binary - it's probably
// a symbol in a DSO; use glibc's idea of what it should be.
fprintf(StraceFile, "%-32s\t", "unknown");
fprintf(StraceFile, "%p ", stackarray[btpos]);
fprintf(StraceFile, "%s\n", strings[btpos]);
got_sym:;
}

View File

@ -1,6 +1,6 @@
/**
* @file llappviewermacosx.cpp
* @brief The LLAppViewerWin32 class definitions
* @brief The LLAppViewerMacOSX class definitions
*
* $LicenseInfo:firstyear=2007&license=viewergpl$
*

View File

@ -1015,6 +1015,10 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, U32 data_mask)
mPartitionType = LLViewerRegion::PARTITION_VOLUME;
mOctree->balance();
llassert(mDrawable);
llassert(mDrawable->getRegion());
llassert(mDrawable->getRegion()->getSpatialPartition(mPartitionType));
mDrawable->getRegion()->getSpatialPartition(mPartitionType)->put(this);
}
@ -1315,6 +1319,10 @@ void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL imm
BOOL LLSpatialBridge::updateMove()
{
llassert(mDrawable);
llassert(mDrawable->getRegion());
llassert(mDrawable->getRegion()->getSpatialPartition(mPartitionType));
mOctree->balance();
mDrawable->getRegion()->getSpatialPartition(mPartitionType)->move(this, getSpatialGroup(), TRUE);
return TRUE;

View File

@ -59,6 +59,7 @@
#include <commdlg.h>
#endif
extern "C" {
// mostly for Linux, possible on others
#if LL_GTK
# include "gtk/gtk.h"
@ -68,6 +69,7 @@
#if LL_X11
#include "SDL/SDL_syswm.h"
#endif
}
class LLFilePicker
{

View File

@ -148,7 +148,14 @@ public:
{
if (visible(instance, key))
{
LLFloaterChatterBox::hideInstance();
if(instance->getHost())
{
LLFloaterChatterBox::hideInstance();
}
else
{
VisibilityPolicy<LLFloater>::hide(instance, key);
}
}
}

View File

@ -200,12 +200,7 @@ void LLFloaterGesture::refreshAll()
}
else
{
if (list->setCurrentByID(sInstance->mSelectedID))
{
LLCtrlScrollInterface *scroll = sInstance->childGetScrollInterface("gesture_list");
if (scroll) scroll->scrollToShowSelected();
}
else
if (! list->setCurrentByID(sInstance->mSelectedID))
{
list->selectFirstItem();
}
@ -219,8 +214,14 @@ void LLFloaterGesture::refreshAll()
void LLFloaterGesture::buildGestureList()
{
LLCtrlListInterface *list = childGetListInterface("gesture_list");
if (!list) return;
LLCtrlScrollInterface *scroll = childGetScrollInterface("gesture_list");
if (! (list && scroll)) return;
// attempt to preserve scroll position through re-builds
// since we do re-build any time anything dirties
S32 current_scroll_pos = scroll->getScrollPos();
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
LLGestureManager::item_map_t::iterator it;
@ -319,6 +320,8 @@ void LLFloaterGesture::buildGestureList()
}
list->addElement(element, ADD_BOTTOM);
}
scroll->setScrollPos(current_scroll_pos);
}
// static

View File

@ -72,11 +72,14 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 300;
// LLFloaterImagePreview()
//-----------------------------------------------------------------------------
LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) :
LLFloaterNameDesc(filename)
LLFloaterNameDesc(filename),
mAvatarPreview(NULL),
mSculptedPreview(NULL),
mLastMouseX(0),
mLastMouseY(0),
mImagep(NULL)
{
mLastMouseX = 0;
mLastMouseY = 0;
mImagep = NULL ;
loadImage(mFilenameAndPath);
}
@ -815,7 +818,7 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
mVertexBuffer->getIndexStrider(index_strider);
// build vertices and normals
for (U32 i = 0; (S32)i < num_vertices; i++)
for (U32 i = 0; i < num_vertices; i++)
{
*(vertex_strider++) = vf.mVertices[i].mPosition;
LLVector3 normal = vf.mVertices[i].mNormal;

View File

@ -80,12 +80,26 @@ void LLFloaterOpenObject::refresh()
{
mPanelInventory->refresh();
std::string name;
BOOL enabled;
LLSelectNode* node = mObjectSelection->getFirstRootNode();
if (node)
{
std::string name = node->mName;
childSetTextArg("object_name", "[DESC]", name);
name = node->mName;
enabled = TRUE;
}
else
{
name = "";
enabled = FALSE;
}
childSetTextArg("object_name", "[DESC]", name);
childSetEnabled("copy_to_inventory_button", enabled);
childSetEnabled("copy_and_wear_button", enabled);
}
void LLFloaterOpenObject::draw()

View File

@ -2862,20 +2862,14 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
S32 file_length = file.getSize();
char* buffer = new char[file_length+1];
if (buffer == NULL)
{
llerrs << "Memory Allocation Failed" << llendl;
return;
}
file.read((U8*)buffer, file_length); /* Flawfinder: ignore */
std::vector<char> buffer(file_length+1);
file.read((U8*)&buffer[0], file_length);
// put a EOS at the end
buffer[file_length] = 0;
if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) )
if( (file_length > 19) && !strncmp( &buffer[0], "Linden text version", 19 ) )
{
if( !panelp->mEditor->importBuffer( buffer, file_length+1 ) )
if( !panelp->mEditor->importBuffer( &buffer[0], file_length+1 ) )
{
llwarns << "Problem importing estate covenant." << llendl;
LLNotifications::instance().add("ProblemImportingEstateCovenant");
@ -2890,7 +2884,6 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
// Version 0 (just text, doesn't include version number)
panelp->sendChangeCovenantID(asset_uuid);
}
delete[] buffer;
}
else
{

View File

@ -1275,7 +1275,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
LLSnapshotLivePreview* previewp = getPreviewView(floater);
BOOL got_bytes = previewp && previewp->getDataSize() > 0;
BOOL got_snap = previewp->getSnapshotUpToDate();
BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
floater->childSetEnabled("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE);
floater->childSetEnabled("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_snap);
@ -1283,7 +1283,10 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
LLLocale locale(LLLocale::USER_LOCALE);
std::string bytes_string;
LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
if (got_snap)
{
LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
}
S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
floater->childSetLabelArg("texture", "[AMOUNT]", llformat("%d",upload_cost));
floater->childSetLabelArg("upload_btn", "[AMOUNT]", llformat("%d",upload_cost));

View File

@ -1610,7 +1610,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
childSetFocus("search_results");
onCommitSearchResult(NULL, this);
}
else
else if (num_results == 0)
{
list->addCommentText(std::string("None found."));
list->operateOnAll(LLCtrlListInterface::OP_DESELECT);

View File

@ -146,9 +146,9 @@ void LLFolderViewItem::cleanupClass()
// Default constructor
// NOTE: Optimize this, we call it a *lot* when opening a large inventory
LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon,
S32 creation_date,
LLFolderView* root,
LLFolderViewEventListener* listener ) :
time_t creation_date,
LLFolderView* root,
LLFolderViewEventListener* listener ) :
LLUICtrl( name, LLRect(0, 0, 0, 0), TRUE, NULL, NULL, FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT),
mLabel( name ),
mLabelWidth(0),
@ -4684,7 +4684,7 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl)
BOOL LLInventoryFilter::isSinceLogoff()
{
return (mFilterOps.mMinDate == mLastLogoff) &&
return (mFilterOps.mMinDate == (time_t)mLastLogoff) &&
(mFilterOps.mMaxDate == time_max());
}

View File

@ -335,7 +335,7 @@ protected:
std::string mSearchableLabel;
std::string mType;
S32 mLabelWidth;
U32 mCreationDate;
time_t mCreationDate;
LLFolderViewFolder* mParentFolder;
LLFolderViewEventListener* mListener;
BOOL mIsSelected;
@ -386,7 +386,7 @@ public:
void filterFromRoot( void );
// creation_date is in UTC seconds
LLFolderViewItem( const std::string& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener );
LLFolderViewItem( const std::string& name, LLUIImagePtr icon, time_t creation_date, LLFolderView* root, LLFolderViewEventListener* listener );
virtual ~LLFolderViewItem( void );
// addToFolder() returns TRUE if it succeeds. FALSE otherwise

View File

@ -926,20 +926,15 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs,
LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
S32 size = file.getSize();
char* buffer = new char[size+1];
if (buffer == NULL)
{
llerrs << "Memory Allocation Failed" << llendl;
return;
}
std::vector<char> buffer(size+1);
file.read((U8*)buffer, size); /* Flawfinder: ignore */
file.read((U8*)&buffer[0], size);
// ensure there's a trailing NULL so strlen will work.
buffer[size] = '\0';
LLMultiGesture* gesture = new LLMultiGesture();
LLDataPackerAsciiBuffer dp(buffer, size+1);
LLDataPackerAsciiBuffer dp(&buffer[0], size+1);
BOOL ok = gesture->deserialize(dp);
if (ok)
@ -991,9 +986,6 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs,
delete gesture;
gesture = NULL;
}
delete [] buffer;
buffer = NULL;
}
else
{

View File

@ -803,7 +803,12 @@ static void formatDateString(std::string &date_string)
const regex expression("([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})");
if (regex_match(date_string.c_str(), result, expression))
{
date_string = result[3]+"/"+result[1]+"/"+result[2];
std::string year = result[3];
std::string month = result[1];
std::string day = result[2];
// ISO 8601 date format
date_string = llformat("%04s-%02s-%02s", year.c_str(), month.c_str(), day.c_str());
}
}

View File

@ -160,6 +160,7 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
LLHUDEffect::unpackData(mesgsys, blocknum);
LLUUID source_id;
LLUUID target_id;
U8 pointAtTypeUnpacked = 0;
S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
if (size != PKT_SIZE)
{
@ -169,6 +170,9 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, PKT_SIZE, blocknum);
htonmemcpy(source_id.mData, &(packed_data[SOURCE_AVATAR]), MVT_LLUUID, 16);
htonmemcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16);
htonmemcpy(new_target.mdV, &(packed_data[TARGET_POS]), MVT_LLVector3d, 24);
htonmemcpy(&pointAtTypeUnpacked, &(packed_data[POINTAT_TYPE]), MVT_U8, 1);
LLViewerObject *objp = gObjectList.findObject(source_id);
if (objp && objp->isAvatar())
@ -181,12 +185,8 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
return;
}
htonmemcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16);
objp = gObjectList.findObject(target_id);
htonmemcpy(new_target.mdV, &(packed_data[TARGET_POS]), MVT_LLVector3d, 24);
if (objp)
{
setTargetObjectAndOffset(objp, new_target);
@ -196,8 +196,6 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
setTargetPosGlobal(new_target);
}
U8 pointAtTypeUnpacked = 0;
htonmemcpy(&pointAtTypeUnpacked, &(packed_data[POINTAT_TYPE]), MVT_U8, 1);
mTargetType = (EPointAtType)pointAtTypeUnpacked;
// mKillTime = mTimer.getElapsedTimeF32() + mDuration;

View File

@ -121,7 +121,7 @@ void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
LLHUDEffect::unpackData(mesgsys, blocknum);
LLUUID object_id, target_object_id;
S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
size_t size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
if (size != EFFECT_SIZE)
{
llwarns << "Spiral effect with bad size " << size << llendl;

View File

@ -2030,8 +2030,8 @@ void LLFloaterIMPanel::sendMsg()
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_IM_COUNT);
mInputEditor->setText(LLStringUtil::null);
}
mInputEditor->setText(LLStringUtil::null);
// Don't need to actually send the typing stop message, the other
// client will infer it from receiving the message.

View File

@ -1012,6 +1012,19 @@ BOOL LLItemBridge::isItemCopyable() const
LLViewerInventoryItem* item = getItem();
if (item)
{
// can't copy worn objects. DEV-15183
LLVOAvatar *avatarp = gAgent.getAvatarObject();
if( !avatarp )
{
return FALSE;
}
if( avatarp->isWearingAttachment( mUUID ) )
{
return FALSE;
}
return (item->getPermissions().allowCopyBy(gAgent.getID()));
}
return FALSE;
@ -4624,7 +4637,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
{
EWearableType type = wearable->getType();
if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&&
if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES ) ) //&&
//!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) )
{
gAgent.removeWearable( type );

View File

@ -89,11 +89,11 @@ void LLLandmarkList::processGetAssetReply(
LLVFile file(vfs, uuid, type);
S32 file_length = file.getSize();
char* buffer = new char[ file_length + 1 ];
file.read( (U8*)buffer, file_length); /*Flawfinder: ignore*/
std::vector<char> buffer(file_length + 1);
file.read( (U8*)&buffer[0], file_length);
buffer[ file_length ] = 0;
LLLandmark* landmark = LLLandmark::constructFromString(buffer);
LLLandmark* landmark = LLLandmark::constructFromString(&buffer[0]);
if (landmark)
{
LLVector3d pos;
@ -111,8 +111,6 @@ void LLLandmarkList::processGetAssetReply(
}
gLandmarkList.mList[ uuid ] = landmark;
}
delete[] buffer;
}
else
{

View File

@ -50,7 +50,7 @@ std::string LLLogChat::makeLogFileName(std::string filename)
std::string LLLogChat::cleanFileName(std::string filename)
{
std::string invalidChars = "\"\'\\/?*:<>|";
S32 position = filename.find_first_of(invalidChars);
std::string::size_type position = filename.find_first_of(invalidChars);
while (position != filename.npos)
{
filename[position] = '_';

View File

@ -788,8 +788,9 @@ void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**)
llwarns << "Got an mute list update for the wrong agent." << llendl;
return;
}
std::string filename;
msg->getStringFast(_PREHASH_MuteData, _PREHASH_Filename, filename);
std::string unclean_filename;
msg->getStringFast(_PREHASH_MuteData, _PREHASH_Filename, unclean_filename);
std::string filename = LLDir::getScrubbedFileName(unclean_filename);
std::string *local_filename_and_path = new std::string(gDirUtilp->getExpandedFilename( LL_PATH_CACHE, filename ));
gXferManager->requestFile(*local_filename_and_path,

View File

@ -483,11 +483,20 @@ LLPanelAvatarWeb::~LLPanelAvatarWeb()
};
}
void LLPanelAvatarWeb::refresh()
{
if (mNavigateTo != "")
{
llinfos << "Loading " << mNavigateTo << llendl;
mWebBrowser->navigateTo( mNavigateTo );
mNavigateTo = "";
}
}
void LLPanelAvatarWeb::enableControls(BOOL self)
{
childSetEnabled("url_edit",self);
childSetVisible("status_text",!self && !mHome.empty());
childSetText("status_text", LLStringUtil::null);
}
void LLPanelAvatarWeb::setWebURL(std::string url)
@ -511,11 +520,8 @@ void LLPanelAvatarWeb::setWebURL(std::string url)
else
{
childSetVisible("profile_html",false);
childSetVisible("status_text", false);
}
BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() );
childSetVisible("status_text",!own_avatar && !mHome.empty());
}
// static
@ -538,13 +544,15 @@ void LLPanelAvatarWeb::load(std::string url)
{
bool have_url = (!url.empty());
childSetVisible("profile_html", have_url);
childSetVisible("status_text", have_url);
childSetText("status_text", LLStringUtil::null);
if (have_url)
{
llinfos << "Loading " << url << llendl;
mWebBrowser->navigateTo( url );
mNavigateTo = url;
}
childSetVisible("profile_html", have_url);
}
//static

View File

@ -144,6 +144,8 @@ public:
/*virtual*/ ~LLPanelAvatarWeb();
/*virtual*/ BOOL postBuild(void);
/*virtual*/ void refresh();
void enableControls(BOOL own_avatar);
void setWebURL(std::string url);
@ -160,6 +162,7 @@ public:
private:
std::string mHome;
std::string mNavigateTo;
LLWebBrowserCtrl* mWebBrowser;
};

View File

@ -73,7 +73,6 @@ BOOL LLPanelFace::postBuild()
LLTextureCtrl* mTextureCtrl;
LLColorSwatchCtrl* mColorSwatch;
LLTextBox* mLabelTexGen;
LLComboBox* mComboTexGen;
LLCheckBoxCtrl *mCheckFullbright;
@ -81,7 +80,6 @@ BOOL LLPanelFace::postBuild()
LLTextBox* mLabelColorTransp;
LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha
LLTextBox* mLabelGlow;
LLSpinCtrl* mCtrlGlow;
setMouseOpaque(FALSE);
@ -152,7 +150,7 @@ BOOL LLPanelFace::postBuild()
mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright);
mCheckFullbright->setCallbackUserData( this );
}
mLabelTexGen = getChild<LLTextBox>("tex gen");
mComboTexGen = getChild<LLComboBox>("combobox texgen");
if(mComboTexGen)
{
@ -161,7 +159,6 @@ BOOL LLPanelFace::postBuild()
mComboTexGen->setCallbackUserData( this );
}
mLabelGlow = getChild<LLTextBox>("glow label");
mCtrlGlow = getChild<LLSpinCtrl>("glow");
if(mCtrlGlow)
{

View File

@ -37,7 +37,6 @@
#include "llbutton.h"
#include "llpanelgroupgeneral.h"
#include "llpanelgrouproles.h"
#include "llpanelgroupvoting.h"
#include "llpanelgrouplandmoney.h"
#include "llpanelgroupnotices.h"
#include "lltabcontainer.h"
@ -148,8 +147,6 @@ LLPanelGroup::LLPanelGroup(const std::string& filename,
&mID);
mFactoryMap["notices_tab"] = LLCallbackMap(LLPanelGroupNotices::createTab,
&mID);
mFactoryMap["voting_tab"] = LLCallbackMap(LLPanelGroupVoting::createTab,
&mID);
mFactoryMap["land_money_tab"]= LLCallbackMap(LLPanelGroupLandMoney::createTab,
&mID);
// Roles sub tabs

View File

@ -901,7 +901,7 @@ void LLPanelGroupGeneral::updateChanged()
mChanged = FALSE;
for( int i= 0; i< LL_ARRAY_SIZE(check_list); i++ )
for( size_t i=0; i<LL_ARRAY_SIZE(check_list); i++ )
{
if( check_list[i] && check_list[i]->isDirty() )
{

View File

@ -974,7 +974,7 @@ void LLGroupMoneyTabEventHandler::clickLaterCallback(void* data)
void LLGroupMoneyTabEventHandler::clickTabCallback(void* data, bool from_click)
{
LLGroupMoneyTabEventHandler* selfp = (LLGroupMoneyTabEventHandler*) data;
if ( selfp ) selfp->onClickTab();
if ( selfp && from_click ) selfp->onClickTab();
}
//**************************************************

View File

@ -56,8 +56,6 @@
#include "llviewermessage.h"
#include "llnotifications.h"
const S32 NOTICE_DATE_STRING_SIZE = 30;
/////////////////////////
// LLPanelGroupNotices //
/////////////////////////
@ -170,14 +168,23 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
//-----------------------------------------------------------------------------
// LLPanelGroupNotices
//-----------------------------------------------------------------------------
std::string build_notice_date(const time_t& the_time)
std::string build_notice_date(const U32& the_time)
{
time_t t = the_time;
if (!t) time(&t);
// ISO 8601 date format
time_t t = (time_t)the_time;
if (!t)
{
time(&t);
}
tm* lt = localtime(&t);
//for some reason, the month is off by 1. See other uses of
//"local" time in the code...
std::string buffer = llformat("%i/%i/%i", lt->tm_mon + 1, lt->tm_mday, lt->tm_year + 1900);
std::string buffer = llformat("%04i-%02i-%02i", lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday);
return buffer;
}
@ -469,7 +476,6 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
msg->getBOOL("Data","HasAttachment",has_attachment,i);
msg->getU8("Data","AssetType",asset_type,i);
msg->getU32("Data","Timestamp",timestamp,i);
time_t t = timestamp;
LLSD row;
row["id"] = id;
@ -490,13 +496,11 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
row["columns"][2]["column"] = "from";
row["columns"][2]["value"] = name;
std::string buffer = build_notice_date(t);
row["columns"][3]["column"] = "date";
row["columns"][3]["value"] = buffer;
row["columns"][3]["value"] = build_notice_date(timestamp);
buffer = llformat( "%u", timestamp);
row["columns"][4]["column"] = "sort";
row["columns"][4]["value"] = buffer;
row["columns"][4]["value"] = llformat( "%u", timestamp);
mNoticesList->addElement(row, ADD_BOTTOM);
}

View File

@ -1034,7 +1034,7 @@ void LLPanelPermissions::setAllSaleInfo()
{
// Don't extract the price if it's labeled as MIXED or is empty.
const std::string& editPriceString = editPrice->getText();
if (editPriceString != getString("Cost Mixed") &&
if (editPriceString != getString("Cost Mixed") && editPriceString != getString("Sale Mixed") &&
!editPriceString.empty())
{
price = atoi(editPriceString.c_str());
@ -1048,12 +1048,6 @@ void LLPanelPermissions::setAllSaleInfo()
if (price < 0)
sale_type = LLSaleInfo::FS_NOT;
// Force the sale price of not-for-sale items to DEFAULT_PRICE.
if (sale_type == LLSaleInfo::FS_NOT)
{
price = DEFAULT_PRICE;
}
// Pack up the sale info and send the update.
LLSaleInfo sale_info(sale_type, price);
LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(sale_info);

View File

@ -920,13 +920,13 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs,
LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
S32 size = file.getSize();
char* buffer = new char[size+1];
file.read((U8*)buffer, size); /*Flawfinder: ignore*/
std::vector<char> buffer(size+1);
file.read((U8*)&buffer[0], size);
buffer[size] = '\0';
LLMultiGesture* gesture = new LLMultiGesture();
LLDataPackerAsciiBuffer dp(buffer, size+1);
LLDataPackerAsciiBuffer dp(&buffer[0], size+1);
BOOL ok = gesture->deserialize(dp);
if (ok)
@ -947,9 +947,6 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs,
delete gesture;
gesture = NULL;
delete [] buffer;
buffer = NULL;
self->mAssetStatus = PREVIEW_ASSET_LOADED;
}
else

View File

@ -364,8 +364,8 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
S32 file_length = file.getSize();
char* buffer = new char[file_length+1];
file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/
std::vector<char> buffer(file_length+1);
file.read((U8*)&buffer[0], file_length);
// put a EOS at the end
buffer[file_length] = 0;
@ -373,9 +373,9 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
LLViewerTextEditor* previewEditor = preview->getChild<LLViewerTextEditor>("Notecard Editor");
if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) )
if( (file_length > 19) && !strncmp( &buffer[0], "Linden text version", 19 ) )
{
if( !previewEditor->importBuffer( buffer, file_length+1 ) )
if( !previewEditor->importBuffer( &buffer[0], file_length+1 ) )
{
llwarns << "Problem importing notecard" << llendl;
}
@ -383,7 +383,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
else
{
// Version 0 (just text, doesn't include version number)
previewEditor->setText(LLStringExplicit(buffer));
previewEditor->setText(LLStringExplicit(&buffer[0]));
}
previewEditor->makePristine();
@ -392,7 +392,6 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY,
item->getPermissions(), GP_OBJECT_MANIPULATE);
preview->setEnabled(modifiable);
delete[] buffer;
preview->mAssetStatus = PREVIEW_ASSET_LOADED;
}
else

View File

@ -314,7 +314,8 @@ LLScriptEdCore::LLScriptEdCore(
mForceClose( FALSE ),
mLastHelpToken(NULL),
mLiveHelpHistorySize(0),
mEnableSave(FALSE)
mEnableSave(FALSE),
mHasScriptData(FALSE)
{
setFollowsAll();
setBorderVisible(FALSE);
@ -442,12 +443,21 @@ void LLScriptEdCore::initMenu()
menuItem->setEnabledCallback(NULL);
}
void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid)
{
if (mEditor)
{
mEditor->setText(text);
mHasScriptData = is_valid;
}
}
BOOL LLScriptEdCore::hasChanged(void* userdata)
{
LLScriptEdCore* self = (LLScriptEdCore*)userdata;
if (!self || !self->mEditor) return FALSE;
return !self->mEditor->isPristine() || self->mEnableSave;
return ((!self->mEditor->isPristine() || self->mEnableSave) && self->mHasScriptData);
}
void LLScriptEdCore::draw()
@ -975,8 +985,8 @@ bool LLScriptEdCore::handleReloadFromServerDialog(const LLSD& notification, cons
case 0: // "Yes"
if( mLoadCallback )
{
mEditor->setText( getString("loading") );
mLoadCallback( mUserdata );
setScriptText(getString("loading"), FALSE);
mLoadCallback(mUserdata);
}
break;
@ -1189,7 +1199,7 @@ void LLPreviewLSL::loadAsset()
}
else
{
mScriptEd->mEditor->setText(mScriptEd->getString("can_not_view"));
mScriptEd->setScriptText(mScriptEd->getString("can_not_view"), FALSE);
mScriptEd->mEditor->makePristine();
mScriptEd->mEditor->setEnabled(FALSE);
mScriptEd->mFunctions->setEnabled(FALSE);
@ -1200,7 +1210,7 @@ void LLPreviewLSL::loadAsset()
}
else
{
mScriptEd->mEditor->setText(std::string(HELLO_LSL));
mScriptEd->setScriptText(std::string(HELLO_LSL), TRUE);
mAssetStatus = PREVIEW_ASSET_LOADED;
}
}
@ -1506,14 +1516,13 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
LLVFile file(vfs, asset_uuid, type);
S32 file_length = file.getSize();
char* buffer = new char[file_length+1];
file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/
std::vector<char> buffer(file_length+1);
file.read((U8*)&buffer[0], file_length);
// put a EOS at the end
buffer[file_length] = 0;
preview->mScriptEd->mEditor->setText(LLStringExplicit(buffer));
preview->mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE);
preview->mScriptEd->mEditor->makePristine();
delete [] buffer;
LLInventoryItem* item = gInventory.getItem(*item_uuid);
BOOL is_modifiable = FALSE;
if(item
@ -1726,7 +1735,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
|| !gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE))))
{
mItem = new LLViewerInventoryItem(item);
mScriptEd->mEditor->setText(getString("not_allowed"));
mScriptEd->setScriptText(getString("not_allowed"), FALSE);
mScriptEd->mEditor->makePristine();
mScriptEd->mEditor->setEnabled(FALSE);
mScriptEd->enableSave(FALSE);
@ -1758,7 +1767,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
}
else
{
mScriptEd->mEditor->setText(LLStringUtil::null);
mScriptEd->setScriptText(LLStringUtil::null, FALSE);
mScriptEd->mEditor->makePristine();
mAssetStatus = PREVIEW_ASSET_LOADED;
}
@ -1795,7 +1804,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
// This may be better than having a accessible null pointer around,
// though this newly allocated object will most likely be replaced.
mItem = new LLViewerInventoryItem();
mScriptEd->mEditor->setText(LLStringUtil::null);
mScriptEd->setScriptText(LLStringUtil::null, FALSE);
mScriptEd->mEditor->makePristine();
mScriptEd->mEditor->setEnabled(FALSE);
mAssetStatus = PREVIEW_ASSET_LOADED;
@ -1803,7 +1812,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
}
else
{
mScriptEd->mEditor->setText(std::string(HELLO_LSL));
mScriptEd->setScriptText(std::string(HELLO_LSL), TRUE);
mScriptEd->enableSave(FALSE);
LLPermissions perm;
perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, gAgent.getGroupID());
@ -1902,8 +1911,8 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType
{
LLVFile file(vfs, uuid, type);
S32 file_length = file.getSize();
char *buffer = new char[file_length + 1];
file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/
std::vector<char> buffer(file_length + 1);
file.read((U8*)&buffer[0], file_length);
if (file.getLastBytesRead() != file_length ||
file_length <= 0)
@ -1913,10 +1922,8 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType
buffer[file_length] = '\0';
mScriptEd->mEditor->setText(LLStringExplicit(buffer));
mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE);
mScriptEd->mEditor->makePristine();
delete[] buffer;
}

View File

@ -81,6 +81,8 @@ public:
BOOL canClose();
void setScriptText(const std::string& text, BOOL is_valid);
bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response);
bool handleReloadFromServerDialog(const LLSD& notification, const LLSD& response);
@ -150,6 +152,7 @@ private:
LLFrameTimer mLiveHelpTimer;
S32 mLiveHelpHistorySize;
BOOL mEnableSave;
BOOL mHasScriptData;
};

View File

@ -92,7 +92,6 @@ LLViewerObject* getSelectedParentObject(LLViewerObject *object) ;
const S32 NUM_SELECTION_UNDO_ENTRIES = 200;
const F32 SILHOUETTE_UPDATE_THRESHOLD_SQUARED = 0.02f;
const S32 OWNERSHIP_COST_PER_OBJECT = 10; // Must be the same as economy_constants.price_object_claim in the database.
const S32 MAX_ACTION_QUEUE_SIZE = 20;
const S32 MAX_SILS_PER_FRAME = 50;
const S32 MAX_OBJECTS_PER_PACKET = 254;
@ -2620,11 +2619,6 @@ BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off)
BOOL LLSelectMgr::selectGetOwnershipCost(S32* out_cost)
{
return mSelectedObjects->getOwnershipCost(*out_cost);
}
BOOL LLSelectMgr::selectGetPermissions(LLPermissions& result_perm)
{
BOOL first = TRUE;
@ -5869,16 +5863,6 @@ BOOL LLObjectSelection::isEmpty() const
return (mList.size() == 0);
}
//-----------------------------------------------------------------------------
// getOwnershipCost()
//-----------------------------------------------------------------------------
BOOL LLObjectSelection::getOwnershipCost(S32 &cost)
{
S32 count = getObjectCount();
cost = count * OWNERSHIP_COST_PER_OBJECT;
return (count > 0);
}
//-----------------------------------------------------------------------------
// getObjectCount() - returns number of non null objects

View File

@ -275,8 +275,6 @@ public:
BOOL isEmpty() const;
S32 getOwnershipCost(S32 &cost);
LLSelectNode* getFirstNode(LLSelectedNodeFunctor* func = NULL);
LLSelectNode* getFirstRootNode(LLSelectedNodeFunctor* func = NULL, BOOL non_root_ok = FALSE);
LLViewerObject* getFirstSelectedObject(LLSelectedNodeFunctor* func, BOOL get_parent = FALSE);
@ -552,7 +550,6 @@ public:
// the value found if available.
BOOL selectGetGroup(LLUUID& id);
BOOL selectGetPerm( U8 which_perm, U32* mask_on, U32* mask_off); // TRUE if all have data, returns two masks, each indicating which bits are all on and all off
BOOL selectGetOwnershipCost(S32* cost); // sum of all ownership costs
BOOL selectIsGroupOwned(); // TRUE if all root objects have valid data and are group owned.

View File

@ -116,6 +116,7 @@
#include "llkeyboard.h"
#include "llloginhandler.h" // gLoginHandler, SLURL support
#include "llpanellogin.h"
#include "llprefsim.h"
#include "llmutelist.h"
#include "llnotify.h"
#include "llpanelavatar.h"
@ -1294,16 +1295,9 @@ bool idle_startup()
if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
{
gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
if (show_connect_box)
{
update_app(TRUE, auth_message);
LLStartUp::setStartupState( STATE_UPDATE_CHECK );
return false;
}
else
{
quit = true;
}
update_app(TRUE, auth_message);
LLStartUp::setStartupState( STATE_UPDATE_CHECK );
return false;
}
// Version update and we're not showing the dialog
@ -1976,6 +1970,9 @@ bool idle_startup()
//---------------------------------------------------------------------
if (STATE_INVENTORY_SEND == LLStartUp::getStartupState())
{
// Inform simulator of our language preference
LLAgentLanguage::update();
// unpack thin inventory
LLUserAuth::options_t options;
options.clear();
@ -2291,9 +2288,6 @@ bool idle_startup()
// JC - 7/20/2002
gViewerWindow->sendShapeToSim();
// Inform simulator of our language preference
LLAgentLanguage::update();
// Ignore stipend information for now. Money history is on the web site.
// if needed, show the L$ history window
@ -2352,6 +2346,9 @@ bool idle_startup()
//DEV-17797. get null folder. Any items found here moved to Lost and Found
LLInventoryModel::findLostItems();
//DEV-10530. do cleanup. remove at some later date. jan-2009
LLPrefsIM::cleanupBadSetting();
LLStartUp::setStartupState( STATE_PRECACHE );
timeout.reset();
return FALSE;

View File

@ -628,9 +628,16 @@ void LLStatusBar::refresh()
mTextParcelName->setRect(r);
// Set search bar visibility
childSetVisible("search_editor", search_visible);
childSetVisible("search_btn", search_visible);
childSetVisible("menubar_search_bevel_bg", search_visible);
if (gAgent.getCameraMode() != CAMERA_MODE_MOUSELOOK)
{
// don't monkey with search visibility in mouselook - it will be set
// with setVisibleForMouselook() below
childSetVisible("search_editor", search_visible);
childSetVisible("search_btn", search_visible);
childSetVisible("menubar_search_bevel_bg", search_visible);
}
mSGBandwidth->setVisible(! search_visible);
mSGPacketLoss->setVisible(! search_visible);
childSetEnabled("stat_btn", ! search_visible);
@ -643,6 +650,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible)
childSetVisible("buycurrency", visible);
childSetVisible("search_editor", visible);
childSetVisible("search_btn", visible);
childSetVisible("menubar_search_bevel_bg", visible);
mSGBandwidth->setVisible(visible);
mSGPacketLoss->setVisible(visible);
setBackgroundVisible(visible);

View File

@ -1254,7 +1254,7 @@ void LLTextureCache::purgeTextures(bool validate)
else if (validate)
{
// make sure file exists and is the correct size
S32 uuididx = entries[idx].mID.mData[0];
U32 uuididx = entries[idx].mID.mData[0];
if (uuididx == validate_idx)
{
LL_DEBUGS("TextureCache") << "Validating: " << filename << "Size: " << entries[idx].mSize << LL_ENDL;

View File

@ -65,7 +65,6 @@ LLTool::~LLTool()
}
}
BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
@ -125,6 +124,20 @@ BOOL LLTool::handleRightMouseUp(S32 x, S32 y, MASK mask)
// llinfos << "LLTool::handleRightMouseDown" << llendl;
return FALSE;
}
BOOL LLTool::handleMiddleMouseDown(S32 x,S32 y,MASK mask)
{
// by default, didn't handle it
// llinfos << "LLTool::handleMiddleMouseDown" << llendl;
return FALSE;
}
BOOL LLTool::handleMiddleMouseUp(S32 x, S32 y, MASK mask)
{
// by default, didn't handle it
// llinfos << "LLTool::handleMiddleMouseUp" << llendl;
return FALSE;
}
BOOL LLTool::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen)
{

View File

@ -57,6 +57,9 @@ public:
// Virtual functions inherited from LLMouseHandler
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask);
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);

View File

@ -128,8 +128,8 @@ BOOL LLToolCamera::handleMouseDown(S32 x, S32 y, MASK mask)
gViewerWindow->hideCursor();
gViewerWindow->pickAsync(x, y, mask, pickCallback);
// don't steal focus from UI
return FALSE;
return TRUE;
}
void LLToolCamera::pickCallback(const LLPickInfo& pick_info)

View File

@ -210,22 +210,29 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
if (!objectp->usePhysics())
{
// In mouselook, we shouldn't be able to grab non-physical,
// non-touchable objects. If it has a touch handler, we
// do grab it (so llDetectedGrab works), but movement is
// blocked on the server side. JC
if (gAgent.cameraMouselook() && !script_touch)
if (script_touch)
{
mMode = GRAB_LOCKED;
gViewerWindow->hideCursor();
gViewerWindow->moveCursorToCenter();
mMode = GRAB_NONPHYSICAL; // if it has a script, use the non-physical grab
}
else
{
mMode = GRAB_NONPHYSICAL;
// In mouselook, we shouldn't be able to grab non-physical,
// non-touchable objects. If it has a touch handler, we
// do grab it (so llDetectedGrab works), but movement is
// blocked on the server side. JC
if (gAgent.cameraMouselook())
{
mMode = GRAB_LOCKED;
}
else
{
mMode = GRAB_ACTIVE_CENTER;
}
gViewerWindow->hideCursor();
gViewerWindow->moveCursorToCenter();
}
// Don't bail out here, go on and grab so buttons can get
// their "touched" event.
}
else if( !objectp->permMove() )
{

Some files were not shown because too many files have changed in this diff Show More