diff --git a/indra/llprimitive/llmediaentry.h b/indra/llprimitive/llmediaentry.h index 33855b3fb2fea725d69ad432dbb6a8dd2d0de515..c6ace4ffc1caae549e0170fd8c7b6165aaa23ed2 100644 --- a/indra/llprimitive/llmediaentry.h +++ b/indra/llprimitive/llmediaentry.h @@ -69,8 +69,8 @@ public: // "general" fields bool getAltImageEnable() const { return mAltImageEnable; } MediaControls getControls() const { return mControls; } - std::string getCurrentURL() const { return mCurrentURL; } - std::string getHomeURL() const { return mHomeURL; } + const std::string& getCurrentURL() const { return mCurrentURL; } + const std::string& getHomeURL() const { return mHomeURL; } bool getAutoLoop() const { return mAutoLoop; } bool getAutoPlay() const { return mAutoPlay; } bool getAutoScale() const { return mAutoScale; } diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index bf63db49247520b4e67077a5f7955d9752d1acfe..b251505ca3a514e8675a400f47c63387c8e4ecf0 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -68,10 +68,10 @@ public: BOOL postBuild() override; - std::string getTitle(); + const std::string& getTitle(); void setTitle(const std::string& title, const std::string& hl); - void setTitleFontStyle(std::string style); + void setTitleFontStyle(const std::string& style); void setTitleColor(const LLUIColor& color); @@ -155,7 +155,7 @@ BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::postBuild() return TRUE; } -std::string LLAccordionCtrlTab::LLAccordionCtrlTabHeader::getTitle() +const std::string& LLAccordionCtrlTab::LLAccordionCtrlTabHeader::getTitle() { if(mHeaderTextbox) { @@ -179,7 +179,7 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitle(const std::string& t } } -void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitleFontStyle(std::string style) +void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitleFontStyle(const std::string& style) { if (mHeaderTextbox) { @@ -508,7 +508,7 @@ void LLAccordionCtrlTab::setAccordionView(LLView* panel) addChild(panel,0); } -std::string LLAccordionCtrlTab::getTitle() const +const std::string& LLAccordionCtrlTab::getTitle() const { if (mHeader) { diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index cf828a19ef1fd7dc6fff176b705c2d4ccd099270..551a12c2589175c716985875e43ec69002d7da53 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -109,7 +109,7 @@ public: void setAccordionView(LLView* panel); LLView* getAccordionView() { return mContainerPanel; }; - std::string getTitle() const; + const std::string& getTitle() const; // Set text and highlight substring in LLAccordionCtrlTabHeader void setTitle(const std::string& title, const std::string& hl = LLStringUtil::null); diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 4f312bc9ee99258d6eed086779b7be16956ff407..d1d331515f371a6fb6decc7804d1f16b16aa5979 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -191,7 +191,7 @@ void LLCheckBoxCtrl::setLabel( const LLStringExplicit& label ) reshape(getRect().getWidth(), getRect().getHeight(), FALSE); } -std::string LLCheckBoxCtrl::getLabel() const +const std::string& LLCheckBoxCtrl::getLabel() const { return mLabel->getText(); } diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index 03f994268c8f64b639c3b31323d14daa9da1b11a..97045e886fc959cc0682be82a25ebaeb426a4490 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -99,7 +99,7 @@ public: void setDisabledColor( const LLColor4 &color ) { mTextDisabledColor = color; } void setLabel( const LLStringExplicit& label ); - std::string getLabel() const; + const std::string& getLabel() const; void setFont( const LLFontGL* font ) { mFont = font; } const LLFontGL* getFont() { return mFont; } diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 3a34a34cacfe746a8f69125f61843c0dbf00da6a..58686e2a55d74929177cee283999c29d11b73064 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -1011,7 +1011,7 @@ void LLComboBox::updateSelection() void LLComboBox::onTextCommit(const LLSD& data) { - std::string text = mTextEntry->getText(); + const std::string& text = mTextEntry->getText(); setSimple(text); onCommit(); mTextEntry->selectAll(); diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 1925c2af6bc094df2656651f4174f46d6ba92ef5..08b22f14885d12b050ba5aac06c9a3e7301cb75a 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -115,7 +115,7 @@ void LLDragHandleTop::setTitle(const std::string& title) } -std::string LLDragHandleTop::getTitle() const +const std::string& LLDragHandleTop::getTitle() const { return mTitleBox == nullptr ? LLStringUtil::null : mTitleBox->getText(); } @@ -133,7 +133,7 @@ void LLDragHandleLeft::setTitle(const std::string& ) } -std::string LLDragHandleLeft::getTitle() const +const std::string& LLDragHandleLeft::getTitle() const { return LLStringUtil::null; } diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h index 14d2da57f5ece5cbe0199408462cb33f608deb7b..8467bb03941f0becdd9990d36652a1b9983afda7 100644 --- a/indra/llui/lldraghandle.h +++ b/indra/llui/lldraghandle.h @@ -70,7 +70,7 @@ public: void setTitleVisible(BOOL visible); virtual void setTitle( const std::string& title ) = 0; - virtual std::string getTitle() const = 0; + virtual const std::string& getTitle() const = 0; BOOL handleHover(S32 x, S32 y, MASK mask) override; BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; @@ -109,7 +109,7 @@ protected: friend class LLUICtrlFactory; public: void setTitle( const std::string& title ) override; - std::string getTitle() const override; + const std::string& getTitle() const override; void draw() override; void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; @@ -127,7 +127,7 @@ protected: friend class LLUICtrlFactory; public: void setTitle( const std::string& title ) override; - std::string getTitle() const override; + const std::string& getTitle() const override; void draw() override; void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index a1ec741ebb82b24df86528601a96482475f98f15..d28075d15ae0bfd4b26c9c4a3daf57199b6bc5c4 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -492,7 +492,7 @@ void LLFolderViewItem::rename(const std::string& new_name) const std::string& LLFolderViewItem::getName( void ) const { - static const std::string noName(""); + static const std::string noName; return getViewModelItem() ? getViewModelItem()->getName() : noName; } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 61ef14cdd6c6a6479e780fb0d6288efe6ee3e3ff..70469845b8035fc695fbaf1e99b83c921d17bb3b 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2047,9 +2047,9 @@ void LLTextBase::setText(const LLStringExplicit &utf8str, const LLStyle::Params& } //virtual -std::string LLTextBase::getText() const +const std::string& LLTextBase::getText() const { - return getViewModel()->getValue().asString(); + return getViewModel()->getValue().asStringRef(); } // IDEVO - icons can be UI image names or UUID sent from diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 5433ff4951a5db25e9d3e626733d0a8daf41451e..cd62612b5b51eb988429f159a5f11c6ca6f4d16e 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -396,7 +396,7 @@ public: // Text accessors // TODO: add optional style parameter virtual void setText(const LLStringExplicit &utf8str , const LLStyle::Params& input_params = LLStyle::Params()); // uses default style - virtual std::string getText() const; + virtual const std::string& getText() const; void setMaxTextLength(S32 length) { mMaxTextByteLength = length; } // wide-char versions diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp index ef673506ad9dfc0b1cb30960e1e83dccc354baf4..e26d423962e0064e07d98c178b558189dba4f05e 100644 --- a/indra/llui/lltimectrl.cpp +++ b/indra/llui/lltimectrl.cpp @@ -320,7 +320,7 @@ void LLTimeCtrl::updateText() LLTimeCtrl::EEditingPart LLTimeCtrl::getEditingPart() { S32 cur_pos = mEditor->getCursor(); - std::string time_str = mEditor->getText(); + const std::string& time_str = mEditor->getText(); size_t colon_index = time_str.find_first_of(':'); diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index 8a976e9c29d80d5176408a158430fdd92388c944..8452ca074d46de077bf405184223a06345a34e32 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -121,7 +121,7 @@ public: /** * Returns text */ - virtual std::string getText() const { return mText; } + virtual const std::string& getText() const { return mText; } /** * Sets text diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 05015162c03198e67e9a9e82b37a8bccbac70751..1c4b4fe2affb3380ee21d25e49d29ca3f6a977af 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -373,7 +373,7 @@ void LLFloaterIMNearbyChat::showHistory() setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT); } -std::string LLFloaterIMNearbyChat::getCurrentChat() const +const std::string& LLFloaterIMNearbyChat::getCurrentChat() const { return mInputEditor ? mInputEditor->getText() : LLStringUtil::null; } diff --git a/indra/newview/llfloaterimnearbychat.h b/indra/newview/llfloaterimnearbychat.h index 244d04f000bf4b718a38ce1c4edf7b061779dd8e..826dd891ee830d46efed0f379486d32951947fdc 100644 --- a/indra/newview/llfloaterimnearbychat.h +++ b/indra/newview/llfloaterimnearbychat.h @@ -63,7 +63,7 @@ public: LLChatEntry* getChatBox() const { return mInputEditor; } - std::string getCurrentChat() const; + const std::string& getCurrentChat() const; S32 getMessageArchiveLength() const {return mMessageArchive.size();} BOOL handleKeyHere( KEY key, MASK mask ) override; diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 7764b58a3052878fd8dc141b38245d273444afe4..0a8dbcc0696ac53ad180352350afbe2c03b4e093 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -1025,8 +1025,8 @@ class LLVivoxSecurity final : public LLSingleton<LLVivoxSecurity> virtual ~LLVivoxSecurity(); public: - std::string connectorHandle() { return mConnectorHandle; }; - std::string accountHandle() { return mAccountHandle; }; + const std::string& connectorHandle() { return mConnectorHandle; }; + const std::string& accountHandle() { return mAccountHandle; }; #ifdef LL_LINUX void setConnectorHandle(const std::string& handle) { mConnectorHandle = handle; }