diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index a35fee51e03370919956b97f2c5f54200e72f582..e2275c4408336961be88f4c33aec07e681a5dfae 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -211,7 +211,7 @@ LLFolderView::LLFolderView(const Params& p) //clear label // go ahead and render root folder as usual // just make sure the label ("Inventory Folder") never shows up - mLabel = LLStringUtil::null; + mLabel.clear(); // Escape is handled by reverting the rename, not commiting it (default behavior) LLLineEditor::Params params; diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 783d4a2006f50dd443d9f7731de7ca02bd65e6a5..5c9c15f0b8e6f78cfdcfd606e96d2cc00471aeec 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -138,7 +138,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mItemHeight(p.item_height), mControlLabelRotation(0.f), mDragAndDropTarget(FALSE), - mLabel(p.name), + mLabel(utf8str_to_wstring(p.name)), mRoot(p.root), mViewModelItem(p.listener), mIsMouseOverTitle(false), @@ -185,7 +185,7 @@ BOOL LLFolderViewItem::postBuild() LLFolderViewModelItem& vmi = *getViewModelItem(); // getDisplayName() is expensive (due to internal getLabelSuffix() and name building) // it also sets search strings so it requires a filter reset - mLabel = vmi.getDisplayName(); + mLabel = utf8str_to_wstring(vmi.getDisplayName()); setToolTip(vmi.getName()); // Dirty the filter flag of the model from the view (CHUI-849) @@ -297,7 +297,7 @@ void LLFolderViewItem::refresh() { LLFolderViewModelItem& vmi = *getViewModelItem(); - mLabel = vmi.getDisplayName(); + mLabel = utf8str_to_wstring(vmi.getDisplayName()); setToolTip(vmi.getName()); // icons are slightly expensive to get, can be optimized // see LLInventoryIcon::getIcon() @@ -310,7 +310,7 @@ void LLFolderViewItem::refresh() // Very Expensive! // Can do a number of expensive checks, like checking active motions, wearables or friend list mLabelStyle = vmi.getLabelStyle(); - mLabelSuffix = vmi.getLabelSuffix(); + mLabelSuffix = utf8str_to_wstring(vmi.getLabelSuffix()); } // Dirty the filter flag of the model from the view (CHUI-849) @@ -335,7 +335,7 @@ void LLFolderViewItem::refreshSuffix() // Very Expensive! // Can do a number of expensive checks, like checking active motions, wearables or friend list mLabelStyle = vmi->getLabelStyle(); - mLabelSuffix = vmi->getLabelSuffix(); + mLabelSuffix = utf8str_to_wstring(vmi->getLabelSuffix()); } mLabelWidthDirty = true; @@ -396,7 +396,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height ) // it is purely visual, so it is fine to do at our laisure refreshSuffix(); } - mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + mLabelPaddingRight; + mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel.c_str()) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix.c_str()) + mLabelPaddingRight; mLabelWidthDirty = false; } @@ -872,7 +872,7 @@ void LLFolderViewItem::drawLabel(const LLFontGL * font, const F32 x, const F32 y //--------------------------------------------------------------------------------// // Draw the actual label text // - font->renderUTF8(mLabel, 0, x, y, color, + font->render(mLabel, 0, x, y, color, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, TRUE); } @@ -923,12 +923,12 @@ void LLFolderViewItem::draw() F32 right_x = 0; F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD; F32 text_left = (F32)getLabelXPos(); - std::string combined_string = mLabel + mLabelSuffix; + LLWString combined_string = mLabel + mLabelSuffix; if (filter_string_length > 0) { - S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2; - S32 right = left + font->getWidth(combined_string, mViewModelItem->getFilterStringOffset(), filter_string_length) + 2; + S32 left = ll_round(text_left) + font->getWidth(combined_string.c_str(), 0, mViewModelItem->getFilterStringOffset()) - 2; + S32 right = left + font->getWidth(combined_string.c_str(), mViewModelItem->getFilterStringOffset(), filter_string_length) + 2; S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD); S32 top = getRect().getHeight() - TOP_PAD; @@ -951,7 +951,7 @@ void LLFolderViewItem::draw() // if (!mLabelSuffix.empty()) { - font->renderUTF8( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : (LLColor4)sSuffixColor, + font->render( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : (LLColor4)sSuffixColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE ); } @@ -962,9 +962,9 @@ void LLFolderViewItem::draw() if (filter_string_length > 0) { S32 filter_offset = mViewModelItem->getFilterStringOffset(); - F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, filter_offset + filter_string_length) - font->getWidthF32(combined_string, filter_offset, filter_string_length); + F32 match_string_left = text_left + font->getWidthF32(combined_string.c_str(), 0, filter_offset + filter_string_length) - font->getWidthF32(combined_string.c_str(), filter_offset, filter_string_length); F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD; - font->renderUTF8( combined_string, filter_offset, match_string_left, yy, + font->render( combined_string, filter_offset, match_string_left, yy, sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, filter_string_length, S32_MAX, &right_x, FALSE ); } diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 616d2e7d863dba003d02fb3ead0a8984a3a64596..3dc05ec4a9efc6093601ee5494b56b50c768918c 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -87,14 +87,14 @@ class LLFolderViewItem : public LLView LLFolderViewItem(const Params& p); - std::string mLabel; + LLWString mLabel; S32 mLabelWidth; bool mLabelWidthDirty; S32 mLabelPaddingRight; LLFolderViewFolder* mParentFolder; LLPointer<LLFolderViewModelItem> mViewModelItem; LLFontGL::StyleFlags mLabelStyle; - std::string mLabelSuffix; + LLWString mLabelSuffix; bool mSuffixNeedsRefresh; //suffix and icons LLUIImagePtr mIcon, mIconOpen, @@ -236,7 +236,7 @@ class LLFolderViewItem : public LLView // This method returns the label displayed on the view. This // method was primarily added to allow sorting on the folder // contents possible before the entire view has been constructed. - const std::string& getLabel() const { return mLabel; } + const auto& getLabel() const { return mLabel; } LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; } const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 30786e56f257993cd74f992463fbc831932eb06a..7e3fde62379c17393b429bb0422eb7330566b6c0 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1477,7 +1477,7 @@ void LLTextBase::replaceWithSuggestion(U32 index) deselect(); // Insert the suggestion in its place LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); - insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index])); + insertStringNoUndo(it->first, suggestion); // Delete the misspelled word removeStringNoUndo(it->first + (S32)suggestion.length(), it->second - it->first); diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index d657f04457ab937c3070a1a41e703099d847af82..cf559458bcb7f43f98efd718faf34f5c1fd29ae2 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -41,7 +41,7 @@ class LLExpanderSegment : public LLTextSegment : LLTextSegment(start, end), mEditor(editor), mStyle(style), - mExpanderLabel(more_text) + mExpanderLabel(utf8str_to_wstring(more_text)) {} /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const @@ -80,7 +80,7 @@ class LLExpanderSegment : public LLTextSegment /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { F32 right_x; - mStyle->getFont()->renderUTF8(mExpanderLabel, start, + mStyle->getFont()->render(mExpanderLabel, start, draw_rect.mRight, draw_rect.mTop, mStyle->getColor(), LLFontGL::RIGHT, LLFontGL::TOP, @@ -103,7 +103,7 @@ class LLExpanderSegment : public LLTextSegment private: LLTextBase& mEditor; LLStyleSP mStyle; - std::string mExpanderLabel; + LLWString mExpanderLabel; }; LLExpandableTextBox::LLTextBoxEx::Params::Params() diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index ce14b84cb787de5427f254cebda48ae151f18865..db39738ed3877b0e6c3b97da850b8fd2870a71ce 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1034,7 +1034,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& LLColor4::white, LLFontGL::HCENTER, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); - if (tooltip != "") + if (!tooltip.empty()) { text_y -= font->getLineHeight();