diff options
author | Don Kjer <don@lindenlab.com> | 2007-11-09 01:56:15 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-11-09 01:56:15 +0000 |
commit | c1920e3c1c60fb792cf091750b05de618b355878 (patch) | |
tree | 204b78e0f0b87fb2875b90af0f579d53e3138cbb /indra/llui | |
parent | 760f2ceb1518d87e865f25ac87a540625e974517 (diff) |
EFFECTIVE MERGE: svn merge -r 70833:71458 svn+ssh://svn/svn/linden/branches/maintenance-2 into release
ACTUAL MERGE: svn merge -r 73210:73222 svn+ssh://svn/svn/linden/qa/maintenance-2-merge-73206 into release
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfloater.cpp | 6 | ||||
-rw-r--r-- | indra/llui/lllineeditor.cpp | 10 | ||||
-rw-r--r-- | indra/llui/lllineeditor.h | 2 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 19 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.h | 1 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 10 | ||||
-rw-r--r-- | indra/llui/lltexteditor.h | 2 |
7 files changed, 22 insertions, 28 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 41a67f22fc..6f1c281eb2 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2220,7 +2220,6 @@ BOOL LLFloaterView::allChildrenClosed() { // see if there are any visible floaters (some floaters "close" // by setting themselves invisible) - S32 visible_count = 0; for (child_list_const_iter_t it = getChildList()->begin(); it != getChildList()->end(); ++it) { LLView* viewp = *it; @@ -2228,11 +2227,10 @@ BOOL LLFloaterView::allChildrenClosed() if (floaterp->getVisible() && floaterp->canClose()) { - visible_count++; + return false; } } - - return (visible_count == 0); + return true; } diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index ecdcbc370d..0a63ebbe74 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -158,8 +158,7 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, mHandleEditKeysDirectly( FALSE ), mSelectAllonFocusReceived( FALSE ), mPassDelete(FALSE), - mReadOnly(FALSE), - mLastIMEPosition( -1, -1 ) + mReadOnly(FALSE) { llassert( max_length_bytes > 0 ); @@ -1638,12 +1637,7 @@ void LLLineEditor::draw() S32 pixels_after_scroll = findPixelNearestPos(); // RCalculcate for IME position LLRect screen_pos = getScreenRect(); LLCoordGL ime_pos( screen_pos.mLeft + pixels_after_scroll, screen_pos.mTop - UI_LINEEDITOR_V_PAD ); - if ( ime_pos.mX != mLastIMEPosition.mX || ime_pos.mY != mLastIMEPosition.mY ) - { - mLastIMEPosition.mX = ime_pos.mX; - mLastIMEPosition.mY = ime_pos.mY; - getWindow()->setLanguageTextInput( ime_pos ); - } + getWindow()->setLanguageTextInput( ime_pos ); } } diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 2cd2ebf9fe..f1b9fbe33e 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -279,8 +279,6 @@ protected: S32 mBorderThickness; - LLCoordGL mLastIMEPosition; // Last screen position used for the IME editor - BOOL mIgnoreArrowKeys; BOOL mIgnoreTab; BOOL mDrawAsterixes; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index f5eef29dcb..96a739418f 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -701,7 +701,7 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos ) break; } - updateLineHeight(); + updateLineHeightInsert(item); mPageLines = mLineHeight ? mItemListRect.getHeight() / mLineHeight : 0; BOOL scrollbar_visible = mPageLines < getItemCount(); @@ -753,12 +753,11 @@ void LLScrollListCtrl::updateMaxContentWidth(LLScrollListItem* added_item) } } +const S32 SCROLL_LIST_ROW_PAD = 2; // Line height is the max height of all the cells in all the items. void LLScrollListCtrl::updateLineHeight() { - const S32 ROW_PAD = 2; - mLineHeight = 0; item_list::iterator iter; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -768,11 +767,23 @@ void LLScrollListCtrl::updateLineHeight() S32 i = 0; for (const LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i)) { - mLineHeight = llmax( mLineHeight, cell->getHeight() + ROW_PAD ); + mLineHeight = llmax( mLineHeight, cell->getHeight() + SCROLL_LIST_ROW_PAD ); } } } +// when the only change to line height is from an insert, we needn't scan the entire list +void LLScrollListCtrl::updateLineHeightInsert(LLScrollListItem* itemp) +{ + S32 num_cols = itemp->getNumColumns(); + S32 i = 0; + for (const LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i)) + { + mLineHeight = llmax( mLineHeight, cell->getHeight() + SCROLL_LIST_ROW_PAD ); + } +} + + void LLScrollListCtrl::updateColumns() { mColumnsIndexed.resize(mColumns.size()); diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 5ceee2e1f6..a98a411efa 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -589,6 +589,7 @@ protected: void selectNextItem(BOOL extend_selection); void drawItems(); void updateLineHeight(); + void updateLineHeightInsert(LLScrollListItem* item); void reportInvalidInput(); BOOL isRepeatedChars(const LLWString& string) const; void selectItem(LLScrollListItem* itemp, BOOL single_select = TRUE); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 0184878e45..af1813a429 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -310,8 +310,7 @@ LLTextEditor::LLTextEditor( mMouseDownX(0), mMouseDownY(0), mLastSelectionX(-1), - mLastSelectionY(-1), - mLastIMEPosition(-1,-1) + mLastSelectionY(-1) { mSourceID.generate(); @@ -2817,12 +2816,7 @@ void LLTextEditor::drawCursor() // Make sure the IME is in the right place LLRect screen_pos = getScreenRect(); LLCoordGL ime_pos( screen_pos.mLeft + llfloor(cursor_left), screen_pos.mBottom + llfloor(cursor_top) ); - if ( ime_pos.mX != mLastIMEPosition.mX || ime_pos.mY != mLastIMEPosition.mY ) - { - mLastIMEPosition.mX = ime_pos.mX; - mLastIMEPosition.mY = ime_pos.mY; - getWindow()->setLanguageTextInput( ime_pos ); - } + getWindow()->setLanguageTextInput( ime_pos ); } } } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 55aba57551..d38accca8f 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -439,8 +439,6 @@ protected: BOOL mParseHTML; LLString mHTML; - - LLCoordGL mLastIMEPosition; // Last position of the IME editor }; class LLTextSegment |