From 7abecb48babe6a6f09bf6692ba55076546cfced9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 1 Dec 2008 17:39:58 -0600 Subject: Second Life viewer sources 1.22.0-RC --- linden/indra/llui/llfloater.cpp | 22 +++++ linden/indra/llui/lllineeditor.cpp | 29 ++++--- linden/indra/llui/lllineeditor.h | 3 +- linden/indra/llui/llmenugl.cpp | 3 + linden/indra/llui/llmultislider.cpp | 2 +- linden/indra/llui/llscrollcontainer.cpp | 2 +- linden/indra/llui/llscrolllistctrl.cpp | 4 +- linden/indra/llui/llslider.cpp | 2 +- linden/indra/llui/lltexteditor.cpp | 144 +++++++++++++++----------------- linden/indra/llui/lltexteditor.h | 20 +++-- linden/indra/llui/llui.cpp | 88 +++++++++---------- linden/indra/llui/llview.cpp | 4 +- linden/indra/llui/llviewborder.cpp | 8 +- 13 files changed, 179 insertions(+), 152 deletions(-) (limited to 'linden/indra/llui') diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index 9f8cd65..047342f 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -127,6 +127,7 @@ LLFloaterView* gFloaterView = NULL; LLFloater::LLFloater() : //FIXME: we should initialize *all* member variables here + LLPanel(), mAutoFocus(TRUE), mResizable(FALSE), mDragOnLeft(FALSE), mMinWidth(0), @@ -139,6 +140,11 @@ LLFloater::LLFloater() : mButtonsEnabled[i] = FALSE; mButtons[i] = NULL; } + for (S32 i = 0; i < 4; i++) + { + mResizeBar[i] = NULL; + mResizeHandle[i] = NULL; + } mDragHandle = NULL; mHandle.bind(this); } @@ -151,6 +157,11 @@ LLFloater::LLFloater(const std::string& name) mButtonsEnabled[i] = FALSE; mButtons[i] = NULL; } + for (S32 i = 0; i < 4; i++) + { + mResizeBar[i] = NULL; + mResizeHandle[i] = NULL; + } std::string title; // null string initFloater(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults } @@ -171,6 +182,11 @@ LLFloater::LLFloater(const std::string& name, const LLRect& rect, const std::str mButtonsEnabled[i] = FALSE; mButtons[i] = NULL; } + for (S32 i = 0; i < 4; i++) + { + mResizeBar[i] = NULL; + mResizeHandle[i] = NULL; + } initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); } @@ -189,6 +205,11 @@ LLFloater::LLFloater(const std::string& name, const std::string& rect_control, c mButtonsEnabled[i] = FALSE; mButtons[i] = NULL; } + for (S32 i = 0; i < 4; i++) + { + mResizeBar[i] = NULL; + mResizeHandle[i] = NULL; + } initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); } @@ -1580,6 +1601,7 @@ void LLFloater::updateButtons() S32 button_count = 0; for (S32 i = 0; i < BUTTON_COUNT; i++) { + if(!mButtons[i]) continue; mButtons[i]->setEnabled(mButtonsEnabled[i]); if (mButtonsEnabled[i] diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index 12d1929..a0af463 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp @@ -35,6 +35,7 @@ #include "lllineeditor.h" +#include "lltexteditor.h" #include "audioengine.h" #include "llmath.h" #include "llfontgl.h" @@ -450,19 +451,19 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) BOOL doSelectAll = TRUE; // Select the word we're on - if( isPartOfWord( wtext[mCursorPos] ) ) + if( LLTextEditor::isPartOfWord( wtext[mCursorPos] ) ) { S32 old_selection_start = mLastSelectionStart; S32 old_selection_end = mLastSelectionEnd; // Select word the cursor is over - while ((mCursorPos > 0) && isPartOfWord( wtext[mCursorPos-1] )) + while ((mCursorPos > 0) && LLTextEditor::isPartOfWord( wtext[mCursorPos-1] )) { // Find the start of the word mCursorPos--; } startSelection(); - while ((mCursorPos < (S32)wtext.length()) && isPartOfWord( wtext[mCursorPos] ) ) + while ((mCursorPos < (S32)wtext.length()) && LLTextEditor::isPartOfWord( wtext[mCursorPos] ) ) { // Find the end of the word mCursorPos++; } @@ -764,7 +765,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const { cursorPos--; } - while( (cursorPos > 0) && isPartOfWord( wtext[cursorPos-1] ) ) + while( (cursorPos > 0) && LLTextEditor::isPartOfWord( wtext[cursorPos-1] ) ) { cursorPos--; } @@ -774,7 +775,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const S32 LLLineEditor::nextWordPos(S32 cursorPos) const { const LLWString& wtext = mText.getWString(); - while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) ) + while( (cursorPos < getLength()) && LLTextEditor::isPartOfWord( wtext[cursorPos] ) ) { cursorPos++; } @@ -1422,7 +1423,7 @@ void LLLineEditor::draw() #else // the old programmer art. // drawing solids requires texturing be disabled { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // draw background for text if( !mReadOnly ) { @@ -1817,9 +1818,6 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str) return success; } -//static -BOOL LLLineEditor::isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } - // static BOOL LLLineEditor::postvalidateFloat(const std::string &str) { @@ -1993,7 +1991,7 @@ BOOL LLLineEditor::prevalidateAlphaNum(const LLWString &str) if(len == 0) return rv; while(len--) { - if( !isalnum(str[len]) ) + if( !LLStringOps::isAlnum((char)str[len]) ) { rv = FALSE; break; @@ -2012,7 +2010,7 @@ BOOL LLLineEditor::prevalidateAlphaNumSpace(const LLWString &str) if(len == 0) return rv; while(len--) { - if(!(isalnum(str[len]) || (' ' == str[len]))) + if(!(LLStringOps::isAlnum((char)str[len]) || (' ' == str[len]))) { rv = FALSE; break; @@ -2034,7 +2032,7 @@ BOOL LLLineEditor::prevalidatePrintableNotPipe(const LLWString &str) rv = FALSE; break; } - if(!((' ' == str[len]) || isalnum(str[len]) || ispunct(str[len]))) + if(!((' ' == str[len]) || LLStringOps::isAlnum((char)str[len]) || LLStringOps::isPunct((char)str[len]))) { rv = FALSE; break; @@ -2052,12 +2050,13 @@ BOOL LLLineEditor::prevalidatePrintableNoSpace(const LLWString &str) if(len == 0) return rv; while(len--) { - if(iswspace(str[len])) + if(LLStringOps::isSpace(str[len])) { rv = FALSE; break; } - if( !(isalnum(str[len]) || ispunct(str[len]) ) ) + if( !(LLStringOps::isAlnum((char)str[len]) || + LLStringOps::isPunct((char)str[len]) ) ) { rv = FALSE; break; @@ -2282,7 +2281,7 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory } //static -void LLLineEditor::cleanupClass() +void LLLineEditor::cleanupLineEditor() { sImage = NULL; } diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index 09a240b..bc9e406 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h @@ -82,7 +82,7 @@ public: virtual LLXMLNodePtr getXML(bool save_children = true) const; void setColorParameters(LLXMLNodePtr node); static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - static void cleanupClass(); + static void cleanupLineEditor(); // mousehandler overrides /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); @@ -194,7 +194,6 @@ public: void setMaxTextLength(S32 max_text_length); void setTextPadding(S32 left, S32 right); // Used to specify room for children before or after text. - static BOOL isPartOfWord(llwchar c); // Prevalidation controls which keystrokes can affect the editor void setPrevalidate( BOOL (*func)(const LLWString &) ); static BOOL prevalidateFloat(const LLWString &str ); diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp index 24cc47e..4766267 100644 --- a/linden/indra/llui/llmenugl.cpp +++ b/linden/indra/llui/llmenugl.cpp @@ -1309,6 +1309,7 @@ void LLMenuItemBranchGL::openMenu() } mBranch->translate( delta_x, delta_y ); mBranch->setVisible( TRUE ); + mBranch->getParent()->sendChildToFront(mBranch); } } @@ -1427,6 +1428,7 @@ void LLMenuItemBranchDownGL::openMenu( void ) setHighlight(TRUE); branch->setVisible( TRUE ); + branch->getParent()->sendChildToFront(branch); } } } @@ -2958,6 +2960,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) } menu->translate( delta_x, delta_y ); menu->setVisible( TRUE ); + menu->getParent()->sendChildToFront(menu); } //----------------------------------------------------------------------------- diff --git a/linden/indra/llui/llmultislider.cpp b/linden/indra/llui/llmultislider.cpp index 227cf98..11c2cba 100644 --- a/linden/indra/llui/llmultislider.cpp +++ b/linden/indra/llui/llmultislider.cpp @@ -431,7 +431,7 @@ void LLMultiSlider::draw() // Draw background and thumb. // drawing solids requires texturing be disabled - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLRect rect(mDragStartThumbRect); diff --git a/linden/indra/llui/llscrollcontainer.cpp b/linden/indra/llui/llscrollcontainer.cpp index 1ba2923..51face6 100644 --- a/linden/indra/llui/llscrollcontainer.cpp +++ b/linden/indra/llui/llscrollcontainer.cpp @@ -425,7 +425,7 @@ void LLScrollableContainerView::draw() // Draw background if( mIsOpaque ) { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv( mBackgroundColor.mV ); gl_rect_2d( mInnerRect ); } diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp index d342378..92bcb88 100644 --- a/linden/indra/llui/llscrolllistctrl.cpp +++ b/linden/indra/llui/llscrolllistctrl.cpp @@ -435,7 +435,7 @@ void LLScrollListItem::draw(const LLRect& rect, const LLColor4& fg_color, const // draw background rect LLRect bg_rect = rect; { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv(bg_color.mV); gl_rect_2d( bg_rect ); } @@ -1758,7 +1758,7 @@ void LLScrollListCtrl::draw() // Draw background if (mBackgroundVisible) { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv( getEnabled() ? mBgWriteableColor.mV : mBgReadOnlyColor.mV ); gl_rect_2d(background); } diff --git a/linden/indra/llui/llslider.cpp b/linden/indra/llui/llslider.cpp index 4cc558f..b2438af 100644 --- a/linden/indra/llui/llslider.cpp +++ b/linden/indra/llui/llslider.cpp @@ -253,7 +253,7 @@ void LLSlider::draw() // Draw background and thumb. // drawing solids requires texturing be disabled - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); F32 opacity = getEnabled() ? 1.f : 0.3f; LLColor4 center_color = (mThumbCenterColor % opacity); diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index e56002f..281dbe4 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -260,7 +260,7 @@ LLTextEditor::LLTextEditor( mIsSelecting( FALSE ), mSelectionStart( 0 ), mSelectionEnd( 0 ), - mScrolledToBottom( FALSE ), + mScrolledToBottom( TRUE ), mOnScrollEndCallback( NULL ), mOnScrollEndData( NULL ), mCursorColor( LLUI::sColorsGroup->getColor( "TextCursorColor" ) ), @@ -277,14 +277,16 @@ LLTextEditor::LLTextEditor( mCommitOnFocusLost( FALSE ), mHideScrollbarForShortDocs( FALSE ), mTakesNonScrollClicks( TRUE ), - mTrackBottom( TRUE ), + mTrackBottom( FALSE ), mAllowEmbeddedItems( allow_embedded_items ), mAcceptCallingCardNames(FALSE), mHandleEditKeysDirectly( FALSE ), mMouseDownX(0), mMouseDownY(0), mLastSelectionX(-1), - mLastSelectionY(-1) + mLastSelectionY(-1), + mReflowNeeded(FALSE), + mScrollNeeded(FALSE) { mSourceID.generate(); @@ -468,6 +470,13 @@ void LLTextEditor::updateLineStartList(S32 startpos) mScrollbar->setVisible(!short_doc); } + // if scrolled to bottom, stay at bottom + // unless user is editing text + // do this after updating page size + if (mScrolledToBottom && mTrackBottom && !hasFocus()) + { + endOfDoc(); + } } //////////////////////////////////////////////////////////// @@ -511,8 +520,7 @@ void LLTextEditor::setText(const LLStringExplicit &utf8str) setCursorPos(0); deselect(); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); resetDirty(); } @@ -529,8 +537,7 @@ void LLTextEditor::setWText(const LLWString &wtext) setCursorPos(0); deselect(); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); resetDirty(); } @@ -568,8 +575,7 @@ void LLTextEditor::setWordWrap(BOOL b) setCursorPos(0); deselect(); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); } @@ -734,6 +740,7 @@ S32 LLTextEditor::getLineStart( S32 line ) const { return 0; } + line = llclamp(line, 0, num_lines-1); S32 segidx = mLineStartList[line].mSegment; S32 segoffset = mLineStartList[line].mOffset; @@ -781,14 +788,14 @@ void LLTextEditor::getSegmentAndOffset( S32 startpos, S32* segidxp, S32* offsetp *offsetp = startpos - (*seg_iter)->getStart(); } -const LLTextSegment* LLTextEditor::getPreviousSegment() +const LLTextSegment* LLTextEditor::getPreviousSegment() const { // find segment index at character to left of cursor (or rightmost edge of selection) S32 idx = llmax(0, getSegmentIdxAtOffset(mCursorPos) - 1); return idx >= 0 ? mSegments[idx] : NULL; } -void LLTextEditor::getSelectedSegments(std::vector& segments) +void LLTextEditor::getSelectedSegments(std::vector& segments) const { S32 left = hasSelection() ? llmin(mSelectionStart, mSelectionEnd) : mCursorPos; S32 right = hasSelection() ? llmax(mSelectionStart, mSelectionEnd) : mCursorPos; @@ -875,13 +882,12 @@ void LLTextEditor::setCursor(S32 row, S32 column) } doc += column; setCursorPos(doc - mWText.c_str()); - updateScrollFromCursor(); } void LLTextEditor::setCursorPos(S32 offset) { mCursorPos = llclamp(offset, 0, (S32)getLength()); - updateScrollFromCursor(); + needsScroll(); // reset desired x cursor position mDesiredXPixel = -1; } @@ -1222,8 +1228,6 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) setCursorAtLocalPos( x, y, TRUE ); mSelectionEnd = mCursorPos; - - updateScrollFromCursor(); } lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; @@ -1317,8 +1321,6 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) setCursorAtLocalPos( x, y, TRUE ); endSelection(); - - updateScrollFromCursor(); } if( !hasSelection() ) @@ -1839,8 +1841,7 @@ void LLTextEditor::cut() gClipboard.copyFromSubstring( mWText, left_pos, length, mSourceID ); deleteSelection( FALSE ); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); } BOOL LLTextEditor::canCopy() const @@ -1910,8 +1911,7 @@ void LLTextEditor::paste() setCursorPos(mCursorPos + insert(mCursorPos, clean_string, FALSE)); deselect(); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); } @@ -2235,9 +2235,9 @@ BOOL LLTextEditor::handleKeyHere(KEY key, MASK mask ) if(text_may_have_changed) { - updateLineStartList(); + needsReflow(); } - updateScrollFromCursor(); + needsScroll(); } } @@ -2280,8 +2280,7 @@ BOOL LLTextEditor::handleUnicodeCharHere(llwchar uni_char) // Most keystrokes will make the selection box go away, but not all will. deselect(); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); } } @@ -2339,8 +2338,7 @@ void LLTextEditor::doDelete() } } - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); } //---------------------------------------------------------------------------- @@ -2383,8 +2381,7 @@ void LLTextEditor::undo() setCursorPos(pos); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); } BOOL LLTextEditor::canRedo() const @@ -2426,8 +2423,7 @@ void LLTextEditor::redo() setCursorPos(pos); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); } void LLTextEditor::onFocusReceived() @@ -2594,7 +2590,7 @@ void LLTextEditor::drawSelectionBackground() BOOL selection_visible = (left_visible_pos <= selection_right) && (selection_left <= right_visible_pos); if( selection_visible ) { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); const LLColor4& color = mReadOnly ? mReadOnlyBgColor : mWriteableBgColor; F32 alpha = hasFocus() ? 1.f : 0.5f; gGL.color4f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], alpha ); @@ -2729,7 +2725,7 @@ void LLTextEditor::drawCursor() } } - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv( mCursorColor.mV ); @@ -3100,6 +3096,20 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 void LLTextEditor::draw() { + // do on-demand reflow + if (mReflowNeeded) + { + updateLineStartList(); + mReflowNeeded = FALSE; + } + + // then update scroll position, as cursor may have moved + if (mScrollNeeded) + { + updateScrollFromCursor(); + mScrollNeeded = FALSE; + } + { LLLocalClipRect clip(LLRect(0, getRect().getHeight(), getRect().getWidth() - (mScrollbar->getVisible() ? SCROLLBAR_SIZE : 0), 0)); @@ -3118,10 +3128,10 @@ void LLTextEditor::draw() mBorder->setKeyboardFocusHighlight( gFocusMgr.getKeyboardFocus() == this);// && !mReadOnly); } + LLView::draw(); // Draw children (scrollbar and border) + // remember if we are supposed to be at the bottom of the buffer mScrolledToBottom = isScrolledToBottom(); - - LLView::draw(); // Draw children (scrollbar and border) } @@ -3311,7 +3321,7 @@ void LLTextEditor::setCursorAndScrollToEnd() { deselect(); endOfDoc(); - updateScrollFromCursor(); + needsScroll(); } void LLTextEditor::getLineAndColumnForPosition( S32 position, S32* line, S32* col, BOOL include_wordwrap ) @@ -3438,7 +3448,7 @@ void LLTextEditor::reshape(S32 width, S32 height, BOOL called_from_parent) // up-to-date mTextRect updateTextRect(); - updateLineStartList(); + needsReflow(); // propagate shape information to scrollbar mScrollbar->setDocSize( getLineCount() ); @@ -3446,14 +3456,6 @@ void LLTextEditor::reshape(S32 width, S32 height, BOOL called_from_parent) S32 line_height = llround( mGLFont->getLineHeight() ); S32 page_lines = mTextRect.getHeight() / line_height; mScrollbar->setPageSize( page_lines ); - - // if scrolled to bottom, stay at bottom - // unless user is editing text - // do this after updating page size - if (mScrolledToBottom && mTrackBottom && !hasFocus()) - { - endOfDoc(); - } } void LLTextEditor::autoIndent() @@ -3500,8 +3502,7 @@ void LLTextEditor::insertText(const std::string &new_text) setCursorPos(mCursorPos + insert( mCursorPos, utf8str_to_wstring(new_text), FALSE )); - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); setEnabled( enabled ); } @@ -3600,7 +3601,7 @@ void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool mSegments.push_back(segment); } - updateLineStartList(old_length); + needsReflow(); // Set the cursor and scroll position // Maintain the scroll position unless the scroll was at the end of the doc (in which @@ -3639,14 +3640,6 @@ void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool { blockUndo(); } - - // if scrolled to bottom, stay at bottom - // unless user is editing text - // do this after updating page size - if (mScrolledToBottom && mTrackBottom && !hasFocus()) - { - endOfDoc(); - } } void LLTextEditor::removeTextFromEnd(S32 num_chars) @@ -3661,7 +3654,10 @@ void LLTextEditor::removeTextFromEnd(S32 num_chars) mSelectionEnd = llclamp(mSelectionEnd, 0, len); pruneSegments(); + + // pruneSegments will invalidate mLineStartList. updateLineStartList(); + needsScroll(); } /////////////////////////////////////////////////////////////////// @@ -3759,8 +3755,7 @@ BOOL LLTextEditor::tryToRevertToPristineState() } } - updateLineStartList(); - updateScrollFromCursor(); + needsReflow(); } return isPristine(); // TRUE => success @@ -3808,6 +3803,7 @@ void LLTextEditor::updateSegments() { findEmbeddedItemSegments(); } + // Make sure we have at least one segment if (mSegments.size() == 1 && mSegments[0]->getIsDefault()) { @@ -3824,6 +3820,7 @@ void LLTextEditor::updateSegments() } // Only effective if text was removed from the end of the editor +// *NOTE: Using this will invalidate references to mSegments from mLineStartList. void LLTextEditor::pruneSegments() { S32 len = mWText.length(); @@ -4066,9 +4063,7 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) setCursorPos(0); deselect(); - updateLineStartList(); - updateScrollFromCursor(); - + needsReflow(); return success; } @@ -4260,35 +4255,35 @@ S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) std::string openers=" \t\n('\"[{<>"; std::string closers=" \t\n)'\"]}><;"; - S32 m2 = 0; - S32 retval = 0; + S32 index = 0; if (reverse) { - - for (retval=pos; retval >= 0; retval--) + for (index=pos; index >= 0; index--) { - m2 = openers.find(line.substr(retval,1)); + char c = line[index]; + S32 m2 = openers.find(c); if (m2 >= 0) { - break; + return index+1; } } - return retval+1; } else { - for (retval=pos; retval<(S32)line.length(); retval++) + for (index=pos; index<(S32)line.length(); index++) { - m2 = closers.find(line.substr(retval,1)); + char c = line[index]; + S32 m2 = closers.find(c); if (m2 >= 0) { - break; + return index; } } - return retval; - } + } + + return index; } BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end) const @@ -4476,9 +4471,8 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string, mPreeditStandouts = preedit_standouts; - updateLineStartList(); + needsReflow(); setCursorPos(insert_preedit_at + caret_position); - // updateScrollFromCursor(); // Update of the preedit should be caused by some key strokes. mKeystrokeTimer.reset(); diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h index 3cff91d..3604cf6 100644 --- a/linden/indra/llui/lltexteditor.h +++ b/linden/indra/llui/lltexteditor.h @@ -245,9 +245,11 @@ public: llwchar getWChar(S32 pos) const { return mWText[pos]; } LLWString getWSubString(S32 pos, S32 len) const { return mWText.substr(pos, len); } - const LLTextSegment* getCurrentSegment() { return getSegmentAtOffset(mCursorPos); } - const LLTextSegment* getPreviousSegment(); - void getSelectedSegments(std::vector& segments); + const LLTextSegment* getCurrentSegment() const { return getSegmentAtOffset(mCursorPos); } + const LLTextSegment* getPreviousSegment() const; + void getSelectedSegments(std::vector& segments) const; + + static bool isPartOfWord(llwchar c) { return (c == '_') || LLStringOps::isAlnum((char)c); } protected: // @@ -266,8 +268,6 @@ protected: void assignEmbedded(const std::string &s); BOOL truncate(); // Returns true if truncation occurs - static BOOL isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } - void removeCharOrTab(); void setCursorAtLocalPos(S32 x, S32 y, BOOL round); S32 getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const; @@ -433,6 +433,14 @@ private: void drawText(); void drawClippedSegment(const LLWString &wtext, S32 seg_start, S32 seg_end, F32 x, F32 y, S32 selection_left, S32 selection_right, const LLStyleSP& color, F32* right_x); + void needsReflow() + { + mReflowNeeded = TRUE; + // cursor might have moved, need to scroll + mScrollNeeded = TRUE; + } + void needsScroll() { mScrollNeeded = TRUE; } + // // Data // @@ -489,6 +497,8 @@ private: }; typedef std::vector line_list_t; line_list_t mLineStartList; + BOOL mReflowNeeded; + BOOL mScrollNeeded; LLFrameTimer mKeystrokeTimer; diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 734aecf..5502246 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp @@ -143,11 +143,11 @@ void gl_state_for_2d(S32 width, S32 height) void gl_draw_x(const LLRect& rect, const LLColor4& color) { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv( color.mV ); - gGL.begin( LLVertexBuffer::LINES ); + gGL.begin( LLRender::LINES ); gGL.vertex2i( rect.mLeft, rect.mTop ); gGL.vertex2i( rect.mRight, rect.mBottom ); gGL.vertex2i( rect.mLeft, rect.mBottom ); @@ -183,12 +183,12 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixe void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) { stop_glerror(); - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // Counterclockwise quad will face the viewer if( filled ) { - gGL.begin( LLVertexBuffer::QUADS ); + gGL.begin( LLRender::QUADS ); gGL.vertex2i(left, top); gGL.vertex2i(left, bottom); gGL.vertex2i(right, bottom); @@ -200,7 +200,7 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) if( gGLManager.mATIOffsetVerticalLines ) { // Work around bug in ATI driver: vertical lines are offset by (-1,-1) - gGL.begin( LLVertexBuffer::LINES ); + gGL.begin( LLRender::LINES ); // Verticals gGL.vertex2i(left + 1, top); @@ -223,7 +223,7 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) { top--; right--; - gGL.begin( LLVertexBuffer::LINE_STRIP ); + gGL.begin( LLRender::LINE_STRIP ); gGL.vertex2i(left, top); gGL.vertex2i(left, bottom); gGL.vertex2i(right, bottom); @@ -254,7 +254,7 @@ void gl_rect_2d( const LLRect& rect, const LLColor4& color, BOOL filled ) void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &start_color, S32 lines) { stop_glerror(); - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // HACK: Overlap with the rectangle by a single pixel. right--; @@ -264,7 +264,7 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st LLColor4 end_color = start_color; end_color.mV[VALPHA] = 0.f; - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); // Right edge, CCW faces screen gGL.color4fv(start_color.mV); @@ -324,9 +324,9 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2 ) y2++; } - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.begin(LLVertexBuffer::LINES); + gGL.begin(LLRender::LINES); gGL.vertex2i(x1, y1); gGL.vertex2i(x2, y2); gGL.end(); @@ -343,11 +343,11 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2, const LLColor4 &color ) y2++; } - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv( color.mV ); - gGL.begin(LLVertexBuffer::LINES); + gGL.begin(LLRender::LINES); gGL.vertex2i(x1, y1); gGL.vertex2i(x2, y2); gGL.end(); @@ -355,17 +355,17 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2, const LLColor4 &color ) void gl_triangle_2d(S32 x1, S32 y1, S32 x2, S32 y2, S32 x3, S32 y3, const LLColor4& color, BOOL filled) { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv(color.mV); if (filled) { - gGL.begin(LLVertexBuffer::TRIANGLES); + gGL.begin(LLRender::TRIANGLES); } else { - gGL.begin(LLVertexBuffer::LINE_LOOP); + gGL.begin(LLRender::LINE_LOOP); } gGL.vertex2i(x1, y1); gGL.vertex2i(x2, y2); @@ -375,11 +375,11 @@ void gl_triangle_2d(S32 x1, S32 y1, S32 x2, S32 y2, S32 x3, S32 y3, const LLColo void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max_frac) { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); length = llmin((S32)(max_frac*(right - left)), length); length = llmin((S32)(max_frac*(top - bottom)), length); - gGL.begin(LLVertexBuffer::LINES); + gGL.begin(LLRender::LINES); gGL.vertex2i(left, top); gGL.vertex2i(left + length, top); @@ -496,11 +496,11 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma { gGL.translatef((F32)x, (F32)y, 0.f); - image->bind(); + gGL.getTexUnit(0)->bind(image); gGL.color4fv(color.mV); - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); { // draw bottom left gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); @@ -656,11 +656,11 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre gGL.translatef( -offset_x, -offset_y, 0.f ); } - image->bind(); + gGL.getTexUnit(0)->bind(image); gGL.color4fv(color.mV); - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); { gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); gGL.vertex2i(width, height ); @@ -694,11 +694,11 @@ void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageG { gGL.translatef((F32)x, (F32)y, 0.f); - image->bind(); + gGL.getTexUnit(0)->bind(image); gGL.color4fv(color.mV); - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); { gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); gGL.vertex2i(width, height ); @@ -733,7 +733,7 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL glLineWidth(2.5f); glLineStipple(2, 0x3333 << shift); - gGL.begin(LLVertexBuffer::LINES); + gGL.begin(LLRender::LINES); { gGL.vertex3fv( start.mV ); gGL.vertex3fv( end.mV ); @@ -750,7 +750,7 @@ void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom) glLogicOp( GL_XOR ); stop_glerror(); - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); gGL.vertex2i(left, top); gGL.vertex2i(left, bottom); gGL.vertex2i(right, bottom); @@ -782,14 +782,14 @@ void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F if (filled) { - gGL.begin(LLVertexBuffer::TRIANGLE_FAN); + gGL.begin(LLRender::TRIANGLE_FAN); gGL.vertex2f(0.f, 0.f); // make sure circle is complete steps += 1; } else { - gGL.begin(LLVertexBuffer::LINE_STRIP); + gGL.begin(LLRender::LINE_STRIP); } while( steps-- ) @@ -809,7 +809,7 @@ void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled { gGL.pushMatrix(); { - LLGLSNoTexture gls_no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.translatef(center_x, center_y, 0.f); // Inexact, but reasonably fast. @@ -821,14 +821,14 @@ void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled if (filled) { - gGL.begin(LLVertexBuffer::TRIANGLE_FAN); + gGL.begin(LLRender::TRIANGLE_FAN); gGL.vertex2f(0.f, 0.f); // make sure circle is complete steps += 1; } else { - gGL.begin(LLVertexBuffer::LINE_LOOP); + gGL.begin(LLRender::LINE_LOOP); } while( steps-- ) @@ -850,7 +850,7 @@ void gl_deep_circle( F32 radius, F32 depth, S32 steps ) F32 x = radius; F32 y = 0.f; F32 angle_delta = F_TWO_PI / (F32)steps; - gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); + gGL.begin( LLRender::TRIANGLE_STRIP ); { S32 step = steps + 1; // An extra step to close the circle. while( step-- ) @@ -905,7 +905,7 @@ void gl_rect_2d_checkerboard(const LLRect& rect) first = FALSE; } - LLGLSNoTexture gls_no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // ...white squares gGL.color3f( 1.f, 1.f, 1.f ); @@ -935,9 +935,9 @@ void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4& F32 x2 = inner_radius; F32 y2 = 0.f; - LLGLSNoTexture gls_no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); + gGL.begin( LLRender::TRIANGLE_STRIP ); { steps += 1; // An extra step to close the circle. while( steps-- ) @@ -972,8 +972,8 @@ void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 x2 = inner_radius * cos( start_radians ); F32 y2 = inner_radius * sin( start_radians ); - LLGLSNoTexture gls_no_texture; - gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.begin( LLRender::TRIANGLE_STRIP ); { steps += 1; // An extra step to close the circle. while( steps-- ) @@ -1008,9 +1008,9 @@ void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LL F32 x2 = inner_radius * cos( HALF_DELTA ); F32 y2 = inner_radius * sin( HALF_DELTA ); - LLGLSNoTexture gls_no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.begin( LLVertexBuffer::LINES ); + gGL.begin( LLRender::LINES ); { while( count-- ) { @@ -1033,7 +1033,7 @@ void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LL void gl_rect_2d_simple_tex( S32 width, S32 height ) { - gGL.begin( LLVertexBuffer::QUADS ); + gGL.begin( LLRender::QUADS ); gGL.texCoord2f(1.f, 1.f); gGL.vertex2i(width, height); @@ -1052,7 +1052,7 @@ void gl_rect_2d_simple_tex( S32 width, S32 height ) void gl_rect_2d_simple( S32 width, S32 height ) { - gGL.begin( LLVertexBuffer::QUADS ); + gGL.begin( LLRender::QUADS ); gGL.vertex2i(width, height); gGL.vertex2i(0, height); gGL.vertex2i(0, 0); @@ -1094,7 +1094,7 @@ void gl_segmented_rect_2d_tex(const S32 left, LLVector2 width_vec((F32)width, 0.f); LLVector2 height_vec(0.f, (F32)height); - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); { // draw bottom left gGL.texCoord2f(0.f, 0.f); @@ -1262,7 +1262,7 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, LLVector2 x_min; LLVector2 x_max; - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); { if (start_fragment < middle_start) { @@ -1419,7 +1419,7 @@ void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& bo LLVector3 bottom_border_height = ((edges & (~(U32)ROUNDED_RECT_TOP)) != 0) ? border_height : LLVector3::zero; - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); { // draw bottom left gGL.texCoord2f(0.f, 0.f); @@ -1575,7 +1575,7 @@ void LLUI::initClass(LLControlGroup* config, void LLUI::cleanupClass() { sImageProvider->cleanUp(); - LLLineEditor::cleanupClass(); + LLLineEditor::cleanupLineEditor(); } diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index 034c49b..bc6fe7e 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp @@ -1281,7 +1281,7 @@ void LLView::drawDebugRect() LLUI::pushMatrix(); { // drawing solids requires texturing be disabled - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); if (mUseBoundingRect) { @@ -1303,7 +1303,7 @@ void LLView::drawDebugRect() gGL.color4fv( border_color.mV ); - gGL.begin(LLVertexBuffer::LINES); + gGL.begin(LLRender::LINES); gGL.vertex2i(0, debug_rect.getHeight() - 1); gGL.vertex2i(0, 0); diff --git a/linden/indra/llui/llviewborder.cpp b/linden/indra/llui/llviewborder.cpp index 8a5beea..a1c26d6 100644 --- a/linden/indra/llui/llviewborder.cpp +++ b/linden/indra/llui/llviewborder.cpp @@ -111,7 +111,7 @@ void LLViewBorder::draw() void LLViewBorder::drawOnePixelLines() { - LLGLSNoTexture uiNoTexture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLColor4 top_color = mHighlightLight; LLColor4 bottom_color = mHighlightLight; @@ -158,7 +158,7 @@ void LLViewBorder::drawOnePixelLines() void LLViewBorder::drawTwoPixelLines() { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLColor4 focus_color = gFocusMgr.getFocusColor(); @@ -230,7 +230,7 @@ void LLViewBorder::drawTextures() //gGL.color4fv(UI_VERTEX_COLOR.mV); - //mTexture->bind(); + //gGL.getTexUnit(0)->bind(mTexture); //glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); //glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); @@ -248,7 +248,7 @@ void LLViewBorder::drawTextureTrapezoid( F32 degrees, S32 width, S32 length, F32 gGL.translatef(start_x, start_y, 0.f); glRotatef( degrees, 0, 0, 1 ); - gGL.begin(LLVertexBuffer::QUADS); + gGL.begin(LLRender::QUADS); { // width, width /---------\ length-width, width // // / \ // -- cgit v1.1 From a2a8404bef1224ec84a70fac0d97232091c064d0 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 1 Dec 2008 17:41:02 -0600 Subject: Second Life viewer sources 1.22.1-RC --- linden/indra/llui/lltexteditor.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'linden/indra/llui') diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 281dbe4..4b0acf8 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -4255,11 +4255,9 @@ S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) std::string openers=" \t\n('\"[{<>"; std::string closers=" \t\n)'\"]}><;"; - S32 index = 0; - if (reverse) { - for (index=pos; index >= 0; index--) + for (int index=pos; index >= 0; index--) { char c = line[index]; S32 m2 = openers.find(c); @@ -4268,11 +4266,12 @@ S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) return index+1; } } + return 0; // index is -1, don't want to return that. } else { - for (index=pos; index<(S32)line.length(); index++) + for (int index=pos; index<(S32)line.length(); index++) { char c = line[index]; S32 m2 = closers.find(c); @@ -4281,9 +4280,8 @@ S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) return index; } } + return line.length(); } - - return index; } BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end) const -- cgit v1.1 From 22b861982f2efd5d16097a012627e73b9fb85834 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Tue, 9 Dec 2008 22:25:37 -0600 Subject: Second Life viewer sources 1.22.2-RC --- linden/indra/llui/llbutton.cpp | 1 + linden/indra/llui/llui.cpp | 36 ++++++-- linden/indra/llui/llui.h | 19 ++--- linden/indra/llui/lluictrlfactory.cpp | 10 +-- linden/indra/llui/llview.cpp | 156 ++++------------------------------ 5 files changed, 58 insertions(+), 164 deletions(-) (limited to 'linden/indra/llui') diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 508500a..6402985 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp @@ -38,6 +38,7 @@ #include "llstring.h" // Project includes +#include "llhtmlhelp.h" #include "llkeyboard.h" #include "llui.h" #include "lluiconstants.h" diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 5502246..4817d78 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp @@ -30,8 +30,6 @@ */ // Utilities functions the user interface needs - -//#include "llviewerprecompiledheaders.h" #include "linden_common.h" #include @@ -1647,6 +1645,34 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y) setCursorPositionScreen(screen_x, screen_y); } +// On Windows, the user typically sets the language when they install the +// app (by running it with a shortcut that sets InstallLanguage). On Mac, +// or on Windows if the SecondLife.exe executable is run directly, the +// language follows the OS language. In all cases the user can override +// the language manually in preferences. JC +// static +std::string LLUI::getLanguage() +{ + std::string language = "en-us"; + if (sConfigGroup) + { + language = sConfigGroup->getString("Language"); + if (language.empty() || language == "default") + { + language = sConfigGroup->getString("InstallLanguage"); + } + if (language.empty() || language == "default") + { + language = sConfigGroup->getString("SystemLanguage"); + } + if (language.empty() || language == "default") + { + language = "en-us"; + } + } + return language; +} + //static std::string LLUI::locateSkin(const std::string& filename) { @@ -1660,11 +1686,7 @@ std::string LLUI::locateSkin(const std::string& filename) { if (!gDirUtilp->fileExists(found_file)) { - std::string localization(sConfigGroup->getString("Language")); - if(localization == "default") - { - localization = sConfigGroup->getString("SystemLanguage"); - } + std::string localization = getLanguage(); std::string local_skin = "xui" + slash + localization + slash + filename; found_file = gDirUtilp->findSkinnedFilename(local_skin); } diff --git a/linden/indra/llui/llui.h b/linden/indra/llui/llui.h index 4c1bb22..0f498d3 100644 --- a/linden/indra/llui/llui.h +++ b/linden/indra/llui/llui.h @@ -38,15 +38,17 @@ #include "llcontrol.h" #include "llrect.h" #include "llcoord.h" -#include "llhtmlhelp.h" -#include "llgl.h" +//#include "llhtmlhelp.h" +#include "llgl.h" // *TODO: break this dependency #include -#include "llimagegl.h" +//#include "llimagegl.h" // LLUIFactory #include "llsd.h" class LLColor4; +class LLHtmlHelp; +class LLImageGL; class LLVector3; class LLVector2; class LLUUID; @@ -139,13 +141,6 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL gl_rect_2d_offset_local( rect.mLeft, rect.mTop, rect.mRight, rect.mBottom, pixel_offset, filled ); } -// No longer used -// Initializes translation table -// void init_tr(); - -// Returns a string from the string table in the correct language -// std::string tr(const std::string& english_chars); - // Used to hide the flashing text cursor when window doesn't have focus. extern BOOL gShowTextEditCursor; @@ -172,6 +167,10 @@ public: static void loadIdentity(); static void translate(F32 x, F32 y, F32 z = 0.0f); + // Return the ISO639 language name ("en", "ko", etc.) for the viewer UI. + // http://www.loc.gov/standards/iso639-2/php/code_list.php + static std::string getLanguage(); + //helper functions (should probably move free standing rendering helper functions here) static std::string locateSkin(const std::string& filename); static void setCursorPositionScreen(S32 x, S32 y); diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp index bcd4876..db52261 100644 --- a/linden/indra/llui/lluictrlfactory.cpp +++ b/linden/indra/llui/lluictrlfactory.cpp @@ -130,15 +130,7 @@ void LLUICtrlFactory::setupPaths() for (path = root->getFirstChild(); path.notNull(); path = path->getNextSibling()) { LLUIString path_val_ui(path->getValue()); - std::string language = "en-us"; - if (LLUI::sConfigGroup) - { - language = LLUI::sConfigGroup->getString("Language"); - if(language == "default") - { - language = LLUI::sConfigGroup->getString("SystemLanguage"); - } - } + std::string language = LLUI::getLanguage(); path_val_ui.setArg("[LANGUAGE]", language); if (std::find(sXUIPaths.begin(), sXUIPaths.end(), path_val_ui.getString()) == sXUIPaths.end()) diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index bc6fe7e..910b4f5 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp @@ -43,7 +43,7 @@ #include "llfocusmgr.h" #include "llrect.h" #include "llstl.h" -#include "llui.h" // colors saved settings +#include "llui.h" #include "lluictrl.h" #include "llwindow.h" #include "v3color.h" @@ -710,25 +710,38 @@ BOOL LLView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_s && viewp->getEnabled() && viewp->handleToolTip(local_x, local_y, msg, sticky_rect_screen )) { + // child provided a tooltip, just return + if (!msg.empty()) return TRUE; + + // otherwise, one of our children ate the event so don't traverse + // siblings however, our child did not actually provide a tooltip + // so we might want to handled = TRUE; break; } } + // get our own tooltip tool_tip = mToolTipMsg.getString(); if ( - LLUI::sShowXUINames && - (tool_tip.find(".xml", 0) == std::string::npos) && - (mName.find("Drag", 0) == std::string::npos)) + LLUI::sShowXUINames + && (tool_tip.find(".xml", 0) == std::string::npos) + && (mName.find("Drag", 0) == std::string::npos)) { tool_tip = getShowNamesToolTip(); } BOOL show_names_text_box = LLUI::sShowXUINames && dynamic_cast(this) != NULL; - if( !handled && (blockMouseEvent(x, y) || show_names_text_box)) + // don't allow any siblings to handle this event + // even if we don't have a tooltip + if (getMouseOpaque() || show_names_text_box) { + handled = TRUE; + } + if(!tool_tip.empty()) + { msg = tool_tip; // Convert rect local to screen coordinates @@ -2060,139 +2073,6 @@ LLView* LLView::findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, new_rect.translate(delta_x, delta_y); return snap_view; - - //// If the view is near the edge of its parent, snap it to - //// the edge. - //LLRect test_rect = getSnapRect(); - //LLRect view_rect = getSnapRect(); - //test_rect.stretch(padding); - //view_rect.stretch(padding); - - //S32 x_threshold = threshold; - //S32 y_threshold = threshold; - - //LLRect parent_local_snap_rect = mParentView->getLocalSnapRect(); - - //if (snap_type == SNAP_PARENT || snap_type == SNAP_PARENT_AND_SIBLINGS) - //{ - // if (llabs(parent_local_snap_rect.mRight - test_rect.mRight) <= x_threshold && (parent_local_snap_rect.mRight - test_rect.mRight) * mouse_dir.mX >= 0) - // { - // view_rect.translate(parent_local_snap_rect.mRight - view_rect.mRight, 0); - // snap_view = mParentView; - // x_threshold = llabs(parent_local_snap_rect.mRight - test_rect.mRight); - // } - - // if (llabs(test_rect.mLeft - parent_local_snap_rect.mLeft) <= x_threshold && test_rect.mLeft * mouse_dir.mX <= 0) - // { - // view_rect.translate(parent_local_snap_rect.mLeft - view_rect.mLeft, 0); - // snap_view = mParentView; - // x_threshold = llabs(test_rect.mLeft - parent_local_snap_rect.mLeft); - // } - - // if (llabs(test_rect.mBottom - parent_local_snap_rect.mBottom) <= y_threshold && test_rect.mBottom * mouse_dir.mY <= 0) - // { - // view_rect.translate(0, parent_local_snap_rect.mBottom - view_rect.mBottom); - // snap_view = mParentView; - // y_threshold = llabs(test_rect.mBottom - parent_local_snap_rect.mBottom); - // } - - // if (llabs(parent_local_snap_rect.mTop - test_rect.mTop) <= y_threshold && (parent_local_snap_rect.mTop - test_rect.mTop) * mouse_dir.mY >= 0) - // { - // view_rect.translate(0, parent_local_snap_rect.mTop - view_rect.mTop); - // snap_view = mParentView; - // y_threshold = llabs(parent_local_snap_rect.mTop - test_rect.mTop); - // } - //} - //if (snap_type == SNAP_SIBLINGS || snap_type == SNAP_PARENT_AND_SIBLINGS) - //{ - // for ( child_list_const_iter_t child_it = mParentView->getChildList()->begin(); - // child_it != mParentView->getChildList()->end(); ++child_it) - // { - // LLView* siblingp = *child_it; - - // // skip non-snappable views (self, invisible views, etc) - // if (!canSnapTo(siblingp)) continue; - - // LLRect sibling_rect = siblingp->getSnapRect(); - - // if (llabs(test_rect.mRight - sibling_rect.mLeft) <= x_threshold - // && (test_rect.mRight - sibling_rect.mLeft) * mouse_dir.mX <= 0) - // { - // view_rect.translate(sibling_rect.mLeft - view_rect.mRight, 0); - // if (llabs(test_rect.mTop - sibling_rect.mTop) <= y_threshold && (test_rect.mTop - sibling_rect.mTop) * mouse_dir.mY <= 0) - // { - // view_rect.translate(0, sibling_rect.mTop - test_rect.mTop); - // y_threshold = llabs(test_rect.mTop - sibling_rect.mTop); - // } - // else if (llabs(test_rect.mBottom - sibling_rect.mBottom) <= y_threshold && (test_rect.mBottom - sibling_rect.mBottom) * mouse_dir.mY <= 0) - // { - // view_rect.translate(0, sibling_rect.mBottom - test_rect.mBottom); - // y_threshold = llabs(test_rect.mBottom - sibling_rect.mBottom); - // } - // snap_view = siblingp; - // x_threshold = llabs(test_rect.mRight - sibling_rect.mLeft); - // } - - // if (llabs(test_rect.mLeft - sibling_rect.mRight) <= x_threshold - // && (test_rect.mLeft - sibling_rect.mRight) * mouse_dir.mX <= 0) - // { - // view_rect.translate(sibling_rect.mRight - view_rect.mLeft, 0); - // if (llabs(test_rect.mTop - sibling_rect.mTop) <= y_threshold && (test_rect.mTop - sibling_rect.mTop) * mouse_dir.mY <= 0) - // { - // view_rect.translate(0, sibling_rect.mTop - test_rect.mTop); - // y_threshold = llabs(test_rect.mTop - sibling_rect.mTop); - // } - // else if (llabs(test_rect.mBottom - sibling_rect.mBottom) <= y_threshold && (test_rect.mBottom - sibling_rect.mBottom) * mouse_dir.mY <= 0) - // { - // view_rect.translate(0, sibling_rect.mBottom - test_rect.mBottom); - // y_threshold = llabs(test_rect.mBottom - sibling_rect.mBottom); - // } - // snap_view = siblingp; - // x_threshold = llabs(test_rect.mLeft - sibling_rect.mRight); - // } - - // if (llabs(test_rect.mBottom - sibling_rect.mTop) <= y_threshold - // && (test_rect.mBottom - sibling_rect.mTop) * mouse_dir.mY <= 0) - // { - // view_rect.translate(0, sibling_rect.mTop - view_rect.mBottom); - // if (llabs(test_rect.mLeft - sibling_rect.mLeft) <= x_threshold && (test_rect.mLeft - sibling_rect.mLeft) * mouse_dir.mX <= 0) - // { - // view_rect.translate(sibling_rect.mLeft - test_rect.mLeft, 0); - // x_threshold = llabs(test_rect.mLeft - sibling_rect.mLeft); - // } - // else if (llabs(test_rect.mRight - sibling_rect.mRight) <= x_threshold && (test_rect.mRight - sibling_rect.mRight) * mouse_dir.mX <= 0) - // { - // view_rect.translate(sibling_rect.mRight - test_rect.mRight, 0); - // x_threshold = llabs(test_rect.mRight - sibling_rect.mRight); - // } - // snap_view = siblingp; - // y_threshold = llabs(test_rect.mBottom - sibling_rect.mTop); - // } - - // if (llabs(test_rect.mTop - sibling_rect.mBottom) <= y_threshold - // && (test_rect.mTop - sibling_rect.mBottom) * mouse_dir.mY <= 0) - // { - // view_rect.translate(0, sibling_rect.mBottom - view_rect.mTop); - // if (llabs(test_rect.mLeft - sibling_rect.mLeft) <= x_threshold && (test_rect.mLeft - sibling_rect.mLeft) * mouse_dir.mX <= 0) - // { - // view_rect.translate(sibling_rect.mLeft - test_rect.mLeft, 0); - // x_threshold = llabs(test_rect.mLeft - sibling_rect.mLeft); - // } - // else if (llabs(test_rect.mRight - sibling_rect.mRight) <= x_threshold && (test_rect.mRight - sibling_rect.mRight) * mouse_dir.mX <= 0) - // { - // view_rect.translate(sibling_rect.mRight - test_rect.mRight, 0); - // x_threshold = llabs(test_rect.mRight - sibling_rect.mRight); - // } - // snap_view = siblingp; - // y_threshold = llabs(test_rect.mTop - sibling_rect.mBottom); - // } - // } - //} - - //// shrink actual view rect back down - //view_rect.stretch(-padding); - //new_rect = view_rect; - //return snap_view; } LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding) -- cgit v1.1 From 6156baad67c744ed03ea47798bfeb8a77698efc6 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 11 Jan 2009 16:10:10 -0600 Subject: Second Life viewer sources 1.22.4-RC --- linden/indra/llui/llfloater.cpp | 31 +++++++++++++++++++++++++++---- linden/indra/llui/llfloater.h | 5 +++++ linden/indra/llui/lltexteditor.cpp | 4 ++-- 3 files changed, 34 insertions(+), 6 deletions(-) (limited to 'linden/indra/llui') diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index 047342f..de4f6ce 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -544,6 +544,7 @@ void LLFloater::close(bool app_quitting) if (getHost()) { ((LLMultiFloater*)getHost())->removeFloater(this); + gFloaterView->addChild(this); } if (getSoundFlags() != SILENT @@ -1318,8 +1319,8 @@ void LLFloater::onClickEdit(void *userdata) self->mEditing = self->mEditing ? FALSE : TRUE; } -// static -void LLFloater::closeFocusedFloater() +// static +LLFloater* LLFloater::getClosableFloaterFromFocus() { LLFloater* focused_floater = NULL; @@ -1336,10 +1337,32 @@ void LLFloater::closeFocusedFloater() if (iter == sFloaterMap.end()) { // nothing found, return - return; + return NULL; + } + + // The focused floater may not be closable, + // Find and close a parental floater that is closeable, if any. + for(LLFloater* floater_to_close = focused_floater; + NULL != floater_to_close; + floater_to_close = gFloaterView->getParentFloater(floater_to_close)) + { + if(floater_to_close->isCloseable()) + { + return floater_to_close; + } } - focused_floater->close(); + return NULL; +} + +// static +void LLFloater::closeFocusedFloater() +{ + LLFloater* floater_to_close = LLFloater::getClosableFloaterFromFocus(); + if(floater_to_close) + { + floater_to_close->close(); + } // if nothing took focus after closing focused floater // give it to next floater (to allow closing multiple windows via keyboard in rapid succession) diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h index 0be5d44..267707f 100644 --- a/linden/indra/llui/llfloater.h +++ b/linden/indra/llui/llfloater.h @@ -206,6 +206,11 @@ public: LLHandle getHandle() const { return mHandle; } + // Return a closeable floater, if any, given the current focus. + static LLFloater* getClosableFloaterFromFocus(); + + // Close the floater returned by getClosableFloaterFromFocus() and + // handle refocusing. static void closeFocusedFloater(); static void onClickClose(void *userdata); diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 4b0acf8..2205005 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -471,9 +471,9 @@ void LLTextEditor::updateLineStartList(S32 startpos) } // if scrolled to bottom, stay at bottom - // unless user is editing text + // unless user is selecting text // do this after updating page size - if (mScrolledToBottom && mTrackBottom && !hasFocus()) + if (mScrolledToBottom && mTrackBottom && !hasMouseCapture()) { endOfDoc(); } -- cgit v1.1 From a87e38229921b48c32187c672a942516722f1b52 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 11 Jan 2009 16:10:39 -0600 Subject: Second Life viewer sources 1.22.5-RC --- linden/indra/llui/llalertdialog.cpp | 2 +- linden/indra/llui/llalertdialog.h | 2 +- linden/indra/llui/llbutton.cpp | 2 +- linden/indra/llui/llbutton.h | 2 +- linden/indra/llui/llcallbackmap.h | 2 +- linden/indra/llui/llcheckboxctrl.cpp | 2 +- linden/indra/llui/llcheckboxctrl.h | 2 +- linden/indra/llui/llclipboard.cpp | 2 +- linden/indra/llui/llclipboard.h | 2 +- linden/indra/llui/llcombobox.cpp | 2 +- linden/indra/llui/llcombobox.h | 2 +- linden/indra/llui/llctrlselectioninterface.cpp | 2 +- linden/indra/llui/llctrlselectioninterface.h | 2 +- linden/indra/llui/lldraghandle.cpp | 2 +- linden/indra/llui/lldraghandle.h | 2 +- linden/indra/llui/lleditmenuhandler.cpp | 2 +- linden/indra/llui/lleditmenuhandler.h | 2 +- linden/indra/llui/llfloater.cpp | 2 +- linden/indra/llui/llfloater.h | 2 +- linden/indra/llui/llfocusmgr.cpp | 2 +- linden/indra/llui/llfocusmgr.h | 2 +- linden/indra/llui/llhtmlhelp.h | 2 +- linden/indra/llui/lliconctrl.cpp | 2 +- linden/indra/llui/lliconctrl.h | 2 +- linden/indra/llui/llkeywords.cpp | 2 +- linden/indra/llui/llkeywords.h | 2 +- linden/indra/llui/lllineeditor.cpp | 2 +- linden/indra/llui/lllineeditor.h | 2 +- linden/indra/llui/llmemberlistener.h | 2 +- linden/indra/llui/llmenugl.cpp | 166 +++++++++++++++---------- linden/indra/llui/llmenugl.h | 18 +-- linden/indra/llui/llmodaldialog.cpp | 2 +- linden/indra/llui/llmodaldialog.h | 2 +- linden/indra/llui/llmultislider.cpp | 2 +- linden/indra/llui/llmultislider.h | 2 +- linden/indra/llui/llmultisliderctrl.cpp | 2 +- linden/indra/llui/llmultisliderctrl.h | 2 +- linden/indra/llui/llpanel.cpp | 2 +- linden/indra/llui/llpanel.h | 2 +- linden/indra/llui/llradiogroup.cpp | 2 +- linden/indra/llui/llradiogroup.h | 2 +- linden/indra/llui/llresizebar.cpp | 2 +- linden/indra/llui/llresizebar.h | 2 +- linden/indra/llui/llresizehandle.cpp | 2 +- linden/indra/llui/llresizehandle.h | 2 +- linden/indra/llui/llresmgr.cpp | 2 +- linden/indra/llui/llresmgr.h | 2 +- linden/indra/llui/llrootview.cpp | 2 +- linden/indra/llui/llrootview.h | 2 +- linden/indra/llui/llscrollbar.cpp | 2 +- linden/indra/llui/llscrollbar.h | 2 +- linden/indra/llui/llscrollcontainer.cpp | 2 +- linden/indra/llui/llscrollcontainer.h | 2 +- linden/indra/llui/llscrollingpanellist.cpp | 2 +- linden/indra/llui/llscrollingpanellist.h | 2 +- linden/indra/llui/llscrolllistctrl.cpp | 2 +- linden/indra/llui/llscrolllistctrl.h | 2 +- linden/indra/llui/llslider.cpp | 2 +- linden/indra/llui/llslider.h | 2 +- linden/indra/llui/llsliderctrl.cpp | 2 +- linden/indra/llui/llsliderctrl.h | 2 +- linden/indra/llui/llspinctrl.cpp | 2 +- linden/indra/llui/llspinctrl.h | 2 +- linden/indra/llui/llstyle.cpp | 2 +- linden/indra/llui/llstyle.h | 2 +- linden/indra/llui/lltabcontainer.cpp | 2 +- linden/indra/llui/lltabcontainer.h | 2 +- linden/indra/llui/lltabcontainervertical.cpp | 2 +- linden/indra/llui/lltabcontainervertical.h | 2 +- linden/indra/llui/lltextbox.cpp | 2 +- linden/indra/llui/lltextbox.h | 2 +- linden/indra/llui/lltexteditor.cpp | 2 +- linden/indra/llui/lltexteditor.h | 2 +- linden/indra/llui/llui.cpp | 2 +- linden/indra/llui/llui.h | 2 +- linden/indra/llui/lluiconstants.h | 2 +- linden/indra/llui/lluictrl.cpp | 2 +- linden/indra/llui/lluictrl.h | 2 +- linden/indra/llui/lluictrlfactory.cpp | 2 +- linden/indra/llui/lluictrlfactory.h | 2 +- linden/indra/llui/lluifwd.h | 2 +- linden/indra/llui/lluistring.cpp | 2 +- linden/indra/llui/lluistring.h | 2 +- linden/indra/llui/lluixmltags.h | 2 +- linden/indra/llui/llundo.cpp | 2 +- linden/indra/llui/llundo.h | 2 +- linden/indra/llui/llview.cpp | 2 +- linden/indra/llui/llview.h | 2 +- linden/indra/llui/llviewborder.cpp | 2 +- linden/indra/llui/llviewborder.h | 2 +- linden/indra/llui/llviewquery.cpp | 2 +- linden/indra/llui/llviewquery.h | 2 +- 92 files changed, 201 insertions(+), 163 deletions(-) (limited to 'linden/indra/llui') diff --git a/linden/indra/llui/llalertdialog.cpp b/linden/indra/llui/llalertdialog.cpp index 4be07e9..80e54b6 100644 --- a/linden/indra/llui/llalertdialog.cpp +++ b/linden/indra/llui/llalertdialog.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llalertdialog.h b/linden/indra/llui/llalertdialog.h index fc3bdea..7d82fb5 100644 --- a/linden/indra/llui/llalertdialog.h +++ b/linden/indra/llui/llalertdialog.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 6402985..34e62c8 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llbutton.h b/linden/indra/llui/llbutton.h index e9497bd..556e12c 100644 --- a/linden/indra/llui/llbutton.h +++ b/linden/indra/llui/llbutton.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llcallbackmap.h b/linden/indra/llui/llcallbackmap.h index 6f2d3bf..db11c39 100644 --- a/linden/indra/llui/llcallbackmap.h +++ b/linden/indra/llui/llcallbackmap.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llcheckboxctrl.cpp b/linden/indra/llui/llcheckboxctrl.cpp index d383640..d4c372a 100644 --- a/linden/indra/llui/llcheckboxctrl.cpp +++ b/linden/indra/llui/llcheckboxctrl.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llcheckboxctrl.h b/linden/indra/llui/llcheckboxctrl.h index 659ba82..8a70c62 100644 --- a/linden/indra/llui/llcheckboxctrl.h +++ b/linden/indra/llui/llcheckboxctrl.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llclipboard.cpp b/linden/indra/llui/llclipboard.cpp index 31d02a4..d5255e7 100644 --- a/linden/indra/llui/llclipboard.cpp +++ b/linden/indra/llui/llclipboard.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llclipboard.h b/linden/indra/llui/llclipboard.h index 2ebc2de..706ed2a 100644 --- a/linden/indra/llui/llclipboard.h +++ b/linden/indra/llui/llclipboard.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp index 9a2e13b..3aec2ee 100644 --- a/linden/indra/llui/llcombobox.cpp +++ b/linden/indra/llui/llcombobox.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llcombobox.h b/linden/indra/llui/llcombobox.h index f4cf0fb..efcb798 100644 --- a/linden/indra/llui/llcombobox.h +++ b/linden/indra/llui/llcombobox.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llctrlselectioninterface.cpp b/linden/indra/llui/llctrlselectioninterface.cpp index 3ef0f83..282f43c 100644 --- a/linden/indra/llui/llctrlselectioninterface.cpp +++ b/linden/indra/llui/llctrlselectioninterface.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llctrlselectioninterface.h b/linden/indra/llui/llctrlselectioninterface.h index 67743de..6f5f5c8 100644 --- a/linden/indra/llui/llctrlselectioninterface.h +++ b/linden/indra/llui/llctrlselectioninterface.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lldraghandle.cpp b/linden/indra/llui/lldraghandle.cpp index bec2da5..c76bdfb 100644 --- a/linden/indra/llui/lldraghandle.cpp +++ b/linden/indra/llui/lldraghandle.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lldraghandle.h b/linden/indra/llui/lldraghandle.h index 6882c7f..35408da 100644 --- a/linden/indra/llui/lldraghandle.h +++ b/linden/indra/llui/lldraghandle.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lleditmenuhandler.cpp b/linden/indra/llui/lleditmenuhandler.cpp index 2f29f71..d6f04f2 100644 --- a/linden/indra/llui/lleditmenuhandler.cpp +++ b/linden/indra/llui/lleditmenuhandler.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * -* Copyright (c) 2006-2008, Linden Research, Inc. +* Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lleditmenuhandler.h b/linden/indra/llui/lleditmenuhandler.h index 82bb058..c0c6d7b 100644 --- a/linden/indra/llui/lleditmenuhandler.h +++ b/linden/indra/llui/lleditmenuhandler.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * -* Copyright (c) 2006-2008, Linden Research, Inc. +* Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index de4f6ce..2924c29 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h index 267707f..a6fe3cc 100644 --- a/linden/indra/llui/llfloater.h +++ b/linden/indra/llui/llfloater.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llfocusmgr.cpp b/linden/indra/llui/llfocusmgr.cpp index 517e148..69010cd 100644 --- a/linden/indra/llui/llfocusmgr.cpp +++ b/linden/indra/llui/llfocusmgr.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llfocusmgr.h b/linden/indra/llui/llfocusmgr.h index e1b3d88..61daca7 100644 --- a/linden/indra/llui/llfocusmgr.h +++ b/linden/indra/llui/llfocusmgr.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llhtmlhelp.h b/linden/indra/llui/llhtmlhelp.h index 254faa2..3383148 100644 --- a/linden/indra/llui/llhtmlhelp.h +++ b/linden/indra/llui/llhtmlhelp.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lliconctrl.cpp b/linden/indra/llui/lliconctrl.cpp index 6d1a678..71c2315 100644 --- a/linden/indra/llui/lliconctrl.cpp +++ b/linden/indra/llui/lliconctrl.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lliconctrl.h b/linden/indra/llui/lliconctrl.h index 5cb8e98..a8a265d 100644 --- a/linden/indra/llui/lliconctrl.h +++ b/linden/indra/llui/lliconctrl.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llkeywords.cpp b/linden/indra/llui/llkeywords.cpp index 35f032a..53df1c1 100644 --- a/linden/indra/llui/llkeywords.cpp +++ b/linden/indra/llui/llkeywords.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2000&license=viewergpl$ * - * Copyright (c) 2000-2008, Linden Research, Inc. + * Copyright (c) 2000-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llkeywords.h b/linden/indra/llui/llkeywords.h index e3361f6..1ae0b3c 100644 --- a/linden/indra/llui/llkeywords.h +++ b/linden/indra/llui/llkeywords.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index a0af463..64b1284 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index bc9e406..52cbfcf 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h @@ -13,7 +13,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llmemberlistener.h b/linden/indra/llui/llmemberlistener.h index a81f767..3b702ed 100644 --- a/linden/indra/llui/llmemberlistener.h +++ b/linden/indra/llui/llmemberlistener.h @@ -30,7 +30,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp index 4766267..907777d 100644 --- a/linden/indra/llui/llmenugl.cpp +++ b/linden/indra/llui/llmenugl.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -1033,30 +1033,47 @@ void LLMenuItemToggleGL::doIt( void ) } -LLMenuItemBranchGL::LLMenuItemBranchGL( const std::string& name, const std::string& label, LLMenuGL* branch, +LLMenuItemBranchGL::LLMenuItemBranchGL( const std::string& name, const std::string& label, LLHandle branch, KEY key, MASK mask ) : LLMenuItemGL( name, label, key, mask ), mBranch( branch ) { - mBranch->setVisible( FALSE ); - mBranch->setParentMenuItem(this); + if(!dynamic_cast(branch.get())) + { + llerrs << "Non-menu handle passed as branch reference." << llendl; + } + + if(getBranch()) + { + getBranch()->setVisible( FALSE ); + getBranch()->setParentMenuItem(this); + } +} + +LLMenuItemBranchGL::~LLMenuItemBranchGL() +{ + LLView::deleteViewByHandle(mBranch); } // virtual LLView* LLMenuItemBranchGL::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const { // richard: this is redundant with parent, remove - if (mBranch->getName() == name) - { - return mBranch; - } - // Always recurse on branches - LLView* child = mBranch->getChildView(name, recurse, FALSE); - if (!child) + if (getBranch()) { - child = LLView::getChildView(name, recurse, create_if_missing); + if(getBranch()->getName() == name) + { + return getBranch(); + } + + // Always recurse on branches + LLView* child = getBranch()->getChildView(name, recurse, FALSE); + if(child) + { + return child; + } } - return child; + return LLView::getChildView(name, recurse, create_if_missing);; } // virtual @@ -1072,15 +1089,19 @@ BOOL LLMenuItemBranchGL::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLMenuItemBranchGL::handleAcceleratorKey(KEY key, MASK mask) { - return mBranch->handleAcceleratorKey(key, mask); + if(getBranch()) + { + return getBranch()->handleAcceleratorKey(key, mask); + } + return FALSE; } // virtual LLXMLNodePtr LLMenuItemBranchGL::getXML(bool save_children) const { - if (mBranch) + if (getBranch()) { - return mBranch->getXML(); + return getBranch()->getXML(); } return LLMenuItemGL::getXML(); @@ -1091,14 +1112,17 @@ LLXMLNodePtr LLMenuItemBranchGL::getXML(bool save_children) const // if not, it will be added to the list BOOL LLMenuItemBranchGL::addToAcceleratorList(std::list *listp) { - U32 item_count = mBranch->getItemCount(); - LLMenuItemGL *item; - - while (item_count--) + if(getBranch()) { - if ((item = mBranch->getItem(item_count))) + U32 item_count = getBranch()->getItemCount(); + LLMenuItemGL *item; + + while (item_count--) { - return item->addToAcceleratorList(listp); + if ((item = getBranch()->getItem(item_count))) + { + return item->addToAcceleratorList(listp); + } } } return FALSE; @@ -1122,18 +1146,18 @@ void LLMenuItemBranchGL::doIt( void ) // keyboard navigation automatically propagates highlight to sub-menu // to facilitate fast menu control via jump keys - if (LLMenuGL::getKeyboardMode() && !mBranch->getHighlightedItem()) + if (getBranch() && LLMenuGL::getKeyboardMode() && !getBranch()->getHighlightedItem()) { - mBranch->highlightNextItem(NULL); + getBranch()->highlightNextItem(NULL); } } BOOL LLMenuItemBranchGL::handleKey(KEY key, MASK mask, BOOL called_from_parent) { BOOL handled = FALSE; - if (called_from_parent) + if (called_from_parent && getBranch()) { - handled = mBranch->handleKey(key, mask, called_from_parent); + handled = getBranch()->handleKey(key, mask, called_from_parent); } if (!handled) @@ -1147,9 +1171,9 @@ BOOL LLMenuItemBranchGL::handleKey(KEY key, MASK mask, BOOL called_from_parent) BOOL LLMenuItemBranchGL::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) { BOOL handled = FALSE; - if (called_from_parent) + if (called_from_parent && getBranch()) { - handled = mBranch->handleUnicodeChar(uni_char, TRUE); + handled = getBranch()->handleUnicodeChar(uni_char, TRUE); } if (!handled) @@ -1165,14 +1189,19 @@ void LLMenuItemBranchGL::setHighlight( BOOL highlight ) { if (highlight == getHighlight()) return; - BOOL auto_open = getEnabled() && (!mBranch->getVisible() || mBranch->getTornOff()); + if(!getBranch()) + { + return; + } + + BOOL auto_open = getEnabled() && (!getBranch()->getVisible() || getBranch()->getTornOff()); // torn off menus don't open sub menus on hover unless they have focus if (getMenu()->getTornOff() && !((LLFloater*)getMenu()->getParent())->hasFocus()) { auto_open = FALSE; } // don't auto open torn off sub-menus (need to explicitly active menu item to give them focus) - if (mBranch->getTornOff()) + if (getBranch()->getTornOff()) { auto_open = FALSE; } @@ -1186,14 +1215,14 @@ void LLMenuItemBranchGL::setHighlight( BOOL highlight ) } else { - if (mBranch->getTornOff()) + if (getBranch()->getTornOff()) { - ((LLFloater*)mBranch->getParent())->setFocus(FALSE); - mBranch->clearHoverItem(); + ((LLFloater*)getBranch()->getParent())->setFocus(FALSE); + getBranch()->clearHoverItem(); } else { - mBranch->setVisible( FALSE ); + getBranch()->setVisible( FALSE ); } } } @@ -1201,7 +1230,7 @@ void LLMenuItemBranchGL::setHighlight( BOOL highlight ) void LLMenuItemBranchGL::draw() { LLMenuItemGL::draw(); - if (mBranch->getVisible() && !mBranch->getTornOff()) + if (getBranch() && getBranch()->getVisible() && !getBranch()->getTornOff()) { setHighlight(TRUE); } @@ -1209,33 +1238,33 @@ void LLMenuItemBranchGL::draw() void LLMenuItemBranchGL::updateBranchParent(LLView* parentp) { - if (mBranch->getParent() == NULL) + if (getBranch() && getBranch()->getParent() == NULL) { // make the branch menu a sibling of my parent menu - mBranch->updateParent(parentp); + getBranch()->updateParent(parentp); } } void LLMenuItemBranchGL::onVisibilityChange( BOOL new_visibility ) { - if (new_visibility == FALSE && !mBranch->getTornOff()) + if (new_visibility == FALSE && getBranch() && !getBranch()->getTornOff()) { - mBranch->setVisible(FALSE); + getBranch()->setVisible(FALSE); } LLMenuItemGL::onVisibilityChange(new_visibility); } BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) { - if (getMenu()->getVisible() && mBranch->getVisible() && key == KEY_LEFT) + if (getMenu()->getVisible() && getBranch() && getBranch()->getVisible() && key == KEY_LEFT) { // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - BOOL handled = mBranch->clearHoverItem(); - if (mBranch->getTornOff()) + BOOL handled = getBranch()->clearHoverItem(); + if (getBranch()->getTornOff()) { - ((LLFloater*)mBranch->getParent())->setFocus(FALSE); + ((LLFloater*)getBranch()->getParent())->setFocus(FALSE); } if (handled && getMenu()->getTornOff()) { @@ -1246,12 +1275,12 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) if (getHighlight() && getMenu()->isOpen() && - key == KEY_RIGHT && !mBranch->getHighlightedItem()) + key == KEY_RIGHT && getBranch() && !getBranch()->getHighlightedItem()) { // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - LLMenuItemGL* itemp = mBranch->highlightNextItem(NULL); + LLMenuItemGL* itemp = getBranch()->highlightNextItem(NULL); if (itemp) { return TRUE; @@ -1263,37 +1292,39 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) void LLMenuItemBranchGL::openMenu() { - if (mBranch->getTornOff()) + if(!getBranch()) return; + + if (getBranch()->getTornOff()) { - gFloaterView->bringToFront((LLFloater*)mBranch->getParent()); + gFloaterView->bringToFront((LLFloater*)getBranch()->getParent()); // this might not be necessary, as torn off branches don't get focus and hence no highligth - mBranch->highlightNextItem(NULL); + getBranch()->highlightNextItem(NULL); } - else if( !mBranch->getVisible() ) + else if( !getBranch()->getVisible() ) { // get valid rectangle for menus const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect(); - mBranch->arrange(); + getBranch()->arrange(); - LLRect rect = mBranch->getRect(); + LLRect rect = getBranch()->getRect(); // calculate root-view relative position for branch menu S32 left = getRect().mRight; S32 top = getRect().mTop - getRect().mBottom; - localPointToOtherView(left, top, &left, &top, mBranch->getParent()); + localPointToOtherView(left, top, &left, &top, getBranch()->getParent()); rect.setLeftTopAndSize( left, top, rect.getWidth(), rect.getHeight() ); - if (mBranch->getCanTearOff()) + if (getBranch()->getCanTearOff()) { rect.translate(0, TEAROFF_SEPARATOR_HEIGHT_PIXELS); } - mBranch->setRect( rect ); + getBranch()->setRect( rect ); S32 x = 0; S32 y = 0; - mBranch->localPointToOtherView( 0, 0, &x, &y, mBranch->getParent() ); + getBranch()->localPointToOtherView( 0, 0, &x, &y, getBranch()->getParent() ); S32 delta_x = 0; S32 delta_y = 0; if( y < menu_region_rect.mBottom ) @@ -1307,9 +1338,9 @@ void LLMenuItemBranchGL::openMenu() // move sub-menu over to left side delta_x = llmax(-x, (-1 * (rect.getWidth() + getRect().getWidth()))); } - mBranch->translate( delta_x, delta_y ); - mBranch->setVisible( TRUE ); - mBranch->getParent()->sendChildToFront(mBranch); + getBranch()->translate( delta_x, delta_y ); + getBranch()->setVisible( TRUE ); + getBranch()->getParent()->sendChildToFront(getBranch()); } } @@ -1326,7 +1357,7 @@ class LLMenuItemBranchDownGL : public LLMenuItemBranchGL protected: public: - LLMenuItemBranchDownGL( const std::string& name, const std::string& label, LLMenuGL* branch, + LLMenuItemBranchDownGL( const std::string& name, const std::string& label, LLHandle branch, KEY key = KEY_NONE, MASK mask = MASK_NONE ); virtual std::string getType() const { return "menu"; } @@ -1359,7 +1390,7 @@ public: LLMenuItemBranchDownGL::LLMenuItemBranchDownGL( const std::string& name, const std::string& label, - LLMenuGL* branch, + LLHandle branch, KEY key, MASK mask ) : LLMenuItemBranchGL( name, label, branch, key, mask ) { @@ -2257,7 +2288,7 @@ void LLMenuGL::createSpilloverBranch() mSpilloverMenu->setBackgroundColor( mBackgroundColor ); mSpilloverMenu->setCanTearOff(FALSE); - mSpilloverBranch = new LLMenuItemBranchGL(std::string("More"), std::string("More"), mSpilloverMenu); + mSpilloverBranch = new LLMenuItemBranchGL(std::string("More"), std::string("More"), mSpilloverMenu->getHandle()); mSpilloverBranch->setFontStyle(LLFontGL::ITALIC); } } @@ -2277,9 +2308,6 @@ void LLMenuGL::cleanupSpilloverBranch() mItems.erase(found_iter); } - delete mSpilloverBranch; - mSpilloverBranch = NULL; - // pop off spillover items while (mSpilloverMenu->getItemCount()) { @@ -2290,6 +2318,12 @@ void LLMenuGL::cleanupSpilloverBranch() mItems.push_back(itemp); addChild(itemp); } + + // Delete the branch, and since the branch will delete the menu, + // set the menu* to null. + delete mSpilloverBranch; + mSpilloverBranch = NULL; + mSpilloverMenu = NULL; } } @@ -2462,7 +2496,7 @@ BOOL LLMenuGL::appendMenu( LLMenuGL* menu ) BOOL success = TRUE; LLMenuItemBranchGL* branch = NULL; - branch = new LLMenuItemBranchGL( menu->getName(), menu->getLabel(), menu ); + branch = new LLMenuItemBranchGL( menu->getName(), menu->getLabel(), menu->getHandle() ); branch->setJumpKey(menu->getJumpKey()); success &= append( branch ); @@ -4071,7 +4105,7 @@ BOOL LLMenuBarGL::appendMenu( LLMenuGL* menu ) BOOL success = TRUE; LLMenuItemBranchGL* branch = NULL; - branch = new LLMenuItemBranchDownGL( menu->getName(), menu->getLabel(), menu ); + branch = new LLMenuItemBranchDownGL( menu->getName(), menu->getLabel(), menu->getHandle()); success &= branch->addToAcceleratorList(&mAccelerators); success &= append( branch ); branch->setJumpKey(branch->getJumpKey()); diff --git a/linden/indra/llui/llmenugl.h b/linden/indra/llui/llmenugl.h index 8561f1b..d981e78 100644 --- a/linden/indra/llui/llmenugl.h +++ b/linden/indra/llui/llmenugl.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -89,6 +89,7 @@ public: static const LLColor4& getHighlightFGColor() { return sHighlightForeground; } LLMenuItemGL( const std::string& name, const std::string& label, KEY key = KEY_NONE, MASK = MASK_NONE ); + virtual ~LLMenuItemGL() {}; virtual void setValue(const LLSD& value) { setLabel(value.asString()); } @@ -561,8 +562,11 @@ private: class LLMenuItemBranchGL : public LLMenuItemGL { public: - LLMenuItemBranchGL( const std::string& name, const std::string& label, LLMenuGL* branch, + LLMenuItemBranchGL( const std::string& name, const std::string& label, LLHandle branch, KEY key = KEY_NONE, MASK mask = MASK_NONE ); + + virtual ~LLMenuItemBranchGL(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; virtual std::string getType() const { return "menu"; } @@ -589,11 +593,11 @@ public: virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL isActive() const { return isOpen() && mBranch->getHighlightedItem(); } + virtual BOOL isActive() const { return isOpen() && getBranch()->getHighlightedItem(); } - virtual BOOL isOpen() const { return mBranch->isOpen(); } + virtual BOOL isOpen() const { return getBranch() && getBranch()->isOpen(); } - LLMenuGL *getBranch() const { return mBranch; } + LLMenuGL *getBranch() const { return (LLMenuGL*)(mBranch.get()); } virtual void updateBranchParent( LLView* parentp ); @@ -602,14 +606,14 @@ public: virtual void draw(); - virtual void setEnabledSubMenus(BOOL enabled) { mBranch->setEnabledSubMenus(enabled); } + virtual void setEnabledSubMenus(BOOL enabled) { if(getBranch()) getBranch()->setEnabledSubMenus(enabled); } virtual void openMenu(); virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; private: - LLMenuGL* mBranch; + LLHandle mBranch; }; // end class LLMenuItemBranchGL diff --git a/linden/indra/llui/llmodaldialog.cpp b/linden/indra/llui/llmodaldialog.cpp index 1b05b0e..682cc08 100644 --- a/linden/indra/llui/llmodaldialog.cpp +++ b/linden/indra/llui/llmodaldialog.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llmodaldialog.h b/linden/indra/llui/llmodaldialog.h index d38b7a6..5bb1a74 100644 --- a/linden/indra/llui/llmodaldialog.h +++ b/linden/indra/llui/llmodaldialog.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llmultislider.cpp b/linden/indra/llui/llmultislider.cpp index 11c2cba..415e96b 100644 --- a/linden/indra/llui/llmultislider.cpp +++ b/linden/indra/llui/llmultislider.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2007&license=viewergpl$ * - * Copyright (c) 2007-2008, Linden Research, Inc. + * Copyright (c) 2007-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llmultislider.h b/linden/indra/llui/llmultislider.h index 001ed26..08cfa78 100644 --- a/linden/indra/llui/llmultislider.h +++ b/linden/indra/llui/llmultislider.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2007&license=viewergpl$ * - * Copyright (c) 2007-2008, Linden Research, Inc. + * Copyright (c) 2007-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llmultisliderctrl.cpp b/linden/indra/llui/llmultisliderctrl.cpp index 673887b..53c0799 100644 --- a/linden/indra/llui/llmultisliderctrl.cpp +++ b/linden/indra/llui/llmultisliderctrl.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2007&license=viewergpl$ * - * Copyright (c) 2007-2008, Linden Research, Inc. + * Copyright (c) 2007-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llmultisliderctrl.h b/linden/indra/llui/llmultisliderctrl.h index 1f41d81..4145d70 100644 --- a/linden/indra/llui/llmultisliderctrl.h +++ b/linden/indra/llui/llmultisliderctrl.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2007&license=viewergpl$ * - * Copyright (c) 2007-2008, Linden Research, Inc. + * Copyright (c) 2007-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp index 0389590..d37517f 100644 --- a/linden/indra/llui/llpanel.cpp +++ b/linden/indra/llui/llpanel.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h index 8ed739e..46022e5 100644 --- a/linden/indra/llui/llpanel.h +++ b/linden/indra/llui/llpanel.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llradiogroup.cpp b/linden/indra/llui/llradiogroup.cpp index e518069..f6778f3 100644 --- a/linden/indra/llui/llradiogroup.cpp +++ b/linden/indra/llui/llradiogroup.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llradiogroup.h b/linden/indra/llui/llradiogroup.h index c8b96db..06729bc 100644 --- a/linden/indra/llui/llradiogroup.h +++ b/linden/indra/llui/llradiogroup.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llresizebar.cpp b/linden/indra/llui/llresizebar.cpp index d8a7b92..0ba02fa 100644 --- a/linden/indra/llui/llresizebar.cpp +++ b/linden/indra/llui/llresizebar.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llresizebar.h b/linden/indra/llui/llresizebar.h index 70dc7eb..b8494b0 100644 --- a/linden/indra/llui/llresizebar.h +++ b/linden/indra/llui/llresizebar.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llresizehandle.cpp b/linden/indra/llui/llresizehandle.cpp index 340dff5..3202ffe 100644 --- a/linden/indra/llui/llresizehandle.cpp +++ b/linden/indra/llui/llresizehandle.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llresizehandle.h b/linden/indra/llui/llresizehandle.h index 46d3827..32d382a 100644 --- a/linden/indra/llui/llresizehandle.h +++ b/linden/indra/llui/llresizehandle.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llresmgr.cpp b/linden/indra/llui/llresmgr.cpp index bd05d43..d111bd6 100644 --- a/linden/indra/llui/llresmgr.cpp +++ b/linden/indra/llui/llresmgr.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llresmgr.h b/linden/indra/llui/llresmgr.h index d7bc86c..86bb6dd 100644 --- a/linden/indra/llui/llresmgr.h +++ b/linden/indra/llui/llresmgr.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llrootview.cpp b/linden/indra/llui/llrootview.cpp index fa7c730..de1f90b 100644 --- a/linden/indra/llui/llrootview.cpp +++ b/linden/indra/llui/llrootview.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llrootview.h b/linden/indra/llui/llrootview.h index 9936f2d..4aa4467 100644 --- a/linden/indra/llui/llrootview.h +++ b/linden/indra/llui/llrootview.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llscrollbar.cpp b/linden/indra/llui/llscrollbar.cpp index b011325..1b87c69 100644 --- a/linden/indra/llui/llscrollbar.cpp +++ b/linden/indra/llui/llscrollbar.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llscrollbar.h b/linden/indra/llui/llscrollbar.h index cb0ad97..0703263 100644 --- a/linden/indra/llui/llscrollbar.h +++ b/linden/indra/llui/llscrollbar.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llscrollcontainer.cpp b/linden/indra/llui/llscrollcontainer.cpp index 51face6..f7c4200 100644 --- a/linden/indra/llui/llscrollcontainer.cpp +++ b/linden/indra/llui/llscrollcontainer.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llscrollcontainer.h b/linden/indra/llui/llscrollcontainer.h index 3e42dd4..80e67d2 100644 --- a/linden/indra/llui/llscrollcontainer.h +++ b/linden/indra/llui/llscrollcontainer.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llscrollingpanellist.cpp b/linden/indra/llui/llscrollingpanellist.cpp index cc4b8f4..0cd501c 100644 --- a/linden/indra/llui/llscrollingpanellist.cpp +++ b/linden/indra/llui/llscrollingpanellist.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llscrollingpanellist.h b/linden/indra/llui/llscrollingpanellist.h index 2b8072d..c96f12c 100644 --- a/linden/indra/llui/llscrollingpanellist.h +++ b/linden/indra/llui/llscrollingpanellist.h @@ -3,7 +3,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp index 92bcb88..7dba55f 100644 --- a/linden/indra/llui/llscrolllistctrl.cpp +++ b/linden/indra/llui/llscrolllistctrl.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llscrolllistctrl.h b/linden/indra/llui/llscrolllistctrl.h index 12b8e2c..f276562 100644 --- a/linden/indra/llui/llscrolllistctrl.h +++ b/linden/indra/llui/llscrolllistctrl.h @@ -3,7 +3,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llslider.cpp b/linden/indra/llui/llslider.cpp index b2438af..51b96c1 100644 --- a/linden/indra/llui/llslider.cpp +++ b/linden/indra/llui/llslider.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llslider.h b/linden/indra/llui/llslider.h index b963beb..94f5992 100644 --- a/linden/indra/llui/llslider.h +++ b/linden/indra/llui/llslider.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llsliderctrl.cpp b/linden/indra/llui/llsliderctrl.cpp index a47f133..477003b 100644 --- a/linden/indra/llui/llsliderctrl.cpp +++ b/linden/indra/llui/llsliderctrl.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llsliderctrl.h b/linden/indra/llui/llsliderctrl.h index 7df255c..56f4661 100644 --- a/linden/indra/llui/llsliderctrl.h +++ b/linden/indra/llui/llsliderctrl.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llspinctrl.cpp b/linden/indra/llui/llspinctrl.cpp index a106af4..e1b47eb 100644 --- a/linden/indra/llui/llspinctrl.cpp +++ b/linden/indra/llui/llspinctrl.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llspinctrl.h b/linden/indra/llui/llspinctrl.h index 0cc6661..1a96767 100644 --- a/linden/indra/llui/llspinctrl.h +++ b/linden/indra/llui/llspinctrl.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llstyle.cpp b/linden/indra/llui/llstyle.cpp index 6130416..fc6c14e 100644 --- a/linden/indra/llui/llstyle.cpp +++ b/linden/indra/llui/llstyle.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llstyle.h b/linden/indra/llui/llstyle.h index d235e15..8dc1a40 100644 --- a/linden/indra/llui/llstyle.h +++ b/linden/indra/llui/llstyle.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lltabcontainer.cpp b/linden/indra/llui/lltabcontainer.cpp index 7bf1485..6b028d4 100644 --- a/linden/indra/llui/lltabcontainer.cpp +++ b/linden/indra/llui/lltabcontainer.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lltabcontainer.h b/linden/indra/llui/lltabcontainer.h index 8d4218a..96400f0 100644 --- a/linden/indra/llui/lltabcontainer.h +++ b/linden/indra/llui/lltabcontainer.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lltabcontainervertical.cpp b/linden/indra/llui/lltabcontainervertical.cpp index b4b2710..fa24ed1 100644 --- a/linden/indra/llui/lltabcontainervertical.cpp +++ b/linden/indra/llui/lltabcontainervertical.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lltabcontainervertical.h b/linden/indra/llui/lltabcontainervertical.h index ffe65be..d01d20a 100644 --- a/linden/indra/llui/lltabcontainervertical.h +++ b/linden/indra/llui/lltabcontainervertical.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lltextbox.cpp b/linden/indra/llui/lltextbox.cpp index 6997c61..f43b7d2 100644 --- a/linden/indra/llui/lltextbox.cpp +++ b/linden/indra/llui/lltextbox.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lltextbox.h b/linden/indra/llui/lltextbox.h index c2211fb..83e4a9b 100644 --- a/linden/indra/llui/lltextbox.h +++ b/linden/indra/llui/lltextbox.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 2205005..a40fec8 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h index 3604cf6..61341e2 100644 --- a/linden/indra/llui/lltexteditor.h +++ b/linden/indra/llui/lltexteditor.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 4817d78..f3e73fd 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llui.h b/linden/indra/llui/llui.h index 0f498d3..1e731f1 100644 --- a/linden/indra/llui/llui.h +++ b/linden/indra/llui/llui.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluiconstants.h b/linden/indra/llui/lluiconstants.h index b3b9297..14e7a81 100644 --- a/linden/indra/llui/lluiconstants.h +++ b/linden/indra/llui/lluiconstants.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluictrl.cpp b/linden/indra/llui/lluictrl.cpp index ddafa74..b2c14df 100644 --- a/linden/indra/llui/lluictrl.cpp +++ b/linden/indra/llui/lluictrl.cpp @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluictrl.h b/linden/indra/llui/lluictrl.h index b63f79b..f11ece7 100644 --- a/linden/indra/llui/lluictrl.h +++ b/linden/indra/llui/lluictrl.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp index db52261..07de717 100644 --- a/linden/indra/llui/lluictrlfactory.cpp +++ b/linden/indra/llui/lluictrlfactory.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2003&license=viewergpl$ * - * Copyright (c) 2003-2008, Linden Research, Inc. + * Copyright (c) 2003-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluictrlfactory.h b/linden/indra/llui/lluictrlfactory.h index 559c8e5..b5b2853 100644 --- a/linden/indra/llui/lluictrlfactory.h +++ b/linden/indra/llui/lluictrlfactory.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2003&license=viewergpl$ * - * Copyright (c) 2003-2008, Linden Research, Inc. + * Copyright (c) 2003-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluifwd.h b/linden/indra/llui/lluifwd.h index 758a0e4..ab8eb63 100644 --- a/linden/indra/llui/lluifwd.h +++ b/linden/indra/llui/lluifwd.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2007&license=viewergpl$ * - * Copyright (c) 2007-2008, Linden Research, Inc. + * Copyright (c) 2007-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluistring.cpp b/linden/indra/llui/lluistring.cpp index 52b83bd..974047f 100644 --- a/linden/indra/llui/lluistring.cpp +++ b/linden/indra/llui/lluistring.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluistring.h b/linden/indra/llui/lluistring.h index b6c715f..5983e1d 100644 --- a/linden/indra/llui/lluistring.h +++ b/linden/indra/llui/lluistring.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/lluixmltags.h b/linden/indra/llui/lluixmltags.h index 5209199..da31136 100644 --- a/linden/indra/llui/lluixmltags.h +++ b/linden/indra/llui/lluixmltags.h @@ -3,7 +3,7 @@ * * $LicenseInfo:firstyear=2006&license=viewergpl$ * - * Copyright (c) 2006-2008, Linden Research, Inc. + * Copyright (c) 2006-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llundo.cpp b/linden/indra/llui/llundo.cpp index 4fdf9d3..05c8c11 100644 --- a/linden/indra/llui/llundo.cpp +++ b/linden/indra/llui/llundo.cpp @@ -3,7 +3,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llundo.h b/linden/indra/llui/llundo.h index 6921259..55d164e 100644 --- a/linden/indra/llui/llundo.h +++ b/linden/indra/llui/llundo.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2000&license=viewergpl$ * - * Copyright (c) 2000-2008, Linden Research, Inc. + * Copyright (c) 2000-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index 910b4f5..9cdf481 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h index b65edd7..80dd348 100644 --- a/linden/indra/llui/llview.h +++ b/linden/indra/llui/llview.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llviewborder.cpp b/linden/indra/llui/llviewborder.cpp index a1c26d6..ae24694 100644 --- a/linden/indra/llui/llviewborder.cpp +++ b/linden/indra/llui/llviewborder.cpp @@ -3,7 +3,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llviewborder.h b/linden/indra/llui/llviewborder.h index 2297491..7f72d54 100644 --- a/linden/indra/llui/llviewborder.h +++ b/linden/indra/llui/llviewborder.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llviewquery.cpp b/linden/indra/llui/llviewquery.cpp index b84fba5..fe3c308 100644 --- a/linden/indra/llui/llviewquery.cpp +++ b/linden/indra/llui/llviewquery.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llui/llviewquery.h b/linden/indra/llui/llviewquery.h index c76ed25..a8cec09 100644 --- a/linden/indra/llui/llviewquery.h +++ b/linden/indra/llui/llviewquery.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab -- cgit v1.1 From 9f2aee65453981b37b7108ba3acdd86f0354defa Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 15 Mar 2009 14:23:39 -0500 Subject: Second Life viewer sources 1.22.11 --- linden/indra/llui/lltexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra/llui') diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index a40fec8..62064d9 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -1009,7 +1009,7 @@ void LLTextEditor::indentSelectedLines( S32 spaces ) } else { - while( (text[right] != '\n') && (right <= getLength() ) ) + while( right < getLength() && (text[right] != '\n') ) { right++; } -- cgit v1.1