diff options
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llfolderview.cpp | 3 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 29 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.h | 1 | ||||
-rwxr-xr-x | indra/llui/llfolderviewmodel.h | 11 | ||||
-rwxr-xr-x | indra/llui/llkeywords.cpp | 8 | ||||
-rwxr-xr-x | indra/llui/lllineeditor.cpp | 1 | ||||
-rwxr-xr-x | indra/llui/llstatbar.cpp | 2 | ||||
-rwxr-xr-x | indra/llui/llstatgraph.cpp | 3 | ||||
-rwxr-xr-x | indra/llui/lltextbase.cpp | 17 | ||||
-rwxr-xr-x | indra/llui/lltexteditor.cpp | 1 | ||||
-rwxr-xr-x | indra/llui/llui.h | 1 | ||||
-rwxr-xr-x | indra/llui/llurlentry.cpp | 6 | ||||
-rwxr-xr-x | indra/llui/llurlentry.h | 2 | ||||
-rwxr-xr-x | indra/llui/llurlregistry.cpp | 20 | ||||
-rwxr-xr-x | indra/llui/llurlregistry.h | 2 |
15 files changed, 84 insertions, 23 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index cca26f335a..474b545f00 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1371,7 +1371,8 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc } } - const std::string current_item_label(search_item->getViewModelItem()->getSearchableName()); + std::string current_item_label(search_item->getViewModelItem()->getSearchableName()); + LLStringUtil::toUpper(current_item_label); S32 search_string_length = llmin(upper_case_string.size(), current_item_label.size()); if (!current_item_label.compare(0, search_string_length, upper_case_string)) { diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 83254c2840..6dd6f94d02 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -256,6 +256,23 @@ BOOL LLFolderViewItem::passedFilter(S32 filter_generation) return getViewModelItem()->passedFilter(filter_generation); } +BOOL LLFolderViewItem::isPotentiallyVisible(S32 filter_generation) +{ + if (filter_generation < 0) + { + filter_generation = getFolderViewModel()->getFilter().getFirstSuccessGeneration(); + } + LLFolderViewModelItem* model = getViewModelItem(); + BOOL visible = model->passedFilter(filter_generation); + if (model->getMarkedDirtyGeneration() >= filter_generation) + { + // unsure visibility state + // retaining previous visibility until item is updated or filter generation changes + visible |= getVisible(); + } + return visible; +} + void LLFolderViewItem::refresh() { LLFolderViewModelItem& vmi = *getViewModelItem(); @@ -655,7 +672,7 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L // const S32 TOP_PAD = default_params.item_top_pad; - if (hasVisibleChildren() || getViewModelItem()->hasChildren()) + if (hasVisibleChildren()) { LLUIImage* arrow_image = default_params.folder_arrow_image; gl_draw_scaled_rotated_image( @@ -968,7 +985,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) getRoot()->getFolderViewModel()->sort(this); LL_RECORD_BLOCK_TIME(FTM_ARRANGE); - + // evaluate mHasVisibleChildren mHasVisibleChildren = false; if (getViewModelItem()->descendantsPassedFilter()) @@ -979,7 +996,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) for (items_t::iterator iit = mItems.begin(); iit != mItems.end(); ++iit) { LLFolderViewItem* itemp = (*iit); - found = itemp->passedFilter(); + found = itemp->isPotentiallyVisible(); if (found) break; } @@ -989,7 +1006,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) for (folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit) { LLFolderViewFolder* folderp = (*fit); - found = folderp->passedFilter(); + found = folderp->isPotentiallyVisible(); if (found) break; } @@ -1022,7 +1039,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) for(folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit) { LLFolderViewFolder* folderp = (*fit); - folderp->setVisible(folderp->passedFilter()); // passed filter or has descendants that passed filter + folderp->setVisible(folderp->isPotentiallyVisible()); if (folderp->getVisible()) { @@ -1041,7 +1058,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) iit != mItems.end(); ++iit) { LLFolderViewItem* itemp = (*iit); - itemp->setVisible(itemp->passedFilter()); + itemp->setVisible(itemp->isPotentiallyVisible()); if (itemp->getVisible()) { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index a9b0201236..0cd20a0f2d 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -254,6 +254,7 @@ public: S32 getIndentation() { return mIndentation; } virtual BOOL passedFilter(S32 filter_generation = -1); + virtual BOOL isPotentiallyVisible(S32 filter_generation = -1); // refresh information from the object being viewed. virtual void refresh(); diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 8d98363c5f..cad3ca9d8d 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -190,6 +190,7 @@ public: virtual std::string::size_type getFilterStringSize() = 0; virtual S32 getLastFilterGeneration() const = 0; + virtual S32 getMarkedDirtyGeneration() const = 0; virtual bool hasChildren() const = 0; virtual void addChild(LLFolderViewModelItem* child) = 0; @@ -230,6 +231,7 @@ public: mFolderViewItem(NULL), mLastFilterGeneration(-1), mLastFolderFilterGeneration(-1), + mMarkedDirtyGeneration(-1), mMostFilteredDescendantGeneration(-1), mParent(NULL), mRootViewModel(root_view_model) @@ -243,8 +245,13 @@ public: S32 getLastFilterGeneration() const { return mLastFilterGeneration; } S32 getLastFolderFilterGeneration() const { return mLastFolderFilterGeneration; } + S32 getMarkedDirtyGeneration() const { return mMarkedDirtyGeneration; } void dirtyFilter() { + if(mMarkedDirtyGeneration < 0) + { + mMarkedDirtyGeneration = mLastFilterGeneration; + } mLastFilterGeneration = -1; mLastFolderFilterGeneration = -1; @@ -303,6 +310,7 @@ public: mLastFilterGeneration = filter_generation; mStringMatchOffsetFilter = string_offset; mStringFilterSize = string_size; + mMarkedDirtyGeneration = -1; } void setPassedFolderFilter(bool passed, S32 filter_generation) @@ -351,7 +359,8 @@ protected: S32 mLastFilterGeneration, mLastFolderFilterGeneration, - mMostFilteredDescendantGeneration; + mMostFilteredDescendantGeneration, + mMarkedDirtyGeneration; child_list_t mChildren; LLFolderViewModelItem* mParent; diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 75773d7dfd..6750ee482a 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -505,7 +505,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW } // Skip white space - while( *cur && isspace(*cur) && (*cur != '\n') ) + while( *cur && iswspace(*cur) && (*cur != '\n') ) { cur++; } @@ -548,7 +548,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW } // Skip white space - while( *cur && isspace(*cur) && (*cur != '\n') ) + while( *cur && iswspace(*cur) && (*cur != '\n') ) { cur++; } @@ -655,10 +655,10 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW // check against words llwchar prev = cur > base ? *(cur-1) : 0; - if( !isalnum( prev ) && (prev != '_') ) + if( !iswalnum( prev ) && (prev != '_') ) { const llwchar* p = cur; - while( isalnum( *p ) || (*p == '_') ) + while( iswalnum( *p ) || (*p == '_') ) { p++; } diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index b09c927782..45f4272aa7 100755 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -254,6 +254,7 @@ void LLLineEditor::onCommit() setControlValue(getValue()); LLUICtrl::onCommit(); + resetDirty(); // Selection on commit needs to be turned off when evaluating maths // expressions, to allow indication of the error position diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 1bd2bc06f4..303417c337 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -638,7 +638,7 @@ void LLStatBar::drawLabelAndValue( F32 value, std::string &label, LLRect &bar_re void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) { - if (mAutoScaleMax || mAutoScaleMin) + if (!llisnan(min) && (mAutoScaleMax || mAutoScaleMin)) { F32 u = LLSmoothInterpolation::getInterpolant(10.f); mFloatingTargetMinBar = llmin(min, lerp(mFloatingTargetMinBar, min, u)); diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index a44bc18733..98962aff9a 100755 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -44,9 +44,10 @@ LLStatGraph::LLStatGraph(const Params& p) : LLView(p), mMin(p.min), mMax(p.max), - mPerSec(true), + mPerSec(p.per_sec), mPrecision(p.precision), mValue(p.value), + mUnits(p.units), mNewStatFloatp(p.stat.count_stat_float) { setToolTip(p.name()); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 71db0ac030..9b125a85b9 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1307,14 +1307,14 @@ void LLTextBase::replaceWithSuggestion(U32 index) if ( (it->first <= (U32)mCursorPos) && (it->second >= (U32)mCursorPos) ) { deselect(); - - // Delete the misspelled word - removeStringNoUndo(it->first, it->second - it->first); - // Insert the suggestion in its place LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index])); + // Delete the misspelled word + removeStringNoUndo(it->first + (S32)suggestion.length(), it->second - it->first); + + setCursorPos(it->first + (S32)suggestion.length()); break; @@ -2381,7 +2381,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, // binary search for line that starts before local_y line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), doc_y, compare_bottom()); - if (line_iter == mLineInfoList.end()) + if (!mLineInfoList.size() || line_iter == mLineInfoList.end()) { return getLength(); // past the end } @@ -2473,7 +2473,6 @@ LLRect LLTextBase::getDocRectFromDocIndex(S32 pos) const // clamp pos to valid values pos = llclamp(pos, 0, mLineInfoList.back().mDocIndexEnd - 1); - // find line that contains cursor line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), pos, line_end_compare()); doc_rect.mLeft = line_iter->mRect.mLeft; @@ -2649,6 +2648,12 @@ void LLTextBase::changeLine( S32 delta ) LLRect visible_region = getVisibleDocumentRect(); S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel, mLineInfoList[new_line].mRect.mBottom + mVisibleTextRect.mBottom - visible_region.mBottom, TRUE); + S32 actual_line = getLineNumFromDocIndex(new_cursor_pos); + if (actual_line != new_line) + { + // line edge, correcting position by 1 to move onto proper line + new_cursor_pos += new_line - actual_line; + } setCursorPos(new_cursor_pos, true); } } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 576e8f7600..cf5fdef539 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1126,7 +1126,6 @@ void LLTextEditor::addChar(llwchar wc) } } - void LLTextEditor::addLineBreakChar(BOOL group_together) { if( !getEnabled() ) diff --git a/indra/llui/llui.h b/indra/llui/llui.h index b162f25887..c727f75c4f 100755 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -86,6 +86,7 @@ enum EAcceptance { ACCEPT_POSTPONED, // we are asynchronously determining acceptance ACCEPT_NO, // Uninformative, general purpose denial. + ACCEPT_NO_CUSTOM, // Denial with custom message. ACCEPT_NO_LOCKED, // Operation would be valid, but permissions are set to disallow it. ACCEPT_YES_COPY_SINGLE, // We'll take a copy of a single item ACCEPT_YES_SINGLE, // Accepted. OK to drag and drop single item here. diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 6f3122e7a1..be583c83d8 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -178,6 +178,12 @@ bool LLUrlEntryBase::isLinkDisabled() const return globally_disabled; } +bool LLUrlEntryBase::isWikiLinkCorrect(std::string url) +{ + std::string label = getLabelFromWikiLink(url); + return (LLUrlRegistry::instance().hasUrl(label)) ? false : true; +} + static std::string getStringAfterToken(const std::string str, const std::string token) { size_t pos = str.find(token); diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index d4684e2e1e..ffcd45dfde 100755 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -100,6 +100,8 @@ public: bool isLinkDisabled() const; + bool isWikiLinkCorrect(std::string url); + protected: std::string getIDStringFromUrl(const std::string &url) const; std::string escapeUrl(const std::string &url) const; diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index bccc646821..ef0789e0e4 100755 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -45,7 +45,8 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(mUrlEntryIcon); registerUrl(new LLUrlEntrySLURL()); registerUrl(new LLUrlEntryHTTP()); - registerUrl(new LLUrlEntryHTTPLabel()); + mUrlEntryHTTPLabel = new LLUrlEntryHTTPLabel(); + registerUrl(mUrlEntryHTTPLabel); registerUrl(new LLUrlEntryAgentCompleteName()); registerUrl(new LLUrlEntryAgentDisplayName()); registerUrl(new LLUrlEntryAgentUserName()); @@ -64,7 +65,8 @@ LLUrlRegistry::LLUrlRegistry() //LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern, //so it should be registered in the end of list registerUrl(new LLUrlEntrySL()); - registerUrl(new LLUrlEntrySLLabel()); + mUrlEntrySLLabel = new LLUrlEntrySLLabel(); + registerUrl(mUrlEntrySLLabel); // most common pattern is a URL without any protocol, // e.g., "secondlife.com" registerUrl(new LLUrlEntryHTTPNoProtocol()); @@ -128,6 +130,11 @@ static bool matchRegex(const char *text, boost::regex regex, U32 &start, U32 &en end--; } + else if (text[end] == ']' && std::string(text+start, end-start).find('[') == std::string::npos) + { + end--; + } + return true; } @@ -175,6 +182,15 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL // does this match occur in the string before any other match if (start < match_start || match_entry == NULL) { + + if((mUrlEntryHTTPLabel == *it) || (mUrlEntrySLLabel == *it)) + { + if(url_entry && !url_entry->isWikiLinkCorrect(text.substr(start, end - start + 1))) + { + continue; + } + } + match_start = start; match_end = end; match_entry = url_entry; diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h index 6270df1bbb..1cb403dfc9 100755 --- a/indra/llui/llurlregistry.h +++ b/indra/llui/llurlregistry.h @@ -94,6 +94,8 @@ private: std::vector<LLUrlEntryBase *> mUrlEntry; LLUrlEntryBase* mUrlEntryIcon; + LLUrlEntryBase* mUrlEntryHTTPLabel; + LLUrlEntryBase* mUrlEntrySLLabel; }; #endif |