diff options
Diffstat (limited to 'indra/llui')
73 files changed, 1398 insertions, 1424 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 7d54aeb950..4f5f630fcd 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -59,7 +59,7 @@ S32 BTN_HEIGHT = 0; S32 BTN_GRID = 12; S32 BORDER_SIZE = 1; -LLButton::LLButton( const LLString& name, const LLRect& rect, const LLString& control_name, void (*click_callback)(void*), void *callback_data) +LLButton::LLButton( const std::string& name, const LLRect& rect, const std::string& control_name, void (*click_callback)(void*), void *callback_data) : LLUICtrl(name, rect, TRUE, NULL, NULL), mClickedCallback( click_callback ), mMouseDownCallback( NULL ), @@ -93,10 +93,10 @@ LLButton::LLButton( const LLString& name, const LLRect& rect, const LLString& co mUnselectedLabel = name; mSelectedLabel = name; - setImageUnselected("button_enabled_32x128.tga"); - setImageSelected("button_enabled_selected_32x128.tga"); - setImageDisabled("button_disabled_32x128.tga"); - setImageDisabledSelected("button_disabled_32x128.tga"); + setImageUnselected(std::string("button_enabled_32x128.tga")); + setImageSelected(std::string("button_enabled_selected_32x128.tga")); + setImageDisabled(std::string("button_disabled_32x128.tga")); + setImageDisabledSelected(std::string("button_disabled_32x128.tga")); mImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); mDisabledImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); @@ -105,15 +105,15 @@ LLButton::LLButton( const LLString& name, const LLRect& rect, const LLString& co } -LLButton::LLButton(const LLString& name, const LLRect& rect, - const LLString &unselected_image_name, - const LLString &selected_image_name, - const LLString& control_name, +LLButton::LLButton(const std::string& name, const LLRect& rect, + const std::string &unselected_image_name, + const std::string &selected_image_name, + const std::string& control_name, void (*click_callback)(void*), void *callback_data, const LLFontGL *font, - const LLString& unselected_label, - const LLString& selected_label ) + const std::string& unselected_label, + const std::string& selected_label ) : LLUICtrl(name, rect, TRUE, NULL, NULL), mClickedCallback( click_callback ), mMouseDownCallback( NULL ), @@ -162,8 +162,8 @@ LLButton::LLButton(const LLString& name, const LLRect& rect, } else { - setImageUnselected("button_enabled_32x128.tga"); - setImageDisabled("button_disabled_32x128.tga"); + setImageUnselected(std::string("button_enabled_32x128.tga")); + setImageDisabled(std::string("button_disabled_32x128.tga")); } if( selected_image_name != "" ) @@ -177,19 +177,19 @@ LLButton::LLButton(const LLString& name, const LLRect& rect, } else { - setImageSelected("button_enabled_selected_32x128.tga"); - setImageDisabledSelected("button_disabled_32x128.tga"); + setImageSelected(std::string("button_enabled_selected_32x128.tga")); + setImageDisabledSelected(std::string("button_disabled_32x128.tga")); } init(click_callback, callback_data, font, control_name); } -void LLButton::init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const LLString& control_name) +void LLButton::init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name) { mGLFont = ( font ? font : LLFontGL::sSansSerif); // Hack to make sure there is space for at least one character - if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(" ")) + if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(std::string(" "))) { // Use old defaults mLeftHPad = LLBUTTON_ORIG_H_PAD; @@ -667,7 +667,7 @@ void LLButton::draw() // Draw label if( !label.empty() ) { - LLWString::trim(label); + LLWStringUtil::trim(label); S32 x; switch( mHAlign ) @@ -774,7 +774,7 @@ void LLButton::setLabel( const LLStringExplicit& label ) } //virtual -BOOL LLButton::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLButton::setLabelArg( const std::string& key, const LLStringExplicit& text ) { mUnselectedLabel.setArg(key, text); mSelectedLabel.setArg(key, text); @@ -806,7 +806,7 @@ void LLButton::setImageUnselected(LLPointer<LLUIImage> image) mImageUnselected = image; } -void LLButton::setImages( const LLString &image_name, const LLString &selected_name ) +void LLButton::setImages( const std::string &image_name, const std::string &selected_name ) { setImageUnselected(image_name); setImageSelected(selected_name); @@ -843,7 +843,7 @@ void LLButton::setImageDisabledSelected(LLPointer<LLUIImage> image) mDisabledImageColor.mV[VALPHA] *= 0.5f; } -void LLButton::setDisabledImages( const LLString &image_name, const LLString &selected_name, const LLColor4& c ) +void LLButton::setDisabledImages( const std::string &image_name, const std::string &selected_name, const LLColor4& c ) { setImageDisabled(image_name); setImageDisabledSelected(selected_name); @@ -855,7 +855,7 @@ void LLButton::setImageHoverSelected(LLPointer<LLUIImage> image) mImageHoverSelected = image; } -void LLButton::setDisabledImages( const LLString &image_name, const LLString &selected_name) +void LLButton::setDisabledImages( const std::string &image_name, const std::string &selected_name) { LLColor4 clr = mImageColor; clr.mV[VALPHA] *= .5f; @@ -867,13 +867,13 @@ void LLButton::setImageHoverUnselected(LLPointer<LLUIImage> image) mImageHoverUnselected = image; } -void LLButton::setHoverImages( const LLString& image_name, const LLString& selected_name ) +void LLButton::setHoverImages( const std::string& image_name, const std::string& selected_name ) { setImageHoverUnselected(image_name); setImageHoverSelected(selected_name); } -void LLButton::setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment, const LLColor4& color) +void LLButton::setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment, const LLColor4& color) { if (image_name.empty()) { @@ -912,54 +912,54 @@ S32 round_up(S32 grid, S32 value) } } -void LLButton::setImageUnselected(const LLString &image_name) +void LLButton::setImageUnselected(const std::string &image_name) { setImageUnselected(LLUI::getUIImage(image_name)); mImageUnselectedName = image_name; } -void LLButton::setImageSelected(const LLString &image_name) +void LLButton::setImageSelected(const std::string &image_name) { setImageSelected(LLUI::getUIImage(image_name)); mImageSelectedName = image_name; } -void LLButton::setImageHoverSelected(const LLString &image_name) +void LLButton::setImageHoverSelected(const std::string &image_name) { setImageHoverSelected(LLUI::getUIImage(image_name)); mImageHoverSelectedName = image_name; } -void LLButton::setImageHoverUnselected(const LLString &image_name) +void LLButton::setImageHoverUnselected(const std::string &image_name) { setImageHoverUnselected(LLUI::getUIImage(image_name)); mImageHoverUnselectedName = image_name; } -void LLButton::setImageDisabled(const LLString &image_name) +void LLButton::setImageDisabled(const std::string &image_name) { setImageDisabled(LLUI::getUIImage(image_name)); mImageDisabledName = image_name; } -void LLButton::setImageDisabledSelected(const LLString &image_name) +void LLButton::setImageDisabledSelected(const std::string &image_name) { setImageDisabledSelected(LLUI::getUIImage(image_name)); mImageDisabledSelectedName = image_name; } void LLButton::addImageAttributeToXML(LLXMLNodePtr node, - const LLString& image_name, + const std::string& image_name, const LLUUID& image_id, - const LLString& xml_tag_name) const + const std::string& xml_tag_name) const { if( !image_name.empty() ) { - node->createChild(xml_tag_name, TRUE)->setStringValue(image_name); + node->createChild(xml_tag_name.c_str(), TRUE)->setStringValue(image_name); } else if( image_id != LLUUID::null ) { - node->createChild(xml_tag_name + "_id", TRUE)->setUUIDValue(image_id); + node->createChild((xml_tag_name + "_id").c_str(), TRUE)->setUUIDValue(image_id); } } @@ -973,12 +973,12 @@ LLXMLNodePtr LLButton::getXML(bool save_children) const node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign)); - addImageAttributeToXML(node,mImageUnselectedName,mImageUnselectedID,"image_unselected"); - addImageAttributeToXML(node,mImageSelectedName,mImageSelectedID,"image_selected"); - addImageAttributeToXML(node,mImageHoverSelectedName,mImageHoverSelectedID,"image_hover_selected"); - addImageAttributeToXML(node,mImageHoverUnselectedName,mImageHoverUnselectedID,"image_hover_unselected"); - addImageAttributeToXML(node,mImageDisabledName,mImageDisabledID,"image_disabled"); - addImageAttributeToXML(node,mImageDisabledSelectedName,mImageDisabledSelectedID,"image_disabled_selected"); + addImageAttributeToXML(node,mImageUnselectedName,mImageUnselectedID,std::string("image_unselected")); + addImageAttributeToXML(node,mImageSelectedName,mImageSelectedID,std::string("image_selected")); + addImageAttributeToXML(node,mImageHoverSelectedName,mImageHoverSelectedID,std::string("image_hover_selected")); + addImageAttributeToXML(node,mImageHoverUnselectedName,mImageHoverUnselectedID,std::string("image_hover_unselected")); + addImageAttributeToXML(node,mImageDisabledName,mImageDisabledID,std::string("image_disabled")); + addImageAttributeToXML(node,mImageDisabledSelectedName,mImageDisabledSelectedID,std::string("image_disabled_selected")); node->createChild("scale_image", TRUE)->setBoolValue(mScaleImage); @@ -1001,40 +1001,40 @@ void clicked_help(void* data) // static LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("button"); + std::string name("button"); node->getAttributeString("name", name); - LLString label = name; + std::string label = name; node->getAttributeString("label", label); - LLString label_selected = label; + std::string label_selected = label; node->getAttributeString("label_selected", label_selected); LLFontGL* font = selectFont(node); - LLString image_unselected; + std::string image_unselected; if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected); - LLString image_selected; + std::string image_selected; if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected); - LLString image_hover_selected; + std::string image_hover_selected; if (node->hasAttribute("image_hover_selected")) node->getAttributeString("image_hover_selected",image_hover_selected); - LLString image_hover_unselected; + std::string image_hover_unselected; if (node->hasAttribute("image_hover_unselected")) node->getAttributeString("image_hover_unselected",image_hover_unselected); - LLString image_disabled_selected; + std::string image_disabled_selected; if (node->hasAttribute("image_disabled_selected")) node->getAttributeString("image_disabled_selected",image_disabled_selected); - LLString image_disabled; + std::string image_disabled; if (node->hasAttribute("image_disabled")) node->getAttributeString("image_disabled",image_disabled); - LLString image_overlay; + std::string image_overlay; node->getAttributeString("image_overlay", image_overlay); LLFontGL::HAlign image_overlay_alignment = LLFontGL::HCENTER; - LLString image_overlay_alignment_string; + std::string image_overlay_alignment_string; if (node->hasAttribute("image_overlay_alignment")) { node->getAttributeString("image_overlay_alignment", image_overlay_alignment_string); @@ -1046,7 +1046,7 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa LLRect(), image_unselected, image_selected, - "", + LLStringUtil::null, NULL, parent, font, @@ -1060,15 +1060,15 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa node->getAttributeBOOL("toggle", is_toggle); button->setIsToggle(is_toggle); - if(image_hover_selected != LLString::null) button->setImageHoverSelected(image_hover_selected); + if(image_hover_selected != LLStringUtil::null) button->setImageHoverSelected(image_hover_selected); - if(image_hover_unselected != LLString::null) button->setImageHoverUnselected(image_hover_unselected); + if(image_hover_unselected != LLStringUtil::null) button->setImageHoverUnselected(image_hover_unselected); - if(image_disabled_selected != LLString::null) button->setImageDisabledSelected(image_disabled_selected ); + if(image_disabled_selected != LLStringUtil::null) button->setImageDisabledSelected(image_disabled_selected ); - if(image_disabled != LLString::null) button->setImageDisabled(image_disabled); + if(image_disabled != LLStringUtil::null) button->setImageDisabled(image_disabled); - if(image_overlay != LLString::null) button->setImageOverlay(image_overlay, image_overlay_alignment); + if(image_overlay != LLStringUtil::null) button->setImageOverlay(image_overlay, image_overlay_alignment); if (node->hasAttribute("halign")) { @@ -1094,7 +1094,7 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa if (node->hasAttribute("help_url")) { - LLString help_url; + std::string help_url; node->getAttributeString("help_url",help_url); button->setHelpURLCallback(help_url); } @@ -1104,7 +1104,7 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa return button; } -void LLButton::setHelpURLCallback(const LLString &help_url) +void LLButton::setHelpURLCallback(const std::string &help_url) { mHelpURL = help_url; setClickedCallback(clicked_help,this); diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 6357e27bb7..9e24376938 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -72,25 +72,25 @@ class LLButton { public: // simple button with text label - LLButton(const LLString& name, const LLRect &rect, const LLString& control_name = LLString(), + LLButton(const std::string& name, const LLRect &rect, const std::string& control_name = std::string(), void (*on_click)(void*) = NULL, void *data = NULL); - LLButton(const LLString& name, const LLRect& rect, - const LLString &unselected_image, - const LLString &selected_image, - const LLString& control_name, + LLButton(const std::string& name, const LLRect& rect, + const std::string &unselected_image, + const std::string &selected_image, + const std::string& control_name, void (*click_callback)(void*), void *callback_data = NULL, const LLFontGL* mGLFont = NULL, - const LLString& unselected_label = LLString::null, - const LLString& selected_label = LLString::null ); + const std::string& unselected_label = LLStringUtil::null, + const std::string& selected_label = LLStringUtil::null ); virtual ~LLButton(); - void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const LLString& control_name); + void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name); - void addImageAttributeToXML(LLXMLNodePtr node, const LLString& imageName, - const LLUUID& imageID,const LLString& xmlTagName) const; + void addImageAttributeToXML(LLXMLNodePtr node, const std::string& imageName, + const LLUUID& imageID,const std::string& xmlTagName) const; virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -130,24 +130,24 @@ public: void setLeftHPad( S32 pad ) { mLeftHPad = pad; } void setRightHPad( S32 pad ) { mRightHPad = pad; } - const LLString getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); } - const LLString getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } + const std::string getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); } + const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } - void setImageColor(const LLString& color_control); + void setImageColor(const std::string& color_control); void setImageColor(const LLColor4& c); virtual void setColor(const LLColor4& c); - void setImages(const LLString &image_name, const LLString &selected_name); - void setDisabledImages(const LLString &image_name, const LLString &selected_name); - void setDisabledImages(const LLString &image_name, const LLString &selected_name, const LLColor4& c); + void setImages(const std::string &image_name, const std::string &selected_name); + void setDisabledImages(const std::string &image_name, const std::string &selected_name); + void setDisabledImages(const std::string &image_name, const std::string &selected_name, const LLColor4& c); - void setHoverImages(const LLString &image_name, const LLString &selected_name); + void setHoverImages(const std::string &image_name, const std::string &selected_name); void setDisabledImageColor(const LLColor4& c) { mDisabledImageColor = c; } void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; } - void setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white); + void setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white); LLPointer<LLUIImage> getImageOverlay() { return mImageOverlay; } @@ -155,7 +155,7 @@ public: virtual LLSD getValue() const; void setLabel( const LLStringExplicit& label); - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); void setLabelUnselected(const LLStringExplicit& label); void setLabelSelected(const LLStringExplicit& label); void setDisabledLabel(const LLStringExplicit& disabled_label); @@ -175,14 +175,14 @@ public: void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; } - void setImageUnselected(const LLString &image_name); - const LLString& getImageUnselectedName() const { return mImageUnselectedName; } - void setImageSelected(const LLString &image_name); - const LLString& getImageSelectedName() const { return mImageSelectedName; } - void setImageHoverSelected(const LLString &image_name); - void setImageHoverUnselected(const LLString &image_name); - void setImageDisabled(const LLString &image_name); - void setImageDisabledSelected(const LLString &image_name); + void setImageUnselected(const std::string &image_name); + const std::string& getImageUnselectedName() const { return mImageUnselectedName; } + void setImageSelected(const std::string &image_name); + const std::string& getImageSelectedName() const { return mImageSelectedName; } + void setImageHoverSelected(const std::string &image_name); + void setImageHoverUnselected(const std::string &image_name); + void setImageDisabled(const std::string &image_name); + void setImageDisabledSelected(const std::string &image_name); void setImageUnselected(LLPointer<LLUIImage> image); void setImageSelected(LLPointer<LLUIImage> image); @@ -194,8 +194,8 @@ public: void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } BOOL getCommitOnReturn() const { return mCommitOnReturn; } - void setHelpURLCallback(const LLString &help_url); - const LLString& getHelpURL() const { return mHelpURL; } + void setHelpURLCallback(const std::string &help_url); + const std::string& getHelpURL() const { return mHelpURL; } protected: @@ -257,12 +257,12 @@ private: LLUUID mImageHoverUnselectedID; LLUUID mImageDisabledID; LLUUID mImageDisabledSelectedID; - LLString mImageUnselectedName; - LLString mImageSelectedName; - LLString mImageHoverSelectedName; - LLString mImageHoverUnselectedName; - LLString mImageDisabledName; - LLString mImageDisabledSelectedName; + std::string mImageUnselectedName; + std::string mImageSelectedName; + std::string mImageHoverSelectedName; + std::string mImageHoverUnselectedName; + std::string mImageDisabledName; + std::string mImageDisabledSelectedName; LLColor4 mHighlightColor; LLColor4 mUnselectedBgColor; @@ -291,7 +291,7 @@ private: BOOL mNeedsHighlight; BOOL mCommitOnReturn; - LLString mHelpURL; + std::string mHelpURL; LLPointer<LLUIImage> mImagep; diff --git a/indra/llui/llcallbackmap.h b/indra/llui/llcallbackmap.h index 496d7225f8..148993b1b1 100644 --- a/indra/llui/llcallbackmap.h +++ b/indra/llui/llcallbackmap.h @@ -41,7 +41,7 @@ public: // callback definition. typedef void* (*callback_t)(void* data); - typedef std::map<LLString, LLCallbackMap> map_t; + typedef std::map<std::string, LLCallbackMap> map_t; typedef map_t::iterator map_iter_t; typedef map_t::const_iterator map_const_iter_t; diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 4d65047c36..0eab8f27a6 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -51,14 +51,14 @@ const U32 MAX_STRING_LENGTH = 10; static LLRegisterWidget<LLCheckBoxCtrl> r("check_box"); -LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, - const LLString& label, +LLCheckBoxCtrl::LLCheckBoxCtrl(const std::string& name, const LLRect& rect, + const std::string& label, const LLFontGL* font, void (*commit_callback)(LLUICtrl* ctrl, void* userdata), void* callback_user_data, BOOL initial_value, BOOL use_radio_style, - const LLString& control_which) + const std::string& control_which) : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data, FOLLOWS_LEFT | FOLLOWS_TOP), mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), @@ -93,13 +93,13 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, // *HACK Get rid of this with SL-55508... // this allows blank check boxes and radio boxes for now - LLString local_label = label; + std::string local_label = label; if(local_label.empty()) { local_label = " "; } - mLabel = new LLTextBox( "CheckboxCtrl Label", label_rect, local_label.c_str(), mFont ); + mLabel = new LLTextBox( std::string("CheckboxCtrl Label"), label_rect, local_label, mFont ); mLabel->setFollowsLeft(); mLabel->setFollowsBottom(); addChild(mLabel); @@ -112,18 +112,17 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, LLCHECKBOXCTRL_VPAD, LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING + text_width + LLCHECKBOXCTRL_HPAD, llmax( text_height, LLCHECKBOXCTRL_BTN_SIZE ) + LLCHECKBOXCTRL_VPAD); - LLString active_true_id, active_false_id; - LLString inactive_true_id, inactive_false_id; + std::string active_true_id, active_false_id; + std::string inactive_true_id, inactive_false_id; if (mRadioStyle) { active_true_id = "UIImgRadioActiveSelectedUUID"; active_false_id = "UIImgRadioActiveUUID"; inactive_true_id = "UIImgRadioInactiveSelectedUUID"; inactive_false_id = "UIImgRadioInactiveUUID"; - mButton = new LLButton( - "Radio control button", btn_rect, - active_false_id, active_true_id, control_which, - &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::sSansSerif ); + mButton = new LLButton(std::string("Radio control button"), btn_rect, + active_false_id, active_true_id, control_which, + &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::sSansSerif ); mButton->setDisabledImages( inactive_false_id, inactive_true_id ); mButton->setHoverGlowStrength(0.35f); } @@ -133,10 +132,9 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, active_true_id = "UIImgCheckboxActiveSelectedUUID"; inactive_true_id = "UIImgCheckboxInactiveSelectedUUID"; inactive_false_id = "UIImgCheckboxInactiveUUID"; - mButton = new LLButton( - "Checkbox control button", btn_rect, - active_false_id, active_true_id, control_which, - &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::sSansSerif ); + mButton = new LLButton(std::string("Checkbox control button"), btn_rect, + active_false_id, active_true_id, control_which, + &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::sSansSerif ); mButton->setDisabledImages( inactive_false_id, inactive_true_id ); mButton->setHoverGlowStrength(0.35f); } @@ -253,12 +251,12 @@ void LLCheckBoxCtrl::setLabel( const LLStringExplicit& label ) reshape(getRect().getWidth(), getRect().getHeight(), FALSE); } -LLString LLCheckBoxCtrl::getLabel() const +std::string LLCheckBoxCtrl::getLabel() const { return mLabel->getText(); } -BOOL LLCheckBoxCtrl::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLCheckBoxCtrl::setLabelArg( const std::string& key, const LLStringExplicit& text ) { BOOL res = mLabel->setTextArg(key, text); reshape(getRect().getWidth(), getRect().getHeight(), FALSE); @@ -266,13 +264,13 @@ BOOL LLCheckBoxCtrl::setLabelArg( const LLString& key, const LLStringExplicit& t } //virtual -LLString LLCheckBoxCtrl::getControlName() const +std::string LLCheckBoxCtrl::getControlName() const { return mButton->getControlName(); } // virtual -void LLCheckBoxCtrl::setControlName(const LLString& control_name, LLView* context) +void LLCheckBoxCtrl::setControlName(const std::string& control_name, LLView* context) { mButton->setControlName(control_name, context); } @@ -307,7 +305,7 @@ LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const node->createChild("label", TRUE)->setStringValue(mLabel->getText()); - LLString control_name = mButton->getControlName(); + std::string control_name = mButton->getControlName(); node->createChild("initial_value", TRUE)->setBoolValue(mInitialValue); @@ -321,10 +319,10 @@ LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const // static LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("checkbox"); + std::string name("checkbox"); node->getAttributeString("name", name); - LLString label(""); + std::string label(""); node->getAttributeString("label", label); LLFontGL* font = LLView::selectFont(node); diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index 6e1ab322af..b78bf135f7 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -65,13 +65,13 @@ class LLCheckBoxCtrl : public LLUICtrl { public: - LLCheckBoxCtrl(const LLString& name, const LLRect& rect, const LLString& label, + LLCheckBoxCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLFontGL* font = NULL, void (*commit_callback)(LLUICtrl*, void*) = NULL, void* callback_userdata = NULL, BOOL initial_value = FALSE, BOOL use_radio_style = FALSE, // if true, draw radio button style icons - const LLString& control_which = LLString::null); + const std::string& control_which = LLStringUtil::null); virtual ~LLCheckBoxCtrl(); // LLView interface @@ -93,7 +93,7 @@ public: virtual void setTentative(BOOL b) { mButton->setTentative(b); } virtual BOOL getTentative() const { return mButton->getTentative(); } - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual void clear(); virtual void onCommit(); @@ -105,10 +105,10 @@ public: void setDisabledColor( const LLColor4 &color ) { mTextDisabledColor = color; } void setLabel( const LLStringExplicit& label ); - LLString getLabel() const; + std::string getLabel() const; - virtual void setControlName(const LLString& control_name, LLView* context); - virtual LLString getControlName() const; + virtual void setControlName(const std::string& control_name, LLView* context); + virtual std::string getControlName() const; static void onButtonPress(void *userdata); diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 98a79fa650..8d8487f612 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -59,7 +59,7 @@ S32 MAX_COMBO_WIDTH = 500; static LLRegisterWidget<LLComboBox> r1("combo_box"); -LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString& label, +LLComboBox::LLComboBox( const std::string& name, const LLRect &rect, const std::string& label, void (*commit_callback)(LLUICtrl*,void*), void *callback_userdata ) @@ -78,12 +78,12 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString // Text label button mButton = new LLButton(label, LLRect(), - LLString::null, + LLStringUtil::null, NULL, this); - mButton->setImageUnselected("square_btn_32x128.tga"); - mButton->setImageSelected("square_btn_selected_32x128.tga"); - mButton->setImageDisabled("square_btn_32x128.tga"); - mButton->setImageDisabledSelected("square_btn_selected_32x128.tga"); + mButton->setImageUnselected(std::string("square_btn_32x128.tga")); + mButton->setImageSelected(std::string("square_btn_selected_32x128.tga")); + mButton->setImageDisabled(std::string("square_btn_32x128.tga")); + mButton->setImageDisabledSelected(std::string("square_btn_selected_32x128.tga")); mButton->setScaleImage(TRUE); mButton->setMouseDownCallback(onButtonDown); @@ -94,9 +94,8 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString addChild(mButton); // disallow multiple selection - mList = new LLScrollListCtrl( - "ComboBox", LLRect(), - &LLComboBox::onItemSelected, this, FALSE); + mList = new LLScrollListCtrl(std::string("ComboBox"), LLRect(), + &LLComboBox::onItemSelected, this, FALSE); mList->setVisible(FALSE); mList->setBgWriteableColor( LLColor4(1,1,1,1) ); mList->setCommitOnKeyboardMovement(FALSE); @@ -149,10 +148,10 @@ LLXMLNodePtr LLComboBox::getXML(bool save_children) const // static LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("combo_box"); + std::string name("combo_box"); node->getAttributeString("name", name); - LLString label(""); + std::string label(""); node->getAttributeString("label", label); LLRect rect; @@ -175,7 +174,7 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * combo_box->initFromXML(node, parent); - const LLString& contents = node->getValue(); + const std::string& contents = node->getValue(); if (contents.find_first_not_of(" \n\t") != contents.npos) { @@ -188,9 +187,9 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * { if (child->hasName("combo_item")) { - LLString label = child->getTextContents(); + std::string label = child->getTextContents(); - LLString value = label; + std::string value = label; child->getAttributeString("value", value); combo_box->add(label, LLSD(value) ); @@ -213,12 +212,12 @@ void LLComboBox::clear() { if (mTextEntry) { - mTextEntry->setText(LLString::null); + mTextEntry->setText(LLStringUtil::null); } - mButton->setLabelSelected(LLString::null); - mButton->setLabelUnselected(LLString::null); - mButton->setDisabledLabel(LLString::null); - mButton->setDisabledSelectedLabel(LLString::null); + mButton->setLabelSelected(LLStringUtil::null); + mButton->setLabelUnselected(LLStringUtil::null); + mButton->setDisabledLabel(LLStringUtil::null); + mButton->setDisabledSelectedLabel(LLStringUtil::null); mList->deselectAllItems(); } @@ -256,7 +255,7 @@ void LLComboBox::resetDirty() // add item "name" to menu -LLScrollListItem* LLComboBox::add(const LLString& name, EAddPosition pos, BOOL enabled) +LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, BOOL enabled) { LLScrollListItem* item = mList->addSimpleElement(name, pos); item->setEnabled(enabled); @@ -265,7 +264,7 @@ LLScrollListItem* LLComboBox::add(const LLString& name, EAddPosition pos, BOOL e } // add item "name" with a unique id to menu -LLScrollListItem* LLComboBox::add(const LLString& name, const LLUUID& id, EAddPosition pos, BOOL enabled ) +LLScrollListItem* LLComboBox::add(const std::string& name, const LLUUID& id, EAddPosition pos, BOOL enabled ) { LLScrollListItem* item = mList->addSimpleElement(name, pos, id); item->setEnabled(enabled); @@ -274,7 +273,7 @@ LLScrollListItem* LLComboBox::add(const LLString& name, const LLUUID& id, EAddPo } // add item "name" with attached userdata -LLScrollListItem* LLComboBox::add(const LLString& name, void* userdata, EAddPosition pos, BOOL enabled ) +LLScrollListItem* LLComboBox::add(const std::string& name, void* userdata, EAddPosition pos, BOOL enabled ) { LLScrollListItem* item = mList->addSimpleElement(name, pos); item->setEnabled(enabled); @@ -284,7 +283,7 @@ LLScrollListItem* LLComboBox::add(const LLString& name, void* userdata, EAddPosi } // add item "name" with attached generic data -LLScrollListItem* LLComboBox::add(const LLString& name, LLSD value, EAddPosition pos, BOOL enabled ) +LLScrollListItem* LLComboBox::add(const std::string& name, LLSD value, EAddPosition pos, BOOL enabled ) { LLScrollListItem* item = mList->addSimpleElement(name, pos, value); item->setEnabled(enabled); @@ -299,7 +298,7 @@ LLScrollListItem* LLComboBox::addSeparator(EAddPosition pos) void LLComboBox::sortByName() { - mList->sortByColumn(0, TRUE); + mList->sortByColumnIndex(0, TRUE); } @@ -331,9 +330,9 @@ void LLComboBox::setValue(const LLSD& value) } } -const LLString LLComboBox::getSimple() const +const std::string LLComboBox::getSimple() const { - const LLString res = mList->getSelectedItemLabel(); + const std::string res = mList->getSelectedItemLabel(); if (res.empty() && mAllowTextEntry) { return mTextEntry->getText(); @@ -344,7 +343,7 @@ const LLString LLComboBox::getSimple() const } } -const LLString LLComboBox::getSelectedItemLabel(S32 column) const +const std::string LLComboBox::getSelectedItemLabel(S32 column) const { return mList->getSelectedItemLabel(column); } @@ -392,7 +391,7 @@ void LLComboBox::setLabel(const LLStringExplicit& name) } -BOOL LLComboBox::remove(const LLString& name) +BOOL LLComboBox::remove(const std::string& name) { BOOL found = mList->selectItemByLabel(name); @@ -495,10 +494,10 @@ void LLComboBox::updateLayout() LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); // clear label on button - LLString cur_label = mButton->getLabelSelected(); - mTextEntry = new LLLineEditor("combo_text_entry", + std::string cur_label = mButton->getLabelSelected(); + mTextEntry = new LLLineEditor(std::string("combo_text_entry"), text_entry_rect, - "", + LLStringUtil::null, LLFontGL::sSansSerifSmall, mMaxChars, onTextCommit, @@ -520,7 +519,7 @@ void LLComboBox::updateLayout() } // clear label on button - setLabel(LLString::null); + setLabel(LLStringUtil::null); mButton->setFollows(FOLLOWS_BOTTOM | FOLLOWS_TOP | FOLLOWS_RIGHT); } @@ -647,7 +646,7 @@ void LLComboBox::showList() void LLComboBox::hideList() { //*HACK: store the original value explicitly somewhere, not just in label - LLString orig_selection = mAllowTextEntry ? mTextEntry->getText() : mButton->getLabelSelected(); + std::string orig_selection = mAllowTextEntry ? mTextEntry->getText() : mButton->getLabelSelected(); // assert selection in list mList->selectItemByLabel(orig_selection, FALSE); @@ -712,7 +711,7 @@ void LLComboBox::onItemSelected(LLUICtrl* item, void *userdata) // Note: item is the LLScrollListCtrl LLComboBox *self = (LLComboBox *) userdata; - const LLString name = self->mList->getSelectedItemLabel(); + const std::string name = self->mList->getSelectedItemLabel(); S32 cur_id = self->getCurrentIndex(); if (cur_id != -1) @@ -733,9 +732,9 @@ void LLComboBox::onItemSelected(LLUICtrl* item, void *userdata) self->onCommit(); } -BOOL LLComboBox::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) +BOOL LLComboBox::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { - LLString tool_tip; + std::string tool_tip; if(LLUICtrl::handleToolTip(x, y, msg, sticky_rect_screen)) { @@ -925,7 +924,7 @@ void LLComboBox::updateSelection() // user-entered portion of string, based on assumption that any selected // text was a result of auto-completion LLWString user_wstring = mTextEntry->hasSelection() ? left_wstring : mTextEntry->getWText(); - LLString full_string = mTextEntry->getText(); + std::string full_string = mTextEntry->getText(); // go ahead and arrange drop down list on first typed character, even // though we aren't showing it... some code relies on prearrange @@ -963,7 +962,7 @@ void LLComboBox::updateSelection() void LLComboBox::onTextCommit(LLUICtrl* caller, void* user_data) { LLComboBox* self = (LLComboBox*)user_data; - LLString text = self->mTextEntry->getText(); + std::string text = self->mTextEntry->getText(); self->setSimple(text); self->onCommit(); self->mTextEntry->selectAll(); @@ -1002,7 +1001,7 @@ void LLComboBox::clearColumns() mList->clearColumns(); } -void LLComboBox::setColumnLabel(const LLString& column, const LLString& label) +void LLComboBox::setColumnLabel(const std::string& column, const std::string& label) { mList->setColumnLabel(column, label); } @@ -1012,7 +1011,7 @@ LLScrollListItem* LLComboBox::addElement(const LLSD& value, EAddPosition pos, vo return mList->addElement(value, pos, userdata); } -LLScrollListItem* LLComboBox::addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) +LLScrollListItem* LLComboBox::addSimpleElement(const std::string& value, EAddPosition pos, const LLSD& id) { return mList->addSimpleElement(value, pos, id); } @@ -1022,8 +1021,9 @@ void LLComboBox::clearRows() mList->clearRows(); } -void LLComboBox::sortByColumn(LLString name, BOOL ascending) +void LLComboBox::sortByColumn(const std::string& name, BOOL ascending) { + mList->sortByColumn(name, ascending); } //============================================================================ @@ -1100,19 +1100,19 @@ static LLRegisterWidget<LLFlyoutButton> r2("flyout_button"); const S32 FLYOUT_BUTTON_ARROW_WIDTH = 24; LLFlyoutButton::LLFlyoutButton( - const LLString& name, + const std::string& name, const LLRect &rect, - const LLString& label, + const std::string& label, void (*commit_callback)(LLUICtrl*, void*) , void *callback_userdata) -: LLComboBox(name, rect, LLString::null, commit_callback, callback_userdata), +: LLComboBox(name, rect, LLStringUtil::null, commit_callback, callback_userdata), mToggleState(FALSE), mActionButton(NULL) { // Always use text box // Text label button mActionButton = new LLButton(label, - LLRect(), LLString::null, NULL, this); + LLRect(), LLStringUtil::null, NULL, this); mActionButton->setScaleImage(TRUE); mActionButton->setClickedCallback(onActionButtonClick); @@ -1145,10 +1145,10 @@ LLFlyoutButton::LLFlyoutButton( //static LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name = "flyout_button"; + std::string name = "flyout_button"; node->getAttributeString("name", name); - LLString label(""); + std::string label(""); node->getAttributeString("label", label); LLRect rect; @@ -1162,7 +1162,7 @@ LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto callback, NULL); - LLString list_position; + std::string list_position; node->getAttributeString("list_position", list_position); if (list_position == "below") { @@ -1181,9 +1181,9 @@ LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto { if (child->hasName("flyout_button_item")) { - LLString label = child->getTextContents(); + std::string label = child->getTextContents(); - LLString value = label; + std::string value = label; child->getAttributeString("value", value); flyout_button->add(label, LLSD(value) ); @@ -1225,7 +1225,7 @@ void LLFlyoutButton::draw() //FIXME: this should be an attribute of comboboxes, whether they have a distinct label or // the label reflects the last selected item, for now we have to manually remove the label - mButton->setLabel(LLString::null); + mButton->setLabel(LLStringUtil::null); LLComboBox::draw(); } diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 09e8a0e0f4..ce923e277d 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -64,9 +64,9 @@ public: } EPreferredPosition; LLComboBox( - const LLString& name, + const std::string& name, const LLRect &rect, - const LLString& label, + const std::string& label, void (*commit_callback)(LLUICtrl*, void*) = NULL, void *callback_userdata = NULL ); @@ -83,7 +83,7 @@ public: virtual void setEnabled(BOOL enabled); - virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleUnicodeCharHere(llwchar uni_char); @@ -107,10 +107,10 @@ public: void setAllowTextEntry(BOOL allow, S32 max_chars = 50, BOOL make_tentative = TRUE); void setTextEntry(const LLStringExplicit& text); - LLScrollListItem* add(const LLString& name, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); // add item "name" to menu - LLScrollListItem* add(const LLString& name, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); - LLScrollListItem* add(const LLString& name, void* userdata, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); - LLScrollListItem* add(const LLString& name, LLSD value, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); + LLScrollListItem* add(const std::string& name, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); // add item "name" to menu + LLScrollListItem* add(const std::string& name, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); + LLScrollListItem* add(const std::string& name, void* userdata, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); + LLScrollListItem* add(const std::string& name, LLSD value, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM); BOOL remove( S32 index ); // remove item by index, return TRUE if found and removed void removeall() { clearRows(); } @@ -120,15 +120,15 @@ public: // Select current item by name using selectItemByLabel. Returns FALSE if not found. BOOL setSimple(const LLStringExplicit& name); // Get name of current item. Returns an empty string if not found. - const LLString getSimple() const; + const std::string getSimple() const; // Get contents of column x of selected row - const LLString getSelectedItemLabel(S32 column = 0) const; + const std::string getSelectedItemLabel(S32 column = 0) const; // Sets the label, which doesn't have to exist in the label. // This is probably a UI abuse. void setLabel(const LLStringExplicit& name); - BOOL remove(const LLString& name); // remove item "name", return TRUE if found and removed + BOOL remove(const std::string& name); // remove item "name", return TRUE if found and removed BOOL setCurrentByIndex( S32 index ); S32 getCurrentIndex() const; @@ -145,11 +145,11 @@ public: // Overwrites the default column (See LLScrollListCtrl for format) virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); virtual void clearColumns(); - virtual void setColumnLabel(const LLString& column, const LLString& label); + virtual void setColumnLabel(const std::string& column, const std::string& label); virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); - virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); + virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); virtual void clearRows(); - virtual void sortByColumn(LLString name, BOOL ascending); + virtual void sortByColumn(const std::string& name, BOOL ascending); // LLCtrlSelectionInterface functions virtual BOOL getCanSelect() const { return TRUE; } @@ -203,9 +203,9 @@ class LLFlyoutButton : public LLComboBox { public: LLFlyoutButton( - const LLString& name, + const std::string& name, const LLRect &rect, - const LLString& label, + const std::string& label, void (*commit_callback)(LLUICtrl*, void*) = NULL, void *callback_userdata = NULL); diff --git a/indra/llui/llctrlselectioninterface.cpp b/indra/llui/llctrlselectioninterface.cpp index 3dd401973b..589040f345 100644 --- a/indra/llui/llctrlselectioninterface.cpp +++ b/indra/llui/llctrlselectioninterface.cpp @@ -53,12 +53,12 @@ BOOL LLCtrlSelectionInterface::deselectByValue(LLSD value) LLCtrlListInterface::~LLCtrlListInterface() { } -LLScrollListItem* LLCtrlListInterface::addSimpleElement(const LLString& value) +LLScrollListItem* LLCtrlListInterface::addSimpleElement(const std::string& value) { return addSimpleElement(value, ADD_BOTTOM, LLSD()); } -LLScrollListItem* LLCtrlListInterface::addSimpleElement(const LLString& value, EAddPosition pos) +LLScrollListItem* LLCtrlListInterface::addSimpleElement(const std::string& value, EAddPosition pos) { return addSimpleElement(value, pos, LLSD()); } diff --git a/indra/llui/llctrlselectioninterface.h b/indra/llui/llctrlselectioninterface.h index eb89a0833d..2b386e98bb 100644 --- a/indra/llui/llctrlselectioninterface.h +++ b/indra/llui/llctrlselectioninterface.h @@ -84,16 +84,16 @@ public: virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) = 0; virtual void clearColumns() = 0; - virtual void setColumnLabel(const LLString& column, const LLString& label) = 0; + virtual void setColumnLabel(const std::string& column, const std::string& label) = 0; // TomY TODO: Document this virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL) = 0; - LLScrollListItem* addSimpleElement(const LLString& value); // defaults to bottom - LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos); // defaults to no LLSD() id - virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) = 0; + LLScrollListItem* addSimpleElement(const std::string& value); // defaults to bottom + LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos); // defaults to no LLSD() id + virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos, const LLSD& id) = 0; virtual void clearRows() = 0; - virtual void sortByColumn(LLString name, BOOL ascending) = 0; + virtual void sortByColumn(const std::string& name, BOOL ascending) = 0; }; class LLCtrlScrollInterface diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 75e4ad5c08..9538a3f3ae 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -55,7 +55,7 @@ const S32 RIGHT_PAD = BORDER_PAD + 32; // HACK: space for close btn and minimize S32 LLDragHandle::sSnapMargin = 5; -LLDragHandle::LLDragHandle( const LLString& name, const LLRect& rect, const LLString& title ) +LLDragHandle::LLDragHandle( const std::string& name, const LLRect& rect, const std::string& title ) : LLView( name, rect, TRUE ), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), @@ -94,27 +94,27 @@ void LLDragHandle::setTitleBox(LLTextBox* titlebox) } } -LLDragHandleTop::LLDragHandleTop(const LLString& name, const LLRect &rect, const LLString& title) +LLDragHandleTop::LLDragHandleTop(const std::string& name, const LLRect &rect, const std::string& title) : LLDragHandle(name, rect, title) { setFollowsAll(); setTitle( title ); } -LLDragHandleLeft::LLDragHandleLeft(const LLString& name, const LLRect &rect, const LLString& title) +LLDragHandleLeft::LLDragHandleLeft(const std::string& name, const LLRect &rect, const std::string& title) : LLDragHandle(name, rect, title) { setFollowsAll(); setTitle( title ); } -void LLDragHandleTop::setTitle(const LLString& title) +void LLDragHandleTop::setTitle(const std::string& title) { - LLString trimmed_title = title; - LLString::trim(trimmed_title); + std::string trimmed_title = title; + LLStringUtil::trim(trimmed_title); const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); - LLTextBox* titlebox = new LLTextBox( "Drag Handle Title", getRect(), trimmed_title, font ); + LLTextBox* titlebox = new LLTextBox( std::string("Drag Handle Title"), getRect(), trimmed_title, font ); titlebox->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); titlebox->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); @@ -123,22 +123,22 @@ void LLDragHandleTop::setTitle(const LLString& title) } -const LLString& LLDragHandleTop::getTitle() const +const std::string& LLDragHandleTop::getTitle() const { - return getTitleBox() == NULL ? LLString::null : getTitleBox()->getText(); + return getTitleBox() == NULL ? LLStringUtil::null : getTitleBox()->getText(); } -void LLDragHandleLeft::setTitle(const LLString& ) +void LLDragHandleLeft::setTitle(const std::string& ) { setTitleBox(NULL); /* no title on left edge */ } -const LLString& LLDragHandleLeft::getTitle() const +const std::string& LLDragHandleLeft::getTitle() const { - return LLString::null; + return LLStringUtil::null; } diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h index 3635409ec8..c44d2a3568 100644 --- a/indra/llui/lldraghandle.h +++ b/indra/llui/lldraghandle.h @@ -44,7 +44,7 @@ class LLTextBox; class LLDragHandle : public LLView { public: - LLDragHandle(const LLString& name, const LLRect& rect, const LLString& title ); + LLDragHandle(const std::string& name, const LLRect& rect, const std::string& title ); virtual ~LLDragHandle() { setTitleBox(NULL); } virtual void setValue(const LLSD& value); @@ -55,8 +55,8 @@ public: S32 getMaxTitleWidth() const { return mMaxTitleWidth; } void setTitleVisible(BOOL visible); - virtual void setTitle( const LLString& title ) = 0; - virtual const LLString& getTitle() const = 0; + virtual void setTitle( const std::string& title ) = 0; + virtual const std::string& getTitle() const = 0; virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); @@ -88,10 +88,10 @@ class LLDragHandleTop : public LLDragHandle { public: - LLDragHandleTop(const LLString& name, const LLRect& rect, const LLString& title ); + LLDragHandleTop(const std::string& name, const LLRect& rect, const std::string& title ); - virtual void setTitle( const LLString& title ); - virtual const LLString& getTitle() const; + virtual void setTitle( const std::string& title ); + virtual const std::string& getTitle() const; virtual void draw(); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -105,10 +105,10 @@ class LLDragHandleLeft : public LLDragHandle { public: - LLDragHandleLeft(const LLString& name, const LLRect& rect, const LLString& title ); + LLDragHandleLeft(const std::string& name, const LLRect& rect, const std::string& title ); - virtual void setTitle( const LLString& title ); - virtual const LLString& getTitle() const; + virtual void setTitle( const std::string& title ); + virtual const std::string& getTitle() const; virtual void draw(); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 7bb79d4973..18ffbdfbcd 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -56,14 +56,12 @@ #include "lltabcontainer.h" #include "v2math.h" -extern BOOL gNoRender; - const S32 MINIMIZED_WIDTH = 160; const S32 CLOSE_BOX_FROM_TOP = 1; // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; -LLString LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = +std::string LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = { "UIImgBtnCloseActiveUUID", //BUTTON_CLOSE "UIImgBtnRestoreActiveUUID", //BUTTON_RESTORE @@ -72,7 +70,7 @@ LLString LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = "UIImgBtnCloseActiveUUID", //BUTTON_EDIT }; -LLString LLFloater::sButtonInactiveImageNames[BUTTON_COUNT] = +std::string LLFloater::sButtonInactiveImageNames[BUTTON_COUNT] = { "UIImgBtnCloseInactiveUUID", //BUTTON_CLOSE "UIImgBtnRestoreInactiveUUID", //BUTTON_RESTORE @@ -81,7 +79,7 @@ LLString LLFloater::sButtonInactiveImageNames[BUTTON_COUNT] = "UIImgBtnCloseInactiveUUID", //BUTTON_EDIT }; -LLString LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = +std::string LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = { "UIImgBtnClosePressedUUID", //BUTTON_CLOSE "UIImgBtnRestorePressedUUID", //BUTTON_RESTORE @@ -90,7 +88,7 @@ LLString LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = "UIImgBtnClosePressedUUID", //BUTTON_EDIT }; -LLString LLFloater::sButtonNames[BUTTON_COUNT] = +std::string LLFloater::sButtonNames[BUTTON_COUNT] = { "llfloater_close_btn", //BUTTON_CLOSE "llfloater_restore_btn", //BUTTON_RESTORE @@ -99,7 +97,7 @@ LLString LLFloater::sButtonNames[BUTTON_COUNT] = "llfloater_edit_btn", //BUTTON_EDIT }; -LLString LLFloater::sButtonToolTips[BUTTON_COUNT] = +std::string LLFloater::sButtonToolTips[BUTTON_COUNT] = { #ifdef LL_DARWIN "Close (Cmd-W)", //BUTTON_CLOSE @@ -145,7 +143,7 @@ LLFloater::LLFloater() : mHandle.bind(this); } -LLFloater::LLFloater(const LLString& name) +LLFloater::LLFloater(const std::string& name) : LLPanel(name), mAutoFocus(TRUE) // automatically take focus when opened { for (S32 i = 0; i < BUTTON_COUNT; i++) @@ -153,12 +151,12 @@ LLFloater::LLFloater(const LLString& name) mButtonsEnabled[i] = FALSE; mButtons[i] = NULL; } - LLString title; // null string + std::string title; // null string initFloater(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults } -LLFloater::LLFloater(const LLString& name, const LLRect& rect, const LLString& title, +LLFloater::LLFloater(const std::string& name, const LLRect& rect, const std::string& title, BOOL resizable, S32 min_width, S32 min_height, @@ -176,7 +174,7 @@ LLFloater::LLFloater(const LLString& name, const LLRect& rect, const LLString& t initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); } -LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const LLString& title, +LLFloater::LLFloater(const std::string& name, const std::string& rect_control, const std::string& title, BOOL resizable, S32 min_width, S32 min_height, @@ -196,7 +194,7 @@ LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const L // Note: Floaters constructed from XML call init() twice! -void LLFloater::initFloater(const LLString& title, +void LLFloater::initFloater(const std::string& title, BOOL resizable, S32 min_width, S32 min_height, BOOL drag_on_left, BOOL minimizable, BOOL close_btn) { @@ -291,12 +289,12 @@ void LLFloater::initFloater(const LLString& title, 0, 0, DRAG_HANDLE_WIDTH, getRect().getHeight() - LLPANEL_BORDER_WIDTH - close_box_size); - mDragHandle = new LLDragHandleLeft("drag", drag_handle_rect, title ); + mDragHandle = new LLDragHandleLeft(std::string("drag"), drag_handle_rect, title ); } else // drag on top { LLRect drag_handle_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mDragHandle = new LLDragHandleTop( "Drag Handle", drag_handle_rect, title ); + mDragHandle = new LLDragHandleTop( std::string("Drag Handle"), drag_handle_rect, title ); } addChild(mDragHandle); @@ -310,28 +308,28 @@ void LLFloater::initFloater(const LLString& title, // Resize bars (sides) const S32 RESIZE_BAR_THICKNESS = 3; mResizeBar[LLResizeBar::LEFT] = new LLResizeBar( - "resizebar_left", + std::string("resizebar_left"), this, LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0), min_width, S32_MAX, LLResizeBar::LEFT ); addChild( mResizeBar[0] ); mResizeBar[LLResizeBar::TOP] = new LLResizeBar( - "resizebar_top", + std::string("resizebar_top"), this, LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS), min_height, S32_MAX, LLResizeBar::TOP ); addChild( mResizeBar[1] ); mResizeBar[LLResizeBar::RIGHT] = new LLResizeBar( - "resizebar_right", + std::string("resizebar_right"), this, LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), min_width, S32_MAX, LLResizeBar::RIGHT ); addChild( mResizeBar[2] ); mResizeBar[LLResizeBar::BOTTOM] = new LLResizeBar( - "resizebar_bottom", + std::string("resizebar_bottom"), this, LLRect( 0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0), min_height, S32_MAX, LLResizeBar::BOTTOM ); @@ -340,28 +338,29 @@ void LLFloater::initFloater(const LLString& title, // Resize handles (corners) mResizeHandle[0] = new LLResizeHandle( - "Resize Handle", + std::string("Resize Handle"), LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0), min_width, min_height, LLResizeHandle::RIGHT_BOTTOM); addChild(mResizeHandle[0]); - mResizeHandle[1] = new LLResizeHandle( "resize", + mResizeHandle[1] = new LLResizeHandle( + std::string("resize"), LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT), min_width, min_height, LLResizeHandle::RIGHT_TOP ); addChild(mResizeHandle[1]); - mResizeHandle[2] = new LLResizeHandle( "resize", - LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), - min_width, - min_height, - LLResizeHandle::LEFT_BOTTOM ); + mResizeHandle[2] = new LLResizeHandle( std::string("resize"), + LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), + min_width, + min_height, + LLResizeHandle::LEFT_BOTTOM ); addChild(mResizeHandle[2]); - mResizeHandle[3] = new LLResizeHandle( "resize", + mResizeHandle[3] = new LLResizeHandle( std::string("resize"), LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ), min_width, min_height, @@ -650,7 +649,7 @@ void LLFloater::applyRectControl() } } -void LLFloater::setTitle( const LLString& title ) +void LLFloater::setTitle( const std::string& title ) { if (gNoRender) { @@ -660,21 +659,21 @@ void LLFloater::setTitle( const LLString& title ) mDragHandle->setTitle( title ); } -const LLString& LLFloater::getTitle() const +const std::string& LLFloater::getTitle() const { - return mDragHandle ? mDragHandle->getTitle() : LLString::null; + return mDragHandle ? mDragHandle->getTitle() : LLStringUtil::null; } -void LLFloater::setShortTitle( const LLString& short_title ) +void LLFloater::setShortTitle( const std::string& short_title ) { mShortTitle = short_title; } -LLString LLFloater::getShortTitle() +std::string LLFloater::getShortTitle() { if (mShortTitle.empty()) { - return mDragHandle ? mDragHandle->getTitle() : LLString::null; + return mDragHandle ? mDragHandle->getTitle() : LLStringUtil::null; } else { @@ -841,7 +840,7 @@ void LLFloater::setMinimized(BOOL minimize) mResizeHandle[i]->setEnabled(FALSE); } } - + mMinimized = TRUE; // Reshape *after* setting mMinimized @@ -890,7 +889,7 @@ void LLFloater::setMinimized(BOOL minimize) mResizeHandle[i]->setEnabled(isResizable()); } } - + mMinimized = FALSE; // Reshape *after* setting mMinimized @@ -1484,28 +1483,28 @@ void LLFloater::setCanResize(BOOL can_resize) // Resize bars (sides) const S32 RESIZE_BAR_THICKNESS = 3; mResizeBar[0] = new LLResizeBar( - "resizebar_left", + std::string("resizebar_left"), this, LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0), mMinWidth, S32_MAX, LLResizeBar::LEFT ); addChild( mResizeBar[0] ); mResizeBar[1] = new LLResizeBar( - "resizebar_top", + std::string("resizebar_top"), this, LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS), mMinHeight, S32_MAX, LLResizeBar::TOP ); addChild( mResizeBar[1] ); mResizeBar[2] = new LLResizeBar( - "resizebar_right", + std::string("resizebar_right"), this, LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), mMinWidth, S32_MAX, LLResizeBar::RIGHT ); addChild( mResizeBar[2] ); mResizeBar[3] = new LLResizeBar( - "resizebar_bottom", + std::string("resizebar_bottom"), this, LLRect( 0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0), mMinHeight, S32_MAX, LLResizeBar::BOTTOM ); @@ -1514,28 +1513,28 @@ void LLFloater::setCanResize(BOOL can_resize) // Resize handles (corners) mResizeHandle[0] = new LLResizeHandle( - "Resize Handle", + std::string("Resize Handle"), LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0), mMinWidth, mMinHeight, LLResizeHandle::RIGHT_BOTTOM); addChild(mResizeHandle[0]); - mResizeHandle[1] = new LLResizeHandle( "resize", + mResizeHandle[1] = new LLResizeHandle( std::string("resize"), LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT), mMinWidth, mMinHeight, LLResizeHandle::RIGHT_TOP ); addChild(mResizeHandle[1]); - mResizeHandle[2] = new LLResizeHandle( "resize", - LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), - mMinWidth, - mMinHeight, - LLResizeHandle::LEFT_BOTTOM ); + mResizeHandle[2] = new LLResizeHandle( std::string("resize"), + LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), + mMinWidth, + mMinHeight, + LLResizeHandle::LEFT_BOTTOM ); addChild(mResizeHandle[2]); - mResizeHandle[3] = new LLResizeHandle( "resize", + mResizeHandle[3] = new LLResizeHandle( std::string("resize"), LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ), mMinWidth, mMinHeight, @@ -1633,7 +1632,7 @@ void LLFloater::buildButtons() btn_rect, sButtonActiveImageNames[i], sButtonPressedImageNames[i], - "", + LLStringUtil::null, sButtonCallbacks[i], this, LLFontGL::sSansSerif); @@ -1657,7 +1656,7 @@ void LLFloater::buildButtons() ///////////////////////////////////////////////////// // LLFloaterView -LLFloaterView::LLFloaterView( const LLString& name, const LLRect& rect ) +LLFloaterView::LLFloaterView( const std::string& name, const LLRect& rect ) : LLUICtrl( name, rect, FALSE, NULL, NULL, FOLLOWS_ALL ), mFocusCycleMode(FALSE), mSnapOffsetBottom(0) @@ -2377,7 +2376,7 @@ LLMultiFloater::LLMultiFloater(LLTabContainer::TabPosition tab_pos) : } -LLMultiFloater::LLMultiFloater(const LLString &name) : +LLMultiFloater::LLMultiFloater(const std::string &name) : LLFloater(name), mTabContainer(NULL), mTabPos(LLTabContainer::TOP), @@ -2388,7 +2387,7 @@ LLMultiFloater::LLMultiFloater(const LLString &name) : } LLMultiFloater::LLMultiFloater( - const LLString& name, + const std::string& name, const LLRect& rect, LLTabContainer::TabPosition tab_pos, BOOL auto_resize) : @@ -2399,7 +2398,7 @@ LLMultiFloater::LLMultiFloater( mOrigMinWidth(0), mOrigMinHeight(0) { - mTabContainer = new LLTabContainer("Preview Tabs", + mTabContainer = new LLTabContainer(std::string("Preview Tabs"), LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), mTabPos, FALSE, @@ -2414,8 +2413,8 @@ LLMultiFloater::LLMultiFloater( } LLMultiFloater::LLMultiFloater( - const LLString& name, - const LLString& rect_control, + const std::string& name, + const std::string& rect_control, LLTabContainer::TabPosition tab_pos, BOOL auto_resize) : LLFloater(name, rect_control, name), @@ -2425,7 +2424,7 @@ LLMultiFloater::LLMultiFloater( mOrigMinWidth(0), mOrigMinHeight(0) { - mTabContainer = new LLTabContainer("Preview Tabs", + mTabContainer = new LLTabContainer(std::string("Preview Tabs"), LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), mTabPos, FALSE, @@ -2885,12 +2884,12 @@ LLXMLNodePtr LLFloater::getXML(bool save_children) const // static LLView* LLFloater::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("floater"); + std::string name("floater"); node->getAttributeString("name", name); LLFloater *floaterp = new LLFloater(name); - LLString filename; + std::string filename; node->getAttributeString("filename", filename); if (filename.empty()) @@ -2909,10 +2908,10 @@ LLView* LLFloater::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory, BOOL open) /* Flawfinder: ignore */ { - LLString name(getName()); - LLString title(getTitle()); - LLString short_title(getShortTitle()); - LLString rect_control(""); + std::string name(getName()); + std::string title(getTitle()); + std::string short_title(getShortTitle()); + std::string rect_control(""); BOOL resizable = isResizable(); S32 min_width = getMinWidth(); S32 min_height = getMinHeight(); diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 4e8b86d2de..cb21036ef4 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -86,8 +86,8 @@ public: }; LLFloater(); - LLFloater(const LLString& name); //simple constructor for data-driven initialization - LLFloater( const LLString& name, const LLRect& rect, const LLString& title, + LLFloater(const std::string& name); //simple constructor for data-driven initialization + LLFloater( const std::string& name, const LLRect& rect, const std::string& title, BOOL resizable = FALSE, S32 min_width = DEFAULT_MIN_WIDTH, S32 min_height = DEFAULT_MIN_HEIGHT, @@ -96,7 +96,7 @@ public: BOOL close_btn = TRUE, BOOL bordered = BORDER_NO); - LLFloater( const LLString& name, const LLString& rect_control, const LLString& title, + LLFloater( const std::string& name, const std::string& rect_control, const std::string& title, BOOL resizable = FALSE, S32 min_width = DEFAULT_MIN_WIDTH, S32 min_height = DEFAULT_MIN_HEIGHT, @@ -119,7 +119,7 @@ public: // Can be called multiple times to reset floater parameters. // Deletes all children of the floater. - virtual void initFloater(const LLString& title, BOOL resizable, + virtual void initFloater(const std::string& title, BOOL resizable, S32 min_width, S32 min_height, BOOL drag_on_left, BOOL minimizable, BOOL close_btn); @@ -142,10 +142,10 @@ public: LLMultiFloater* getHost() { return (LLMultiFloater*)mHostHandle.get(); } - void setTitle( const LLString& title ); - const LLString& getTitle() const; - void setShortTitle( const LLString& short_title ); - LLString getShortTitle(); + void setTitle( const std::string& title ); + const std::string& getTitle() const; + void setShortTitle( const std::string& short_title ); + std::string getShortTitle(); void setTitleVisible(bool visible); virtual void setMinimized(BOOL b); void moveResizeHandlesToFront(); @@ -246,7 +246,7 @@ private: BOOL mMinimized; BOOL mForeground; LLHandle<LLFloater> mDependeeHandle; - LLString mShortTitle; + std::string mShortTitle; BOOL mFirstLook; // TRUE if the _next_ time this floater is visible will be the first time in the session that it is visible. @@ -272,11 +272,11 @@ private: static LLMultiFloater* sHostp; static BOOL sEditModeEnabled; - static LLString sButtonActiveImageNames[BUTTON_COUNT]; - static LLString sButtonInactiveImageNames[BUTTON_COUNT]; - static LLString sButtonPressedImageNames[BUTTON_COUNT]; - static LLString sButtonNames[BUTTON_COUNT]; - static LLString sButtonToolTips[BUTTON_COUNT]; + static std::string sButtonActiveImageNames[BUTTON_COUNT]; + static std::string sButtonInactiveImageNames[BUTTON_COUNT]; + static std::string sButtonPressedImageNames[BUTTON_COUNT]; + static std::string sButtonNames[BUTTON_COUNT]; + static std::string sButtonToolTips[BUTTON_COUNT]; typedef void (*click_callback)(void *); static click_callback sButtonCallbacks[BUTTON_COUNT]; @@ -301,7 +301,7 @@ private: class LLFloaterView : public LLUICtrl { public: - LLFloaterView( const LLString& name, const LLRect& rect ); + LLFloaterView( const std::string& name, const LLRect& rect ); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); void reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical); @@ -361,9 +361,9 @@ class LLMultiFloater : public LLFloater public: LLMultiFloater(); LLMultiFloater(LLTabContainer::TabPosition tab_pos); - LLMultiFloater(const LLString& name); - LLMultiFloater(const LLString& name, const LLRect& rect, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); - LLMultiFloater(const LLString& name, const LLString& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); + LLMultiFloater(const std::string& name); + LLMultiFloater(const std::string& name, const LLRect& rect, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); + LLMultiFloater(const std::string& name, const std::string& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); virtual ~LLMultiFloater() {}; virtual BOOL postBuild(); diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 621b01ad82..fce84eb2e8 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -120,7 +120,7 @@ void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock, BOOL keystroke mFocusTimer.reset(); #ifdef _DEBUG - mKeyboardFocusName = new_focus ? new_focus->getName() : "none"; + mKeyboardFocusName = new_focus ? new_focus->getName() : std::string("none"); #endif // If we've got a default keyboard focus, and the caller is @@ -202,7 +202,7 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLView* focus ) { mKeyboardFocus = NULL; #ifdef _DEBUG - mKeyboardFocusName = "none"; + mKeyboardFocusName = std::string("none"); #endif } } @@ -243,7 +243,7 @@ void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor ) } #ifdef _DEBUG - mMouseCaptorName = new_captor ? new_captor->getName() : "none"; + mMouseCaptorName = new_captor ? new_captor->getName() : std::string("none"); #endif } } @@ -258,7 +258,7 @@ void LLFocusMgr::removeMouseCaptureWithoutCallback( const LLMouseHandler* captor { mMouseCaptor = NULL; #ifdef _DEBUG - mMouseCaptorName = "none"; + mMouseCaptorName = std::string("none"); #endif } } @@ -289,7 +289,7 @@ void LLFocusMgr::setTopCtrl( LLUICtrl* new_top ) mTopCtrl = new_top; #ifdef _DEBUG - mTopCtrlName = new_top ? new_top->getName() : "none"; + mTopCtrlName = new_top ? new_top->getName() : std::string("none"); #endif if (old_top) @@ -305,7 +305,7 @@ void LLFocusMgr::removeTopCtrlWithoutCallback( const LLUICtrl* top_view ) { mTopCtrl = NULL; #ifdef _DEBUG - mTopCtrlName = "none"; + mTopCtrlName = std::string("none"); #endif } } diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index 34651160f1..3cb45b73ca 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -114,9 +114,9 @@ private: focus_history_map_t mFocusHistory; #ifdef _DEBUG - LLString mMouseCaptorName; - LLString mKeyboardFocusName; - LLString mTopCtrlName; + std::string mMouseCaptorName; + std::string mKeyboardFocusName; + std::string mTopCtrlName; #endif }; diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index df37532d60..2638bdc3e5 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -44,7 +44,7 @@ const F32 RESOLUTION_BUMP = 1.f; static LLRegisterWidget<LLIconCtrl> r("icon"); -LLIconCtrl::LLIconCtrl(const LLString& name, const LLRect &rect, const LLUUID &image_id) +LLIconCtrl::LLIconCtrl(const std::string& name, const LLRect &rect, const LLUUID &image_id) : LLUICtrl(name, rect, FALSE, // mouse opaque @@ -56,7 +56,7 @@ LLIconCtrl::LLIconCtrl(const LLString& name, const LLRect &rect, const LLUUID &i setTabStop(FALSE); } -LLIconCtrl::LLIconCtrl(const LLString& name, const LLRect &rect, const LLString &image_name) +LLIconCtrl::LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name) : LLUICtrl(name, rect, FALSE, // mouse opaque @@ -76,7 +76,7 @@ LLIconCtrl::~LLIconCtrl() } -void LLIconCtrl::setImage(const LLString& image_name) +void LLIconCtrl::setImage(const std::string& image_name) { //RN: support UUIDs masquerading as strings if (LLUUID::validate(image_name)) @@ -148,13 +148,13 @@ LLXMLNodePtr LLIconCtrl::getXML(bool save_children) const LLView* LLIconCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("icon"); + std::string name("icon"); node->getAttributeString("name", name); LLRect rect; createRect(node, rect, parent, LLRect()); - LLString image_name; + std::string image_name; if (node->hasAttribute("image_name")) { node->getAttributeString("image_name", image_name); diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 33429c580e..f1b3a7e03f 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -48,17 +48,17 @@ class LLIconCtrl : public LLUICtrl { public: - LLIconCtrl(const LLString& name, const LLRect &rect, const LLUUID &image_id); - LLIconCtrl(const LLString& name, const LLRect &rect, const LLString &image_name); + LLIconCtrl(const std::string& name, const LLRect &rect, const LLUUID &image_id); + LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name); virtual ~LLIconCtrl(); // llview overrides virtual void draw(); - void setImage(const LLString& image_name); + void setImage(const std::string& image_name); void setImage(const LLUUID& image_name); const LLUUID &getImage() const { return mImageID; } - LLString getImageName() const { return mImageName; } + std::string getImageName() const { return mImageName; } // Takes a UUID, wraps get/setImage virtual void setValue(const LLSD& value ); @@ -71,7 +71,7 @@ public: private: LLColor4 mColor; - LLString mImageName; + std::string mImageName; LLUUID mImageID; LLPointer<LLUIImage> mImagep; }; diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index a81e26f880..e6a87b496c 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -69,7 +69,7 @@ LLKeywords::~LLKeywords() std::for_each(mDelimiterTokenList.begin(), mDelimiterTokenList.end(), DeletePointer()); } -BOOL LLKeywords::loadFromFile( const LLString& filename ) +BOOL LLKeywords::loadFromFile( const std::string& filename ) { mLoaded = FALSE; @@ -80,7 +80,7 @@ BOOL LLKeywords::loadFromFile( const LLString& filename ) char buffer[BUFFER_SIZE]; /* Flawfinder: ignore */ llifstream file; - file.open(filename.c_str()); /* Flawfinder: ignore */ + file.open(filename); /* Flawfinder: ignore */ if( file.fail() ) { llinfos << "LLKeywords::loadFromFile() Unable to open file: " << filename << llendl; @@ -106,52 +106,51 @@ BOOL LLKeywords::loadFromFile( const LLString& filename ) } // start of line (SOL) - const char SOL_COMMENT[] = "#"; - const char SOL_WORD[] = "[word "; - const char SOL_LINE[] = "[line "; - const char SOL_ONE_SIDED_DELIMITER[] = "[one_sided_delimiter "; - const char SOL_TWO_SIDED_DELIMITER[] = "[two_sided_delimiter "; + std::string SOL_COMMENT("#"); + std::string SOL_WORD("[word "); + std::string SOL_LINE("[line "); + std::string SOL_ONE_SIDED_DELIMITER("[one_sided_delimiter "); + std::string SOL_TWO_SIDED_DELIMITER("[two_sided_delimiter "); LLColor3 cur_color( 1, 0, 0 ); LLKeywordToken::TOKEN_TYPE cur_type = LLKeywordToken::WORD; while (!file.eof()) { + buffer[0] = 0; file.getline( buffer, BUFFER_SIZE ); - if( !strncmp( buffer, SOL_COMMENT, strlen(SOL_COMMENT) ) ) /* Flawfinder: ignore */ + std::string line(buffer); + if( line.find(SOL_COMMENT) == 0 ) { continue; } - else - if( !strncmp( buffer, SOL_WORD, strlen(SOL_WORD) ) ) /* Flawfinder: ignore */ + else if( line.find(SOL_WORD) == 0 ) { - cur_color = readColor( buffer + strlen(SOL_WORD) ); /* Flawfinder: ignore */ + cur_color = readColor( line.substr(SOL_WORD.size()) ); cur_type = LLKeywordToken::WORD; continue; } - else - if( !strncmp( buffer, SOL_LINE, strlen(SOL_LINE) ) ) /* Flawfinder: ignore */ + else if( line.find(SOL_LINE) == 0 ) { - cur_color = readColor( buffer + strlen(SOL_LINE) ); /* Flawfinder: ignore */ + cur_color = readColor( line.substr(SOL_LINE.size()) ); cur_type = LLKeywordToken::LINE; continue; } - else - if( !strncmp( buffer, SOL_TWO_SIDED_DELIMITER, strlen(SOL_TWO_SIDED_DELIMITER) ) ) /* Flawfinder: ignore */ + else if( line.find(SOL_TWO_SIDED_DELIMITER) == 0 ) { - cur_color = readColor( buffer + strlen(SOL_TWO_SIDED_DELIMITER) ); /* Flawfinder: ignore */ + cur_color = readColor( line.substr(SOL_TWO_SIDED_DELIMITER.size()) ); cur_type = LLKeywordToken::TWO_SIDED_DELIMITER; continue; } - if( !strncmp( buffer, SOL_ONE_SIDED_DELIMITER, strlen(SOL_ONE_SIDED_DELIMITER) ) ) /* Flawfinder: ignore */ + else if( line.find(SOL_ONE_SIDED_DELIMITER) == 0 ) { - cur_color = readColor( buffer + strlen(SOL_ONE_SIDED_DELIMITER) ); /* Flawfinder: ignore */ + cur_color = readColor( line.substr(SOL_ONE_SIDED_DELIMITER.size()) ); cur_type = LLKeywordToken::ONE_SIDED_DELIMITER; continue; } - LLString token_buffer( buffer ); - LLString::trim(token_buffer); + std::string token_buffer( line ); + LLStringUtil::trim(token_buffer); typedef boost::tokenizer<boost::char_separator<char> > tokenizer; boost::char_separator<char> sep_word("", " \t"); @@ -161,26 +160,26 @@ BOOL LLKeywords::loadFromFile( const LLString& filename ) if( !token_buffer.empty() && token_word_iter != word_tokens.end() ) { // first word is keyword - LLString keyword = (*token_word_iter); - LLString::trim(keyword); + std::string keyword = (*token_word_iter); + LLStringUtil::trim(keyword); // following words are tooltip - LLString tool_tip; + std::string tool_tip; while (++token_word_iter != word_tokens.end()) { tool_tip += (*token_word_iter); } - LLString::trim(tool_tip); + LLStringUtil::trim(tool_tip); if( !tool_tip.empty() ) { // Replace : with \n for multi-line tool tips. - LLString::replaceChar( tool_tip, ':', '\n' ); + LLStringUtil::replaceChar( tool_tip, ':', '\n' ); addToken(cur_type, keyword, cur_color, tool_tip ); } else { - addToken(cur_type, keyword, cur_color, NULL ); + addToken(cur_type, keyword, cur_color, LLStringUtil::null ); } } } @@ -193,9 +192,9 @@ BOOL LLKeywords::loadFromFile( const LLString& filename ) // Add the token as described void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type, - const LLString& key_in, + const std::string& key_in, const LLColor3& color, - const LLString& tool_tip_in ) + const std::string& tool_tip_in ) { LLWString key = utf8str_to_wstring(key_in); LLWString tool_tip = utf8str_to_wstring(tool_tip_in); @@ -219,7 +218,7 @@ void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type, } } -LLColor3 LLKeywords::readColor( const LLString& s ) +LLColor3 LLKeywords::readColor( const std::string& s ) { F32 r, g, b; r = g = b = 0.0f; @@ -296,7 +295,6 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS } S32 seg_end = cur - base; - //llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start) << "]" << llendl; LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end ); text_segment->setToken( cur_token ); insertSegment( seg_list, text_segment, text_len, defaultColor); @@ -406,7 +404,6 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS } - //llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start ) << "]" << llendl; LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end ); text_segment->setToken( cur_delimiter ); insertSegment( seg_list, text_segment, text_len, defaultColor); @@ -518,7 +515,7 @@ void LLKeywordToken::dump() mColor.mV[VX] << ", " << mColor.mV[VY] << ", " << mColor.mV[VZ] << "] [" << - mToken.c_str() << "]" << + wstring_to_utf8str(mToken) << "]" << llendl; } diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index fe36d7cbf6..ec01db76a8 100644 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -80,16 +80,16 @@ public: LLKeywords(); ~LLKeywords(); - BOOL loadFromFile(const LLString& filename); + BOOL loadFromFile(const std::string& filename); BOOL isLoaded() const { return mLoaded; } void findSegments(std::vector<LLTextSegment *> *seg_list, const LLWString& text, const LLColor4 &defaultColor ); // Add the token as described void addToken(LLKeywordToken::TOKEN_TYPE type, - const LLString& key, + const std::string& key, const LLColor3& color, - const LLString& tool_tip = LLString::null); + const std::string& tool_tip = LLStringUtil::null); typedef std::map<LLWString, LLKeywordToken*> word_token_map_t; typedef word_token_map_t::const_iterator keyword_iterator_t; @@ -101,7 +101,7 @@ public: #endif private: - LLColor3 readColor(const LLString& s); + LLColor3 readColor(const std::string& s); void insertSegment(std::vector<LLTextSegment *> *seg_list, LLTextSegment* new_segment, S32 text_len, const LLColor4 &defaultColor); BOOL mLoaded; diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 96039ce943..2655918169 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -87,8 +87,8 @@ static LLRegisterWidget<LLLineEditor> r1("line_editor"); // Member functions // -LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, - const LLString& default_text, const LLFontGL* font, +LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect, + const std::string& default_text, const LLFontGL* font, S32 max_length_bytes, void (*commit_callback)(LLUICtrl* caller, void* user_data ), void (*keystroke_callback)(LLLineEditor* caller, void* user_data ), @@ -166,7 +166,7 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, // Scalable UI somehow made these rectangles off-by-one. // I don't know why. JC LLRect border_rect(0, getRect().getHeight()-1, getRect().getWidth()-1, 0); - mBorder = new LLViewBorder( "line ed border", border_rect, border_bevel, border_style, mBorderThickness ); + mBorder = new LLViewBorder( std::string("line ed border"), border_rect, border_bevel, border_style, mBorderThickness ); addChild( mBorder ); mBorder->setFollows(FOLLOWS_LEFT|FOLLOWS_RIGHT|FOLLOWS_TOP|FOLLOWS_BOTTOM); @@ -298,7 +298,7 @@ void LLLineEditor::setText(const LLStringExplicit &new_text) // also consider entire string selected when mSelectAllonFocusReceived is set on an empty, focused line editor all_selected = all_selected || (len == 0 && hasFocus() && mSelectAllonFocusReceived); - LLString truncated_utf8 = new_text; + std::string truncated_utf8 = new_text; if (truncated_utf8.size() > (U32)mMaxLengthBytes) { truncated_utf8 = utf8str_truncate(new_text, mMaxLengthBytes); @@ -959,9 +959,9 @@ void LLLineEditor::paste() // Clean up string (replace tabs and returns and remove characters that our fonts don't support.) LLWString clean_string(paste); - LLWString::replaceTabsWithSpaces(clean_string, 1); + LLWStringUtil::replaceTabsWithSpaces(clean_string, 1); //clean_string = wstring_detabify(paste, 1); - LLWString::replaceChar(clean_string, '\n', mReplaceNewlinesWithSpaces ? ' ' : 182); // 182 == paragraph character + LLWStringUtil::replaceChar(clean_string, '\n', mReplaceNewlinesWithSpaces ? ' ' : 182); // 182 == paragraph character // Insert the string @@ -1395,11 +1395,11 @@ void LLLineEditor::draw() { S32 text_len = mText.length(); - LLString saved_text; + std::string saved_text; if (mDrawAsterixes) { saved_text = mText.getString(); - LLString text; + std::string text; for (S32 i = 0; i < mText.length(); i++) { text += '*'; @@ -1594,7 +1594,7 @@ void LLLineEditor::draw() S32 cursor_right = cursor_left + UI_LINEEDITOR_CURSOR_THICKNESS; if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) { - const LLWString space(utf8str_to_wstring(LLString(" "))); + const LLWString space(utf8str_to_wstring(std::string(" "))); S32 wswidth = mGLFont->getWidth(space.c_str()); S32 width = mGLFont->getWidth(mText.getWString().c_str(), getCursor(), 1) + 1; cursor_right = cursor_left + llmax(wswidth, width); @@ -1771,7 +1771,7 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str) BOOL success = TRUE; LLWString trimmed = str; - LLWString::trim(trimmed); + LLWStringUtil::trim(trimmed); S32 len = trimmed.length(); if( 0 < len ) { @@ -1803,7 +1803,7 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str) BOOL LLLineEditor::isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } // static -BOOL LLLineEditor::postvalidateFloat(const LLString &str) +BOOL LLLineEditor::postvalidateFloat(const std::string &str) { LLLocale locale(LLLocale::USER_LOCALE); @@ -1812,7 +1812,7 @@ BOOL LLLineEditor::postvalidateFloat(const LLString &str) BOOL has_digit = FALSE; LLWString trimmed = utf8str_to_wstring(str); - LLWString::trim(trimmed); + LLWStringUtil::trim(trimmed); S32 len = trimmed.length(); if( 0 < len ) { @@ -1872,7 +1872,7 @@ BOOL LLLineEditor::prevalidateInt(const LLWString &str) BOOL success = TRUE; LLWString trimmed = str; - LLWString::trim(trimmed); + LLWStringUtil::trim(trimmed); S32 len = trimmed.length(); if( 0 < len ) { @@ -1903,7 +1903,7 @@ BOOL LLLineEditor::prevalidatePositiveS32(const LLWString &str) LLLocale locale(LLLocale::USER_LOCALE); LLWString trimmed = str; - LLWString::trim(trimmed); + LLWStringUtil::trim(trimmed); S32 len = trimmed.length(); BOOL success = TRUE; if(0 < len) @@ -1937,7 +1937,7 @@ BOOL LLLineEditor::prevalidateNonNegativeS32(const LLWString &str) LLLocale locale(LLLocale::USER_LOCALE); LLWString trimmed = str; - LLWString::trim(trimmed); + LLWStringUtil::trim(trimmed); S32 len = trimmed.length(); BOOL success = TRUE; if(0 < len) @@ -2092,7 +2092,7 @@ LLXMLNodePtr LLLineEditor::getXML(bool save_children) const if (mBorder) { - LLString bevel; + std::string bevel; switch(mBorder->getBevel()) { default: @@ -2103,7 +2103,7 @@ LLXMLNodePtr LLLineEditor::getXML(bool save_children) const } node->createChild("bevel_style", TRUE)->setStringValue(bevel); - LLString style; + std::string style; switch(mBorder->getStyle()) { default: @@ -2140,7 +2140,7 @@ LLXMLNodePtr LLLineEditor::getXML(bool save_children) const // static LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("line_editor"); + std::string name("line_editor"); node->getAttributeString("name", name); LLRect rect; @@ -2151,15 +2151,15 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory LLFontGL* font = LLView::selectFont(node); - LLString text = node->getTextContents().substr(0, max_text_length - 1); + std::string text = node->getTextContents().substr(0, max_text_length - 1); LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_IN; LLViewBorder::getBevelFromAttribute(node, bevel_style); LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; - LLString border_string; + std::string border_string; node->getAttributeString("border_style", border_string); - LLString::toLower(border_string); + LLStringUtil::toLower(border_string); if (border_string == "texture") { @@ -2185,7 +2185,7 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory border_style, border_thickness); - LLString label; + std::string label; if(node->getAttributeString("label", label)) { line_editor->setLabel(label); @@ -2215,10 +2215,10 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory line_editor->setSelectAllonFocusReceived(selectall); } - LLString prevalidate; + std::string prevalidate; if(node->getAttributeString("prevalidate", prevalidate)) { - LLString::toLower(prevalidate); + LLStringUtil::toLower(prevalidate); if ("ascii" == prevalidate) { @@ -2270,11 +2270,11 @@ void LLLineEditor::cleanupClass() } /* static */ -LLPointer<LLUIImage> LLLineEditor::parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def) +LLPointer<LLUIImage> LLLineEditor::parseImage(std::string name, LLXMLNodePtr from, LLPointer<LLUIImage> def) { - LLString xml_name; - if (from->hasAttribute(name)) from->getAttributeString(name, xml_name); - if (xml_name == LLString::null) return def; + std::string xml_name; + if (from->hasAttribute(name.c_str())) from->getAttributeString(name.c_str(), xml_name); + if (xml_name == LLStringUtil::null) return def; LLPointer<LLUIImage> image = LLUI::getUIImage(xml_name); return image.isNull() ? def : image; } @@ -2282,7 +2282,7 @@ LLPointer<LLUIImage> LLLineEditor::parseImage(LLString name, LLXMLNodePtr from, void LLLineEditor::setColorParameters(LLXMLNodePtr node) { // overrides default image if supplied. - mImage = parseImage("image", node, mImage); + mImage = parseImage(std::string("image"), node, mImage); LLColor4 color; if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color)) @@ -2315,13 +2315,13 @@ void LLLineEditor::setColorParameters(LLXMLNodePtr node) } } -BOOL LLLineEditor::setTextArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLLineEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) { mText.setArg(key, text); return TRUE; } -BOOL LLLineEditor::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLLineEditor::setLabelArg( const std::string& key, const LLStringExplicit& text ) { mLabel.setArg(key, text); return TRUE; @@ -2555,25 +2555,25 @@ void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace) static LLRegisterWidget<LLSearchEditor> r2("search_editor"); -LLSearchEditor::LLSearchEditor(const LLString& name, +LLSearchEditor::LLSearchEditor(const std::string& name, const LLRect& rect, S32 max_length_bytes, - void (*search_callback)(const LLString& search_string, void* user_data), + void (*search_callback)(const std::string& search_string, void* user_data), void* userdata) : LLUICtrl(name, rect, TRUE, NULL, userdata), mSearchCallback(search_callback) { LLRect search_edit_rect(0, getRect().getHeight(), getRect().getWidth(), 0); - mSearchEdit = new LLLineEditor("search edit", - search_edit_rect, - LLString::null, - NULL, - max_length_bytes, - NULL, - onSearchEdit, - NULL, - this); + mSearchEdit = new LLLineEditor(std::string("search edit"), + search_edit_rect, + LLStringUtil::null, + NULL, + max_length_bytes, + NULL, + onSearchEdit, + NULL, + this); mSearchEdit->setFollowsAll(); mSearchEdit->setSelectAllonFocusReceived(TRUE); @@ -2582,15 +2582,15 @@ LLSearchEditor::LLSearchEditor(const LLString& name, S32 btn_width = rect.getHeight(); // button is square, and as tall as search editor LLRect clear_btn_rect(rect.getWidth() - btn_width, rect.getHeight(), rect.getWidth(), 0); - mClearSearchButton = new LLButton("clear search", + mClearSearchButton = new LLButton(std::string("clear search"), clear_btn_rect, - "icn_clear_lineeditor.tga", - "UIImgBtnCloseInactiveUUID", - LLString::null, + std::string("icn_clear_lineeditor.tga"), + std::string("UIImgBtnCloseInactiveUUID"), + LLStringUtil::null, onClearSearch, this, NULL, - LLString::null); + LLStringUtil::null); mClearSearchButton->setFollowsRight(); mClearSearchButton->setFollowsTop(); mClearSearchButton->setImageColor(LLUI::sColorsGroup->getColor("TextFgTentativeColor")); @@ -2614,13 +2614,13 @@ LLSD LLSearchEditor::getValue() const } //virtual -BOOL LLSearchEditor::setTextArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLSearchEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) { return mSearchEdit->setTextArg(key, text); } //virtual -BOOL LLSearchEditor::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLSearchEditor::setLabelArg( const std::string& key, const LLStringExplicit& text ) { return mSearchEdit->setLabelArg(key, text); } @@ -2657,17 +2657,17 @@ void LLSearchEditor::onClearSearch(void* user_data) { LLSearchEditor* search_editor = (LLSearchEditor*)user_data; - search_editor->setText(LLString::null); + search_editor->setText(LLStringUtil::null); if (search_editor->mSearchCallback) { - search_editor->mSearchCallback(LLString::null, search_editor->mCallbackUserData); + search_editor->mSearchCallback(LLStringUtil::null, search_editor->mCallbackUserData); } } // static LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("search_editor"); + std::string name("search_editor"); node->getAttributeString("name", name); LLRect rect; @@ -2676,14 +2676,14 @@ LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto S32 max_text_length = 128; node->getAttributeS32("max_length", max_text_length); - LLString text = node->getValue().substr(0, max_text_length - 1); + std::string text = node->getValue().substr(0, max_text_length - 1); LLSearchEditor* search_editor = new LLSearchEditor(name, rect, max_text_length, NULL, NULL); - LLString label; + std::string label; if(node->getAttributeString("label", label)) { search_editor->mSearchEdit->setLabel(label); diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 8b41dd1d87..8bf7613c79 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -63,9 +63,9 @@ class LLLineEditor { public: - LLLineEditor(const LLString& name, + LLLineEditor(const std::string& name, const LLRect& rect, - const LLString& default_text = LLString::null, + const std::string& default_text = LLStringUtil::null, const LLFontGL* glfont = NULL, S32 max_length_bytes = 254, void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL, @@ -132,13 +132,13 @@ public: // assumes UTF8 text virtual void setValue(const LLSD& value ) { setText(value.asString()); } virtual LLSD getValue() const { return LLSD(getText()); } - virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } void setText(const LLStringExplicit &new_text); - const LLString& getText() const { return mText.getString(); } + const std::string& getText() const { return mText.getString(); } const LLWString& getWText() const { return mText.getWString(); } S32 getLength() const { return mText.length(); } @@ -205,7 +205,7 @@ public: static BOOL prevalidatePrintableNoSpace(const LLWString &str); static BOOL prevalidateASCII(const LLWString &str); - static BOOL postvalidateFloat(const LLString &str); + static BOOL postvalidateFloat(const std::string &str); // line history support: void setEnableLineHistory( BOOL enabled ) { mHaveHistory = enabled; } // switches line history on or off @@ -242,12 +242,12 @@ private: protected: LLUIString mText; // The string being edited. - LLString mPrevText; // Saved string for 'ESC' revert + std::string mPrevText; // Saved string for 'ESC' revert LLUIString mLabel; // text label that is visible when no user text provided // line history support: BOOL mHaveHistory; // flag for enabled line history - std::vector<LLString> mLineHistory; // line history storage + std::vector<std::string> mLineHistory; // line history storage U32 mCurrentHistoryLine; // currently browsed history line LLViewBorder* mBorder; @@ -307,7 +307,7 @@ protected: private: // Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible // or returns a given default image if anything in the process fails. - static LLPointer<LLUIImage> parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def); + static LLPointer<LLUIImage> parseImage(std::string name, LLXMLNodePtr from, LLPointer<LLUIImage> def); // Global instance used as default for member instance below. static LLPointer<LLUIImage> sImage; // Instances that by default point to the statics but can be overidden in XML. @@ -341,10 +341,10 @@ private: ed->mPrevText = mText; } - LLString getText() { return mText; } + std::string getText() { return mText; } private: - LLString mText; + std::string mText; S32 mCursorPos; S32 mScrollHPos; BOOL mIsSelecting; @@ -362,10 +362,10 @@ private: class LLSearchEditor : public LLUICtrl { public: - LLSearchEditor(const LLString& name, + LLSearchEditor(const std::string& name, const LLRect& rect, S32 max_length_bytes, - void (*search_callback)(const LLString& search_string, void* user_data), + void (*search_callback)(const std::string& search_string, void* user_data), void* userdata); virtual ~LLSearchEditor() {} @@ -376,13 +376,13 @@ public: void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } - void setSearchCallback(void (*search_callback)(const LLString& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } + void setSearchCallback(void (*search_callback)(const std::string& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } // LLUICtrl interface virtual void setValue(const LLSD& value ); virtual LLSD getValue() const; - virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual void clear(); private: @@ -391,7 +391,7 @@ private: LLLineEditor* mSearchEdit; class LLButton* mClearSearchButton; - void (*mSearchCallback)(const LLString& search_string, void* user_data); + void (*mSearchCallback)(const std::string& search_string, void* user_data); }; diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 62b86a6ad7..fba0984dce 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -74,10 +74,10 @@ S32 MENU_BAR_WIDTH = 0; /// Local function declarations, constants, enums, and typedefs ///============================================================================ -const LLString SEPARATOR_NAME("separator"); -const LLString TEAROFF_SEPARATOR_LABEL( "~~~~~~~~~~~" ); -const LLString SEPARATOR_LABEL( "-----------" ); -const LLString VERTICAL_SEPARATOR_LABEL( "|" ); +const std::string SEPARATOR_NAME("separator"); +const std::string TEAROFF_SEPARATOR_LABEL( "~~~~~~~~~~~" ); +const std::string SEPARATOR_LABEL( "-----------" ); +const std::string VERTICAL_SEPARATOR_LABEL( "|" ); const S32 LABEL_BOTTOM_PAD_PIXELS = 2; @@ -98,10 +98,10 @@ const U32 SEPARATOR_HEIGHT_PIXELS = 8; const S32 TEAROFF_SEPARATOR_HEIGHT_PIXELS = 10; const S32 MENU_ITEM_PADDING = 4; -const LLString BOOLEAN_TRUE_PREFIX( "X" ); -const LLString BRANCH_SUFFIX( ">" ); -const LLString ARROW_UP ("^^^^^^^"); -const LLString ARROW_DOWN("vvvvvvv"); +const std::string BOOLEAN_TRUE_PREFIX( "X" ); +const std::string BRANCH_SUFFIX( ">" ); +const std::string ARROW_UP ("^^^^^^^"); +const std::string ARROW_DOWN("vvvvvvv"); const F32 MAX_MOUSE_SLOPE_SUB_MENU = 0.9f; @@ -130,7 +130,7 @@ const F32 ACTIVATE_HIGHLIGHT_TIME = 0.3f; ///============================================================================ // Default constructor -LLMenuItemGL::LLMenuItemGL( const LLString& name, const LLString& label, KEY key, MASK mask ) : +LLMenuItemGL::LLMenuItemGL( const std::string& name, const std::string& label, KEY key, MASK mask ) : LLView( name, TRUE ), mJumpKey(KEY_NONE), mAcceleratorKey( key ), @@ -220,7 +220,7 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp) // *NOTE: get calling code to throw up warning or route // warning messages back to app-provided output - // LLString warning; + // std::string warning; // warning.append("Duplicate key binding <"); // appendAcceleratorString( warning ); // warning.append("> for menu items:\n "); @@ -250,7 +250,7 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp) // This function appends the character string representation of // the current accelerator key and mask to the provided string. -void LLMenuItemGL::appendAcceleratorString( LLString& st ) const +void LLMenuItemGL::appendAcceleratorString( std::string& st ) const { // break early if this is a silly thing to do. if( KEY_NONE == mAcceleratorKey ) @@ -286,7 +286,7 @@ void LLMenuItemGL::appendAcceleratorString( LLString& st ) const st.append( "Shift-" ); #endif - LLString keystr = LLKeyboard::stringFromKey( mAcceleratorKey ); + std::string keystr = LLKeyboard::stringFromKey( mAcceleratorKey ); if ((mAcceleratorMask & MASK_NORMALKEYS) && (keystr[0] == '-' || keystr[0] == '=')) { @@ -334,7 +334,7 @@ U32 LLMenuItemGL::getNominalWidth( void ) const if( KEY_NONE != mAcceleratorKey ) { width += ACCEL_PAD_PIXELS; - LLString temp; + std::string temp; appendAcceleratorString( temp ); width += mFont->getWidth( temp ); } @@ -346,7 +346,7 @@ U32 LLMenuItemGL::getNominalWidth( void ) const void LLMenuItemGL::buildDrawLabel( void ) { mDrawAccelLabel.clear(); - LLString st = mDrawAccelLabel.getString(); + std::string st = mDrawAccelLabel.getString(); appendAcceleratorString( st ); mDrawAccelLabel = st; } @@ -491,8 +491,8 @@ void LLMenuItemGL::draw( void ) // underline "jump" key only when keyboard navigation has been initiated if (getMenu()->jumpKeysActive() && LLMenuGL::getKeyboardMode()) { - LLString upper_case_label = mLabel.getString(); - LLString::toUpper(upper_case_label); + std::string upper_case_label = mLabel.getString(); + LLStringUtil::toUpper(upper_case_label); std::string::size_type offset = upper_case_label.find(mJumpKey); if (offset != std::string::npos) { @@ -506,7 +506,7 @@ void LLMenuItemGL::draw( void ) setHover(FALSE); } -BOOL LLMenuItemGL::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLMenuItemGL::setLabelArg( const std::string& key, const LLStringExplicit& text ) { mLabel.setArg(key, text); return TRUE; @@ -521,9 +521,9 @@ BOOL LLMenuItemGL::setLabelArg( const LLString& key, const LLStringExplicit& tex class LLMenuItemSeparatorGL : public LLMenuItemGL { public: - LLMenuItemSeparatorGL( const LLString &name = SEPARATOR_NAME ); + LLMenuItemSeparatorGL( const std::string &name = SEPARATOR_NAME ); - virtual LLString getType() const { return "separator"; } + virtual std::string getType() const { return "separator"; } // doIt() - do the primary funcationality of the menu item. virtual void doIt( void ) {} @@ -536,7 +536,7 @@ public: virtual U32 getNominalHeight( void ) const { return SEPARATOR_HEIGHT_PIXELS; } }; -LLMenuItemSeparatorGL::LLMenuItemSeparatorGL( const LLString &name ) : +LLMenuItemSeparatorGL::LLMenuItemSeparatorGL( const std::string &name ) : LLMenuItemGL( name, SEPARATOR_LABEL ) { } @@ -615,7 +615,7 @@ LLMenuItemVerticalSeparatorGL::LLMenuItemVerticalSeparatorGL( void ) // Class LLMenuItemTearOffGL //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLMenuItemTearOffGL::LLMenuItemTearOffGL(LLHandle<LLFloater> parent_floater_handle) : - LLMenuItemGL("tear off", TEAROFF_SEPARATOR_LABEL), + LLMenuItemGL(std::string("tear off"), TEAROFF_SEPARATOR_LABEL), mParentHandle(parent_floater_handle) { } @@ -694,7 +694,7 @@ U32 LLMenuItemTearOffGL::getNominalHeight( void ) const class LLMenuItemBlankGL : public LLMenuItemGL { public: - LLMenuItemBlankGL( void ) : LLMenuItemGL( "", "" ) + LLMenuItemBlankGL( void ) : LLMenuItemGL( LLStringUtil::null, LLStringUtil::null ) { setEnabled(FALSE); } @@ -707,8 +707,8 @@ public: /// Class LLMenuItemCallGL ///============================================================================ -LLMenuItemCallGL::LLMenuItemCallGL( const LLString& name, - const LLString& label, +LLMenuItemCallGL::LLMenuItemCallGL( const std::string& name, + const std::string& label, menu_callback clicked_cb, enabled_callback enabled_cb, void* user_data, @@ -725,7 +725,7 @@ LLMenuItemCallGL::LLMenuItemCallGL( const LLString& name, if(!enabled) setEnabled(FALSE); } -LLMenuItemCallGL::LLMenuItemCallGL( const LLString& name, +LLMenuItemCallGL::LLMenuItemCallGL( const std::string& name, menu_callback clicked_cb, enabled_callback enabled_cb, void* user_data, @@ -742,8 +742,8 @@ LLMenuItemCallGL::LLMenuItemCallGL( const LLString& name, if(!enabled) setEnabled(FALSE); } -LLMenuItemCallGL::LLMenuItemCallGL(const LLString& name, - const LLString& label, +LLMenuItemCallGL::LLMenuItemCallGL(const std::string& name, + const std::string& label, menu_callback clicked_cb, enabled_callback enabled_cb, label_callback label_cb, @@ -761,7 +761,7 @@ LLMenuItemCallGL::LLMenuItemCallGL(const LLString& name, if(!enabled) setEnabled(FALSE); } -LLMenuItemCallGL::LLMenuItemCallGL(const LLString& name, +LLMenuItemCallGL::LLMenuItemCallGL(const std::string& name, menu_callback clicked_cb, enabled_callback enabled_cb, label_callback label_cb, @@ -779,7 +779,7 @@ LLMenuItemCallGL::LLMenuItemCallGL(const LLString& name, if(!enabled) setEnabled(FALSE); } -void LLMenuItemCallGL::setEnabledControl(LLString enabled_control, LLView *context) +void LLMenuItemCallGL::setEnabledControl(std::string enabled_control, LLView *context) { // Register new listener if (!enabled_control.empty()) @@ -796,7 +796,7 @@ void LLMenuItemCallGL::setEnabledControl(LLString enabled_control, LLView *conte } } -void LLMenuItemCallGL::setVisibleControl(LLString visible_control, LLView *context) +void LLMenuItemCallGL::setVisibleControl(std::string visible_control, LLView *context) { // Register new listener if (!visible_control.empty()) @@ -824,7 +824,7 @@ LLXMLNodePtr LLMenuItemCallGL::getXML(bool save_children) const std::vector<LLListenerEntry>::iterator itor; for (itor = listeners.begin(); itor != listeners.end(); ++itor) { - LLString listener_name = findEventListener((LLSimpleListener*)itor->listener); + std::string listener_name = findEventListener((LLSimpleListener*)itor->listener); if (!listener_name.empty()) { LLXMLNodePtr child_node = node->createChild("on_click", FALSE); @@ -862,7 +862,7 @@ void LLMenuItemCallGL::buildDrawLabel( void ) } if(mLabelCallback) { - LLString label; + std::string label; mLabelCallback(label, mUserData); mLabel = label; } @@ -894,8 +894,8 @@ BOOL LLMenuItemCallGL::handleAcceleratorKey( KEY key, MASK mask ) /// Class LLMenuItemCheckGL ///============================================================================ -LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, - const LLString& label, +LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, + const std::string& label, menu_callback clicked_cb, enabled_callback enabled_cb, check_callback check_cb, @@ -907,7 +907,7 @@ LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, { } -LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, +LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, menu_callback clicked_cb, enabled_callback enabled_cb, check_callback check_cb, @@ -919,11 +919,11 @@ LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, { } -LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, - const LLString& label, +LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, + const std::string& label, menu_callback clicked_cb, enabled_callback enabled_cb, - LLString control_name, + std::string control_name, LLView *context, void* user_data, KEY key, MASK mask ) : @@ -947,7 +947,7 @@ void LLMenuItemCheckGL::setValue(const LLSD& value) } } -void LLMenuItemCheckGL::setCheckedControl(LLString checked_control, LLView *context) +void LLMenuItemCheckGL::setCheckedControl(std::string checked_control, LLView *context) { // Register new listener if (!checked_control.empty()) @@ -990,14 +990,14 @@ void LLMenuItemCheckGL::buildDrawLabel( void ) /// Class LLMenuItemToggleGL ///============================================================================ -LLMenuItemToggleGL::LLMenuItemToggleGL( const LLString& name, const LLString& label, BOOL* toggle, +LLMenuItemToggleGL::LLMenuItemToggleGL( const std::string& name, const std::string& label, BOOL* toggle, KEY key, MASK mask ) : LLMenuItemGL( name, label, key, mask ), mToggle( toggle ) { } -LLMenuItemToggleGL::LLMenuItemToggleGL( const LLString& name, BOOL* toggle, +LLMenuItemToggleGL::LLMenuItemToggleGL( const std::string& name, BOOL* toggle, KEY key, MASK mask ) : LLMenuItemGL( name, name, key, mask ), mToggle( toggle ) @@ -1017,7 +1017,7 @@ void LLMenuItemToggleGL::buildDrawLabel( void ) mDrawBoolLabel.clear(); } mDrawAccelLabel.clear(); - LLString st = mDrawAccelLabel; + std::string st = mDrawAccelLabel; appendAcceleratorString( st ); mDrawAccelLabel = st; } @@ -1033,7 +1033,7 @@ void LLMenuItemToggleGL::doIt( void ) } -LLMenuItemBranchGL::LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch, +LLMenuItemBranchGL::LLMenuItemBranchGL( const std::string& name, const std::string& label, LLMenuGL* branch, KEY key, MASK mask ) : LLMenuItemGL( name, label, key, mask ), mBranch( branch ) @@ -1043,7 +1043,7 @@ LLMenuItemBranchGL::LLMenuItemBranchGL( const LLString& name, const LLString& la } // virtual -LLView* LLMenuItemBranchGL::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const +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) @@ -1109,7 +1109,7 @@ BOOL LLMenuItemBranchGL::addToAcceleratorList(std::list<LLKeyBinding*> *listp) void LLMenuItemBranchGL::buildDrawLabel( void ) { mDrawAccelLabel.clear(); - LLString st = mDrawAccelLabel; + std::string st = mDrawAccelLabel; appendAcceleratorString( st ); mDrawAccelLabel = st; mDrawBranchLabel = BRANCH_SUFFIX; @@ -1325,10 +1325,10 @@ class LLMenuItemBranchDownGL : public LLMenuItemBranchGL protected: public: - LLMenuItemBranchDownGL( const LLString& name, const LLString& label, LLMenuGL* branch, + LLMenuItemBranchDownGL( const std::string& name, const std::string& label, LLMenuGL* branch, KEY key = KEY_NONE, MASK mask = MASK_NONE ); - virtual LLString getType() const { return "menu"; } + virtual std::string getType() const { return "menu"; } // returns the normal width of this control in pixels - this is // used for calculating the widest item, as well as for horizontal @@ -1356,8 +1356,8 @@ public: virtual BOOL handleAcceleratorKey(KEY key, MASK mask); }; -LLMenuItemBranchDownGL::LLMenuItemBranchDownGL( const LLString& name, - const LLString& label, +LLMenuItemBranchDownGL::LLMenuItemBranchDownGL( const std::string& name, + const std::string& label, LLMenuGL* branch, KEY key, MASK mask ) : LLMenuItemBranchGL( name, label, branch, key, mask ) @@ -1378,7 +1378,7 @@ U32 LLMenuItemBranchDownGL::getNominalWidth( void ) const void LLMenuItemBranchDownGL::buildDrawLabel( void ) { mDrawAccelLabel.clear(); - LLString st = mDrawAccelLabel; + std::string st = mDrawAccelLabel; appendAcceleratorString( st ); mDrawAccelLabel = st; } @@ -1591,8 +1591,8 @@ void LLMenuItemBranchDownGL::draw( void ) // underline navigation key only when keyboard navigation has been initiated if (getMenu()->jumpKeysActive() && LLMenuGL::getKeyboardMode()) { - LLString upper_case_label = mLabel.getString(); - LLString::toUpper(upper_case_label); + std::string upper_case_label = mLabel.getString(); + LLStringUtil::toUpper(upper_case_label); std::string::size_type offset = upper_case_label.find(getJumpKey()); if (offset != std::string::npos) { @@ -1615,7 +1615,7 @@ void LLMenuItemBranchDownGL::draw( void ) static LLRegisterWidget<LLMenuGL> r1("menu"); // Default constructor -LLMenuGL::LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloater> parent_floater_handle ) +LLMenuGL::LLMenuGL( const std::string& name, const std::string& label, LLHandle<LLFloater> parent_floater_handle ) : LLUICtrl( name, LLRect(), FALSE, NULL, NULL ), mBackgroundColor( sDefaultBackgroundColor ), mBgVisible( TRUE ), @@ -1640,7 +1640,7 @@ LLMenuGL::LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloa setTabStop(FALSE); } -LLMenuGL::LLMenuGL( const LLString& label, LLHandle<LLFloater> parent_floater_handle ) +LLMenuGL::LLMenuGL( const std::string& label, LLHandle<LLFloater> parent_floater_handle ) : LLUICtrl( label, LLRect(), FALSE, NULL, NULL ), mBackgroundColor( sDefaultBackgroundColor ), mBgVisible( TRUE ), @@ -1749,10 +1749,10 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory { LLMenuItemGL *item = NULL; - LLString type; - LLString item_name; - LLString source_label; - LLString item_label; + std::string type; + std::string item_name; + std::string source_label; + std::string item_label; KEY jump_key = KEY_NONE; child->getAttributeString("type", type); @@ -1794,7 +1794,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory child->getAttributeBOOL("useMacCtrl", useMacCtrl); #endif // LL_DARWIN - LLString shortcut; + std::string shortcut; child->getAttributeString("shortcut", shortcut); if (shortcut.find("control") != shortcut.npos) { @@ -1815,7 +1815,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory mask |= MASK_SHIFT; } S32 pipe_pos = shortcut.rfind("|"); - LLString key_str = shortcut.substr(pipe_pos+1); + std::string key_str = shortcut.substr(pipe_pos+1); KEY key = KEY_NONE; LLKeyboard::keyFromString(key_str, &key); @@ -1825,7 +1825,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory if (child->hasName(LL_MENU_ITEM_CHECK_GL_TAG)) { - LLString control_name; + std::string control_name; child->getAttributeString("control_name", control_name); new_item = new LLMenuItemCheckGL(item_name, item_label, 0, 0, control_name, parent, 0, key, mask); @@ -1834,15 +1834,15 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory { if (call_child->hasName("on_check")) { - LLString callback_name; - LLString control_name = ""; + std::string callback_name; + std::string control_name; if (call_child->hasAttribute("function")) { call_child->getAttributeString("function", callback_name); control_name = callback_name; - LLString callback_data = item_name; + std::string callback_data = item_name; if (call_child->hasAttribute("userdata")) { call_child->getAttributeString("userdata", callback_data); @@ -1888,10 +1888,10 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory { if (call_child->hasName("on_click")) { - LLString callback_name; + std::string callback_name; call_child->getAttributeString("function", callback_name); - LLString callback_data = item_name; + std::string callback_data = item_name; if (call_child->hasAttribute("userdata")) { call_child->getAttributeString("userdata", callback_data); @@ -1905,15 +1905,15 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory } if (call_child->hasName("on_enable")) { - LLString callback_name; - LLString control_name = ""; + std::string callback_name; + std::string control_name; if (call_child->hasAttribute("function")) { call_child->getAttributeString("function", callback_name); control_name = callback_name; - LLString callback_data = ""; + std::string callback_data; if (call_child->hasAttribute("userdata")) { call_child->getAttributeString("userdata", callback_data); @@ -1945,15 +1945,15 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory } if (call_child->hasName("on_visible")) { - LLString callback_name; - LLString control_name = ""; + std::string callback_name; + std::string control_name; if (call_child->hasAttribute("function")) { call_child->getAttributeString("function", callback_name); control_name = callback_name; - LLString callback_data = ""; + std::string callback_data; if (call_child->hasAttribute("userdata")) { call_child->getAttributeString("userdata", callback_data); @@ -2045,14 +2045,14 @@ BOOL LLMenuGL::isOpen() // static LLView* LLMenuGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("menu"); + std::string name("menu"); node->getAttributeString("name", name); - LLString label = name; + std::string label = name; node->getAttributeString("label", label); // parse jump key out of label - LLString new_menu_label; + std::string new_menu_label; typedef boost::tokenizer<boost::char_separator<char> > tokenizer; boost::char_separator<char> sep("_"); @@ -2132,7 +2132,7 @@ void LLMenuGL::arrange( void ) U32 max_width = getTornOff() ? U32_MAX : menu_region_rect.getWidth(); U32 max_height = getTornOff() ? U32_MAX : menu_region_rect.getHeight(); // *FIX: create the item first and then ask for its dimensions? - S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::sSansSerif->getWidth( "More" ); + S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::sSansSerif->getWidth( std::string("More") ); S32 spillover_item_height = llround(LLFontGL::sSansSerif->getLineHeight()) + MENU_ITEM_PADDING; if (mHorizontalLayout) @@ -2249,13 +2249,13 @@ void LLMenuGL::createSpilloverBranch() delete mSpilloverMenu; // technically, you can't tear off spillover menus, but we're passing the handle // along just to be safe - mSpilloverMenu = new LLMenuGL("More", "More", mParentFloaterHandle); + mSpilloverMenu = new LLMenuGL(std::string("More"), std::string("More"), mParentFloaterHandle); mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); // Inherit colors mSpilloverMenu->setBackgroundColor( mBackgroundColor ); mSpilloverMenu->setCanTearOff(FALSE); - mSpilloverBranch = new LLMenuItemBranchGL("More", "More", mSpilloverMenu); + mSpilloverBranch = new LLMenuItemBranchGL(std::string("More"), std::string("More"), mSpilloverMenu); mSpilloverBranch->setFontStyle(LLFontGL::ITALIC); } } @@ -2295,8 +2295,8 @@ void LLMenuGL::createJumpKeys() { mJumpKeys.clear(); - std::set<LLString> unique_words; - std::set<LLString> shared_words; + std::set<std::string> unique_words; + std::set<std::string> shared_words; item_list_t::iterator item_it; typedef boost::tokenizer<boost::char_separator<char> > tokenizer; @@ -2304,8 +2304,8 @@ void LLMenuGL::createJumpKeys() for(item_it = mItems.begin(); item_it != mItems.end(); ++item_it) { - LLString uppercase_label = (*item_it)->getLabel(); - LLString::toUpper(uppercase_label); + std::string uppercase_label = (*item_it)->getLabel(); + LLStringUtil::toUpper(uppercase_label); tokenizer tokens(uppercase_label, sep); tokenizer::iterator token_iter; @@ -2350,8 +2350,8 @@ void LLMenuGL::createJumpKeys() { continue; } - LLString uppercase_label = (*item_it)->getLabel(); - LLString::toUpper(uppercase_label); + std::string uppercase_label = (*item_it)->getLabel(); + LLStringUtil::toUpper(uppercase_label); tokenizer tokens(uppercase_label, sep); tokenizer::iterator token_iter; @@ -2359,7 +2359,7 @@ void LLMenuGL::createJumpKeys() BOOL found_key = FALSE; for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) { - LLString uppercase_word = *token_iter; + std::string uppercase_word = *token_iter; // this word is not shared with other menu entries... if (shared_words.find(*token_iter) == shared_words.end()) @@ -2439,9 +2439,13 @@ BOOL LLMenuGL::append( LLMenuItemGL* item ) } // add a separator to this menu -BOOL LLMenuGL::appendSeparator( const LLString &separator_name ) +BOOL LLMenuGL::appendSeparator( const std::string &separator_name ) { - LLMenuItemGL* separator = new LLMenuItemSeparatorGL(separator_name); + LLMenuItemGL* separator; + if (separator_name.empty()) + separator = new LLMenuItemSeparatorGL(std::string("separator")); + else + separator = new LLMenuItemSeparatorGL(separator_name); return append( separator ); } @@ -2478,7 +2482,7 @@ void LLMenuGL::setEnabledSubMenus(BOOL enable) // setItemEnabled() - pass the label and the enable flag for a menu // item. TRUE will make sure it's enabled, FALSE will disable it. -void LLMenuGL::setItemEnabled( const LLString& name, BOOL enable ) +void LLMenuGL::setItemEnabled( const std::string& name, BOOL enable ) { item_list_t::iterator item_iter; for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) @@ -2492,7 +2496,7 @@ void LLMenuGL::setItemEnabled( const LLString& name, BOOL enable ) } } -void LLMenuGL::setItemVisible( const LLString& name, BOOL visible ) +void LLMenuGL::setItemVisible( const std::string& name, BOOL visible ) { item_list_t::iterator item_iter; for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) @@ -2871,7 +2875,7 @@ void LLMenuGL::setVisible(BOOL visible) } } -LLMenuGL* LLMenuGL::getChildMenuByName(const LLString& name, BOOL recurse) const +LLMenuGL* LLMenuGL::getChildMenuByName(const std::string& name, BOOL recurse) const { LLView* view = getChildView(name, recurse, FALSE); if (view) @@ -2963,7 +2967,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) class LLPieMenuBranch : public LLMenuItemGL { public: - LLPieMenuBranch(const LLString& name, const LLString& label, LLPieMenu* branch); + LLPieMenuBranch(const std::string& name, const std::string& label, LLPieMenu* branch); // called to rebuild the draw label virtual void buildDrawLabel( void ); @@ -2977,8 +2981,8 @@ protected: LLPieMenu* mBranch; }; -LLPieMenuBranch::LLPieMenuBranch(const LLString& name, - const LLString& label, +LLPieMenuBranch::LLPieMenuBranch(const std::string& name, + const std::string& label, LLPieMenu* branch) : LLMenuItemGL( name, label, KEY_NONE, MASK_NONE ), mBranch( branch ) @@ -3011,7 +3015,7 @@ void LLPieMenuBranch::buildDrawLabel( void ) } mDrawAccelLabel.clear(); - LLString st = mDrawAccelLabel; + std::string st = mDrawAccelLabel; appendAcceleratorString( st ); mDrawAccelLabel = st; @@ -3037,7 +3041,7 @@ void LLPieMenuBranch::doIt( void ) // class LLPieMenu // A circular menu of items, icons, etc. //----------------------------------------------------------------------------- -LLPieMenu::LLPieMenu(const LLString& name, const LLString& label) +LLPieMenu::LLPieMenu(const std::string& name, const std::string& label) : LLMenuGL(name, label), mFirstMouseDown(FALSE), mUseInfiniteRadius(FALSE), @@ -3052,7 +3056,7 @@ LLPieMenu::LLPieMenu(const LLString& name, const LLString& label) setCanTearOff(FALSE); } -LLPieMenu::LLPieMenu(const LLString& name) +LLPieMenu::LLPieMenu(const std::string& name) : LLMenuGL(name, name), mFirstMouseDown(FALSE), mUseInfiniteRadius(FALSE), @@ -3076,9 +3080,9 @@ void LLPieMenu::initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *fac if (child->hasName(LL_PIE_MENU_TAG)) { // SUBMENU - LLString name("menu"); + std::string name("menu"); child->getAttributeString("name", name); - LLString label(name); + std::string label(name); child->getAttributeString("label", label); LLPieMenu *submenu = new LLPieMenu(name, label); @@ -3456,7 +3460,7 @@ BOOL LLPieMenu::append(LLMenuItemGL *item) } // virtual -BOOL LLPieMenu::appendSeparator(const LLString &separator_name) +BOOL LLPieMenu::appendSeparator(const std::string &separator_name) { LLMenuItemGL* separator = new LLMenuItemBlankGL(); separator->setFont( LLFontGL::sSansSerifSmall ); @@ -3737,7 +3741,7 @@ void LLPieMenu::hide(BOOL item_selected) static LLRegisterWidget<LLMenuBarGL> r2("menu_bar"); // Default constructor -LLMenuBarGL::LLMenuBarGL( const LLString& name ) : LLMenuGL ( name, name ) +LLMenuBarGL::LLMenuBarGL( const std::string& name ) : LLMenuGL ( name, name ) { mHorizontalLayout = TRUE; setCanTearOff(FALSE); @@ -3782,7 +3786,7 @@ LLXMLNodePtr LLMenuBarGL::getXML(bool save_children) const LLView* LLMenuBarGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("menu"); + std::string name("menu"); node->getAttributeString("name", name); BOOL opaque = FALSE; @@ -4039,7 +4043,7 @@ S32 LLMenuBarGL::getRightmostMenuEdge() } // add a vertical separator to this menu -BOOL LLMenuBarGL::appendSeparator( const LLString &separator_name ) +BOOL LLMenuBarGL::appendSeparator( const std::string &separator_name ) { LLMenuItemGL* separator = new LLMenuItemVerticalSeparatorGL(); return append( separator ); @@ -4138,14 +4142,14 @@ BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask ) /// Class LLMenuHolderGL ///============================================================================ LLMenuHolderGL::LLMenuHolderGL() -: LLPanel("Menu Holder") + : LLPanel(std::string("Menu Holder")) { setMouseOpaque(FALSE); sItemActivationTimer.stop(); mCanHide = TRUE; } -LLMenuHolderGL::LLMenuHolderGL(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) +LLMenuHolderGL::LLMenuHolderGL(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) : LLPanel(name, rect, FALSE) { setMouseOpaque(mouse_opaque); diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 16ab61c607..0125f954e5 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -67,7 +67,7 @@ typedef BOOL (*check_callback)(void*); // This callback is potentially used by LLMenuItemCallGL. If provided, // this function is called whenever it's time to determine the label's // contents. Put the contents of the label in the provided parameter. -typedef void (*label_callback)(LLString&,void*); +typedef void (*label_callback)(std::string&,void*); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLMenuItemGL @@ -88,13 +88,13 @@ public: static void setHighlightFGColor( const LLColor4& color ) { sHighlightForeground = color; } static const LLColor4& getHighlightFGColor() { return sHighlightForeground; } - LLMenuItemGL( const LLString& name, const LLString& label, KEY key = KEY_NONE, MASK = MASK_NONE ); + LLMenuItemGL( const std::string& name, const std::string& label, KEY key = KEY_NONE, MASK = MASK_NONE ); virtual void setValue(const LLSD& value) { setLabel(value.asString()); } virtual LLXMLNodePtr getXML(bool save_children = true) const; - virtual LLString getType() const { return "item"; } + virtual std::string getType() const { return "item"; } virtual BOOL handleHover(S32 x, S32 y, MASK mask); @@ -122,8 +122,8 @@ public: // change the label void setLabel( const LLStringExplicit& label ) { mLabel = label; } - LLString getLabel( void ) const { return mLabel.getString(); } - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + std::string getLabel( void ) const { return mLabel.getString(); } + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); // Get the parent menu for this item virtual class LLMenuGL* getMenu(); @@ -177,7 +177,7 @@ protected: // This function appends the character string representation of // the current accelerator key and mask to the provided string. - void appendAcceleratorString( LLString& st ) const; + void appendAcceleratorString( std::string& st ) const; KEY mAcceleratorKey; MASK mAcceleratorMask; @@ -226,15 +226,15 @@ class LLMenuItemCallGL : public LLMenuItemGL, public LLObservable { public: // normal constructor - LLMenuItemCallGL( const LLString& name, + LLMenuItemCallGL( const std::string& name, menu_callback clicked_cb, enabled_callback enabled_cb = NULL, void* user_data = NULL, KEY key = KEY_NONE, MASK mask = MASK_NONE, BOOL enabled = TRUE, on_disabled_callback on_disabled_cb = NULL); - LLMenuItemCallGL( const LLString& name, - const LLString& label, + LLMenuItemCallGL( const std::string& name, + const std::string& label, menu_callback clicked_cb, enabled_callback enabled_cb = NULL, void* user_data = NULL, @@ -243,8 +243,8 @@ public: on_disabled_callback on_disabled_cb = NULL); // constructor for when you want to trap the arrange method. - LLMenuItemCallGL( const LLString& name, - const LLString& label, + LLMenuItemCallGL( const std::string& name, + const std::string& label, menu_callback clicked_cb, enabled_callback enabled_cb, label_callback label_cb, @@ -252,7 +252,7 @@ public: KEY key = KEY_NONE, MASK mask = MASK_NONE, BOOL enabled = TRUE, on_disabled_callback on_disabled_c = NULL); - LLMenuItemCallGL( const LLString& name, + LLMenuItemCallGL( const std::string& name, menu_callback clicked_cb, enabled_callback enabled_cb, label_callback label_cb, @@ -262,11 +262,11 @@ public: on_disabled_callback on_disabled_c = NULL); virtual LLXMLNodePtr getXML(bool save_children = true) const; - virtual LLString getType() const { return "call"; } + virtual std::string getType() const { return "call"; } - void setEnabledControl(LLString enabled_control, LLView *context); - void setVisibleControl(LLString enabled_control, LLView *context); + void setEnabledControl(std::string enabled_control, LLView *context); + void setVisibleControl(std::string enabled_control, LLView *context); void setMenuCallback(menu_callback callback, void* data) { mCallback = callback; mUserData = data; }; menu_callback getMenuCallback() const { return mCallback; } @@ -310,34 +310,34 @@ class LLMenuItemCheckGL : public LLMenuItemCallGL { public: - LLMenuItemCheckGL( const LLString& name, - const LLString& label, + LLMenuItemCheckGL( const std::string& name, + const std::string& label, menu_callback callback, enabled_callback enabled_cb, check_callback check, void* user_data, KEY key = KEY_NONE, MASK mask = MASK_NONE ); - LLMenuItemCheckGL( const LLString& name, + LLMenuItemCheckGL( const std::string& name, menu_callback callback, enabled_callback enabled_cb, check_callback check, void* user_data, KEY key = KEY_NONE, MASK mask = MASK_NONE ); - LLMenuItemCheckGL( const LLString& name, - const LLString& label, + LLMenuItemCheckGL( const std::string& name, + const std::string& label, menu_callback callback, enabled_callback enabled_cb, - LLString control_name, + std::string control_name, LLView *context, void* user_data, KEY key = KEY_NONE, MASK mask = MASK_NONE ); virtual LLXMLNodePtr getXML(bool save_children = true) const; - void setCheckedControl(LLString checked_control, LLView *context); + void setCheckedControl(std::string checked_control, LLView *context); virtual void setValue(const LLSD& value); - virtual LLString getType() const { return "check"; } + virtual std::string getType() const { return "check"; } // called to rebuild the draw label virtual void buildDrawLabel( void ); @@ -358,15 +358,15 @@ private: class LLMenuItemToggleGL : public LLMenuItemGL { public: - LLMenuItemToggleGL( const LLString& name, const LLString& label, + LLMenuItemToggleGL( const std::string& name, const std::string& label, BOOL* toggle, KEY key = KEY_NONE, MASK mask = MASK_NONE ); - LLMenuItemToggleGL( const LLString& name, + LLMenuItemToggleGL( const std::string& name, BOOL* toggle, KEY key = KEY_NONE, MASK mask = MASK_NONE ); - virtual LLString getType() const { return "toggle"; } + virtual std::string getType() const { return "toggle"; } // called to rebuild the draw label virtual void buildDrawLabel( void ); @@ -401,8 +401,8 @@ class LLMenuGL // let branching menu items use my protected traversal methods friend class LLMenuItemBranchGL; public: - LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>()); - LLMenuGL( const LLString& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>() ); + LLMenuGL( const std::string& name, const std::string& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>()); + LLMenuGL( const std::string& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>() ); virtual ~LLMenuGL( void ); virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -419,12 +419,12 @@ public: virtual BOOL handleAcceleratorKey(KEY key, MASK mask); - LLMenuGL* getChildMenuByName(const LLString& name, BOOL recurse) const; + LLMenuGL* getChildMenuByName(const std::string& name, BOOL recurse) const; BOOL clearHoverItem(); // return the name label - const LLString& getLabel( void ) const { return mLabel.getString(); } + const std::string& getLabel( void ) const { return mLabel.getString(); } void setLabel(const LLStringExplicit& label) { mLabel = label; } // background colors @@ -438,7 +438,7 @@ public: virtual BOOL append( LLMenuItemGL* item ); // add a separator to this menu - virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); + virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); // add a menu - this will create a cascading menu virtual BOOL appendMenu( LLMenuGL* menu ); @@ -449,12 +449,12 @@ public: // setItemEnabled() - pass the name and the enable flag for a // menu item. TRUE will make sure it's enabled, FALSE will disable // it. - void setItemEnabled( const LLString& name, BOOL enable ); + void setItemEnabled( const std::string& name, BOOL enable ); // propagate message to submenus void setEnabledSubMenus(BOOL enable); - void setItemVisible( const LLString& name, BOOL visible); + void setItemVisible( const std::string& name, BOOL visible); // sets the left,bottom corner of menu, useful for popups void setLeftAndBottom(S32 left, S32 bottom); @@ -561,11 +561,11 @@ private: class LLMenuItemBranchGL : public LLMenuItemGL { public: - LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch, + LLMenuItemBranchGL( const std::string& name, const std::string& label, LLMenuGL* branch, KEY key = KEY_NONE, MASK mask = MASK_NONE ); virtual LLXMLNodePtr getXML(bool save_children = true) const; - virtual LLString getType() const { return "menu"; } + virtual std::string getType() const { return "menu"; } virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -606,7 +606,7 @@ public: virtual void openMenu(); - virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; + virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; private: LLMenuGL* mBranch; @@ -623,8 +623,8 @@ class LLPieMenu : public LLMenuGL { public: - LLPieMenu(const LLString& name, const LLString& label); - LLPieMenu(const LLString& name); + LLPieMenu(const std::string& name, const std::string& label); + LLPieMenu(const std::string& name); virtual ~LLPieMenu() {} void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory); @@ -642,7 +642,7 @@ public: virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color); virtual BOOL append(LLMenuItemGL* item); - virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); + virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); BOOL appendPieMenu(LLPieMenu *menu); @@ -682,7 +682,7 @@ private: class LLMenuBarGL : public LLMenuGL { public: - LLMenuBarGL( const LLString& name ); + LLMenuBarGL( const std::string& name ); virtual ~LLMenuBarGL(); virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -700,7 +700,7 @@ public: virtual BOOL jumpKeysActive(); // add a vertical separator to this menu - virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); + virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); // add a menu - this will create a drop down menu. virtual BOOL appendMenu( LLMenuGL* menu ); @@ -729,7 +729,7 @@ class LLMenuHolderGL : public LLPanel { public: LLMenuHolderGL(); - LLMenuHolderGL(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows = FOLLOWS_NONE); + LLMenuHolderGL(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows = FOLLOWS_NONE); virtual ~LLMenuHolderGL() {} virtual BOOL hideMenus(); @@ -791,7 +791,7 @@ class LLMenuItemTearOffGL : public LLMenuItemGL public: LLMenuItemTearOffGL( LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); - virtual LLString getType() const { return "tearoff_menu"; } + virtual std::string getType() const { return "tearoff_menu"; } virtual void doIt(void); virtual void draw(void); diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 878c57b8b3..03dccdaf1f 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -43,8 +43,8 @@ // static std::list<LLModalDialog*> LLModalDialog::sModalStack; -LLModalDialog::LLModalDialog( const LLString& title, S32 width, S32 height, BOOL modal ) - : LLFloater( "modal container", +LLModalDialog::LLModalDialog( const std::string& title, S32 width, S32 height, BOOL modal ) + : LLFloater( std::string("modal container"), LLRect( 0, height, width, 0 ), title, FALSE, // resizable diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h index 887239b18d..bb32950522 100644 --- a/indra/llui/llmodaldialog.h +++ b/indra/llui/llmodaldialog.h @@ -44,7 +44,7 @@ class LLModalDialog; class LLModalDialog : public LLFloater { public: - LLModalDialog( const LLString& title, S32 width, S32 height, BOOL modal = true ); + LLModalDialog( const std::string& title, S32 width, S32 height, BOOL modal = true ); /*virtual*/ ~LLModalDialog(); /*virtual*/ void open(); /* Flawfinder: ignore */ diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index c5c0e1c8b1..1663312c6f 100644 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -54,7 +54,7 @@ const S32 EXTRA_TRIANGLE_HEIGHT = -2; S32 LLMultiSlider::mNameCounter = 0; LLMultiSlider::LLMultiSlider( - const LLString& name, + const std::string& name, const LLRect& rect, void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), void* callback_userdata, @@ -66,7 +66,7 @@ LLMultiSlider::LLMultiSlider( BOOL allow_overlap, BOOL draw_track, BOOL use_triangle, - const LLString& control_name) + const std::string& control_name) : LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, FOLLOWS_LEFT | FOLLOWS_TOP), @@ -91,7 +91,7 @@ LLMultiSlider::LLMultiSlider( mMouseUpCallback( NULL ) { mValue.emptyMap(); - mCurSlider = LLString::null; + mCurSlider = LLStringUtil::null; // properly handle setting the starting thumb rect // do it this way to handle both the operating-on-settings @@ -100,7 +100,7 @@ LLMultiSlider::LLMultiSlider( setValue(getValue()); } -void LLMultiSlider::setSliderValue(const LLString& name, F32 value, BOOL from_event) +void LLMultiSlider::setSliderValue(const std::string& name, F32 value, BOOL from_event) { // exit if not there if(!mValue.has(name)) { @@ -174,30 +174,30 @@ void LLMultiSlider::setValue(const LLSD& value) } } -F32 LLMultiSlider::getSliderValue(const LLString& name) const +F32 LLMultiSlider::getSliderValue(const std::string& name) const { return (F32)mValue[name].asReal(); } -void LLMultiSlider::setCurSlider(const LLString& name) +void LLMultiSlider::setCurSlider(const std::string& name) { if(mValue.has(name)) { mCurSlider = name; } } -const LLString& LLMultiSlider::addSlider() +const std::string& LLMultiSlider::addSlider() { return addSlider(mInitialValue); } -const LLString& LLMultiSlider::addSlider(F32 val) +const std::string& LLMultiSlider::addSlider(F32 val) { std::stringstream newName; F32 initVal = val; if(mValue.size() >= mMaxNumSliders) { - return LLString::null; + return LLStringUtil::null; } // create a new name @@ -206,7 +206,7 @@ const LLString& LLMultiSlider::addSlider(F32 val) bool foundOne = findUnusedValue(initVal); if(!foundOne) { - return LLString::null; + return LLStringUtil::null; } // add a new thumb rect @@ -269,7 +269,7 @@ bool LLMultiSlider::findUnusedValue(F32& initVal) } -void LLMultiSlider::deleteSlider(const LLString& name) +void LLMultiSlider::deleteSlider(const std::string& name) { // can't delete last slider if(mValue.size() <= 0) { @@ -282,7 +282,7 @@ void LLMultiSlider::deleteSlider(const LLString& name) // set to the last created if(mValue.size() > 0) { - std::map<LLString, LLRect>::iterator mIt = mThumbRects.end(); + std::map<std::string, LLRect>::iterator mIt = mThumbRects.end(); mIt--; mCurSlider = mIt->first; } @@ -365,7 +365,7 @@ BOOL LLMultiSlider::handleMouseDown(S32 x, S32 y, MASK mask) else { // scroll through thumbs to see if we have a new one selected and select that one - std::map<LLString, LLRect>::iterator mIt = mThumbRects.begin(); + std::map<std::string, LLRect>::iterator mIt = mThumbRects.begin(); for(; mIt != mThumbRects.end(); mIt++) { // check if inside. If so, set current slider and continue @@ -425,8 +425,8 @@ void LLMultiSlider::draw() { LLColor4 curThumbColor; - std::map<LLString, LLRect>::iterator mIt; - std::map<LLString, LLRect>::iterator curSldrIt; + std::map<std::string, LLRect>::iterator mIt; + std::map<std::string, LLRect>::iterator curSldrIt; // Draw background and thumb. @@ -582,7 +582,7 @@ LLXMLNodePtr LLMultiSlider::getXML(bool save_children) const //static LLView* LLMultiSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("multi_slider_bar"); + std::string name("multi_slider_bar"); node->getAttributeString("name", name); LLRect rect; diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h index 1eb7764c3c..7e0e483e61 100644 --- a/indra/llui/llmultislider.h +++ b/indra/llui/llmultislider.h @@ -41,7 +41,7 @@ class LLMultiSlider : public LLUICtrl { public: LLMultiSlider( - const LLString& name, + const std::string& name, const LLRect& rect, void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), void* callback_userdata, @@ -53,17 +53,17 @@ public: BOOL allow_overlap, BOOL draw_track, BOOL use_triangle, - const LLString& control_name = LLString::null ); + const std::string& control_name = LLStringUtil::null ); virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - void setSliderValue(const LLString& name, F32 value, BOOL from_event = FALSE); - F32 getSliderValue(const LLString& name) const; + void setSliderValue(const std::string& name, F32 value, BOOL from_event = FALSE); + F32 getSliderValue(const std::string& name) const; - const LLString& getCurSlider() const { return mCurSlider; } + const std::string& getCurSlider() const { return mCurSlider; } F32 getCurSliderValue() const { return getSliderValue(mCurSlider); } - void setCurSlider(const LLString& name); + void setCurSlider(const std::string& name); void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } virtual void setValue(const LLSD& value); @@ -83,9 +83,9 @@ public: void setMouseUpCallback( void (*cb)(LLUICtrl* ctrl, void* userdata) ) { mMouseUpCallback = cb; } bool findUnusedValue(F32& initVal); - const LLString& addSlider(); - const LLString& addSlider(F32 val); - void deleteSlider(const LLString& name); + const std::string& addSlider(); + const std::string& addSlider(F32 val); + void deleteSlider(const std::string& name); void deleteCurSlider() { deleteSlider(mCurSlider); } void clear(); @@ -101,7 +101,7 @@ protected: F32 mMinValue; F32 mMaxValue; F32 mIncrement; - LLString mCurSlider; + std::string mCurSlider; static S32 mNameCounter; S32 mMaxNumSliders; @@ -112,7 +112,7 @@ protected: S32 mMouseOffset; LLRect mDragStartThumbRect; - std::map<LLString, LLRect> mThumbRects; + std::map<std::string, LLRect> mThumbRects; LLColor4 mTrackColor; LLColor4 mThumbOutlineColor; LLColor4 mThumbCenterColor; diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index e2b1e410fa..f6ad18f4b6 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -55,8 +55,8 @@ static LLRegisterWidget<LLMultiSliderCtrl> r("multi_slider"); const U32 MAX_STRING_LENGTH = 10; -LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, - const LLString& label, +LLMultiSliderCtrl::LLMultiSliderCtrl(const std::string& name, const LLRect& rect, + const std::string& label, const LLFontGL* font, S32 label_width, S32 text_left, @@ -68,7 +68,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, S32 max_sliders, BOOL allow_overlap, BOOL draw_track, BOOL use_triangle, - const LLString& control_which) + const std::string& control_which) : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data ), mFont(font), mShowText( show_text ), @@ -96,7 +96,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, label_width = font->getWidth(label); } LLRect label_rect( left, top, label_width, bottom ); - mLabelBox = new LLTextBox( "MultiSliderCtrl Label", label_rect, label.c_str(), font ); + mLabelBox = new LLTextBox( std::string("MultiSliderCtrl Label"), label_rect, label, font ); addChild(mLabelBox); } @@ -109,7 +109,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, S32 slider_left = label_width ? label_width + MULTI_SLIDERCTRL_SPACING : 0; LLRect slider_rect( slider_left, top, slider_right, bottom ); mMultiSlider = new LLMultiSlider( - "multi_slider", + std::string("multi_slider"), slider_rect, LLMultiSliderCtrl::onSliderCommit, this, initial_value, min_value, max_value, increment, @@ -124,8 +124,8 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); if( can_edit_text ) { - mEditor = new LLLineEditor( "MultiSliderCtrl Editor", text_rect, - "", font, + mEditor = new LLLineEditor( std::string("MultiSliderCtrl Editor"), text_rect, + LLStringUtil::null, font, MAX_STRING_LENGTH, &LLMultiSliderCtrl::onEditorCommit, NULL, NULL, this, &LLLineEditor::prevalidateFloat ); @@ -140,7 +140,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, } else { - mTextBox = new LLTextBox( "MultiSliderCtrl Text", text_rect, "", font); + mTextBox = new LLTextBox( std::string("MultiSliderCtrl Text"), text_rect, LLStringUtil::null, font); mTextBox->setFollowsLeft(); mTextBox->setFollowsBottom(); addChild(mTextBox); @@ -172,20 +172,20 @@ void LLMultiSliderCtrl::setValue(const LLSD& value) updateText(); } -void LLMultiSliderCtrl::setSliderValue(const LLString& name, F32 v, BOOL from_event) +void LLMultiSliderCtrl::setSliderValue(const std::string& name, F32 v, BOOL from_event) { mMultiSlider->setSliderValue(name, v, from_event ); mCurValue = mMultiSlider->getCurSliderValue(); updateText(); } -void LLMultiSliderCtrl::setCurSlider(const LLString& name) +void LLMultiSliderCtrl::setCurSlider(const std::string& name) { mMultiSlider->setCurSlider(name); mCurValue = mMultiSlider->getCurSliderValue(); } -BOOL LLMultiSliderCtrl::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLMultiSliderCtrl::setLabelArg( const std::string& key, const LLStringExplicit& text ) { BOOL res = FALSE; if (mLabelBox) @@ -210,13 +210,13 @@ BOOL LLMultiSliderCtrl::setLabelArg( const LLString& key, const LLStringExplicit return res; } -const LLString& LLMultiSliderCtrl::addSlider() +const std::string& LLMultiSliderCtrl::addSlider() { - const LLString& name = mMultiSlider->addSlider(); + const std::string& name = mMultiSlider->addSlider(); // if it returns null, pass it on - if(name == LLString::null) { - return LLString::null; + if(name == LLStringUtil::null) { + return LLStringUtil::null; } // otherwise, update stuff @@ -225,13 +225,13 @@ const LLString& LLMultiSliderCtrl::addSlider() return name; } -const LLString& LLMultiSliderCtrl::addSlider(F32 val) +const std::string& LLMultiSliderCtrl::addSlider(F32 val) { - const LLString& name = mMultiSlider->addSlider(val); + const std::string& name = mMultiSlider->addSlider(val); // if it returns null, pass it on - if(name == LLString::null) { - return LLString::null; + if(name == LLStringUtil::null) { + return LLStringUtil::null; } // otherwise, update stuff @@ -240,7 +240,7 @@ const LLString& LLMultiSliderCtrl::addSlider(F32 val) return name; } -void LLMultiSliderCtrl::deleteSlider(const LLString& name) +void LLMultiSliderCtrl::deleteSlider(const std::string& name) { mMultiSlider->deleteSlider(name); mCurValue = mMultiSlider->getCurSliderValue(); @@ -253,11 +253,11 @@ void LLMultiSliderCtrl::clear() setCurSliderValue(0.0f); if( mEditor ) { - mEditor->setText(LLString("")); + mEditor->setText(std::string("")); } if( mTextBox ) { - mTextBox->setText(LLString("")); + mTextBox->setText(std::string("")); } // get rid of sliders @@ -279,8 +279,8 @@ void LLMultiSliderCtrl::updateText() // Don't display very small negative values as -0.000 F32 displayed_value = (F32)(floor(getCurSliderValue() * pow(10.0, (F64)mPrecision) + 0.5) / pow(10.0, (F64)mPrecision)); - LLString format = llformat("%%.%df", mPrecision); - LLString text = llformat(format.c_str(), displayed_value); + std::string format = llformat("%%.%df", mPrecision); + std::string text = llformat(format.c_str(), displayed_value); if( mEditor ) { mEditor->setText( text ); @@ -302,7 +302,7 @@ void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) F32 val = self->mCurValue; F32 saved_val = self->mCurValue; - LLString text = self->mEditor->getText(); + std::string text = self->mEditor->getText(); if( LLLineEditor::postvalidateFloat( text ) ) { LLLocale locale(LLLocale::USER_LOCALE); @@ -484,13 +484,13 @@ void LLMultiSliderCtrl::reportInvalidData() } //virtual -LLString LLMultiSliderCtrl::getControlName() const +std::string LLMultiSliderCtrl::getControlName() const { return mMultiSlider->getControlName(); } // virtual -void LLMultiSliderCtrl::setControlName(const LLString& control_name, LLView* context) +void LLMultiSliderCtrl::setControlName(const std::string& control_name, LLView* context) { mMultiSlider->setControlName(control_name, context); } @@ -529,10 +529,10 @@ LLXMLNodePtr LLMultiSliderCtrl::getXML(bool save_children) const LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("multi_slider"); + std::string name("multi_slider"); node->getAttributeString("name", name); - LLString label; + std::string label; node->getAttributeString("label", label); LLRect rect; @@ -588,13 +588,13 @@ LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa { // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) if ( max_value ) - text_left = font->getWidth("0") * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); + text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); if ( increment < 1.0f ) - text_left += font->getWidth("."); // (mostly) take account of decimal point in value + text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value if ( min_value < 0.0f || max_value < 0.0f ) - text_left += font->getWidth("-"); // (mostly) take account of minus sign + text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign // padding to make things look nicer text_left += 8; diff --git a/indra/llui/llmultisliderctrl.h b/indra/llui/llmultisliderctrl.h index bbc3955f58..fc82a5501b 100644 --- a/indra/llui/llmultisliderctrl.h +++ b/indra/llui/llmultisliderctrl.h @@ -55,9 +55,9 @@ class LLSlider; class LLMultiSliderCtrl : public LLUICtrl { public: - LLMultiSliderCtrl(const LLString& name, + LLMultiSliderCtrl(const std::string& name, const LLRect& rect, - const LLString& label, + const std::string& label, const LLFontGL* font, S32 slider_left, S32 text_left, @@ -68,22 +68,22 @@ public: F32 initial_value, F32 min_value, F32 max_value, F32 increment, S32 max_sliders, BOOL allow_overlap, BOOL draw_track, BOOL use_triangle, - const LLString& control_which = LLString::null ); + const std::string& control_which = LLStringUtil::null ); virtual ~LLMultiSliderCtrl(); virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - F32 getSliderValue(const LLString& name) const; - void setSliderValue(const LLString& name, F32 v, BOOL from_event = FALSE); + F32 getSliderValue(const std::string& name) const; + void setSliderValue(const std::string& name, F32 v, BOOL from_event = FALSE); virtual void setValue(const LLSD& value ); virtual LLSD getValue() const { return mMultiSlider->getValue(); } - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); - const LLString& getCurSlider() const { return mMultiSlider->getCurSlider(); } + const std::string& getCurSlider() const { return mMultiSlider->getCurSlider(); } F32 getCurSliderValue() const { return mCurValue; } - void setCurSlider(const LLString& name); + void setCurSlider(const std::string& name); void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mMultiSlider->getCurSlider(), val, from_event); } virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } @@ -99,15 +99,15 @@ public: void setIncrement(F32 increment) {mMultiSlider->setIncrement(increment);} /// for adding and deleting sliders - const LLString& addSlider(); - const LLString& addSlider(F32 val); - void deleteSlider(const LLString& name); + const std::string& addSlider(); + const std::string& addSlider(F32 val); + void deleteSlider(const std::string& name); void deleteCurSlider() { deleteSlider(mMultiSlider->getCurSlider()); } F32 getMinValue() { return mMultiSlider->getMinValue(); } F32 getMaxValue() { return mMultiSlider->getMaxValue(); } - void setLabel(const LLString& label) { if (mLabelBox) mLabelBox->setText(label); } + void setLabel(const std::string& label) { if (mLabelBox) mLabelBox->setText(label); } void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } @@ -119,8 +119,8 @@ public: virtual void setTentative(BOOL b); // marks value as tentative virtual void onCommit(); // mark not tentative, then commit - virtual void setControlName(const LLString& control_name, LLView* context); - virtual LLString getControlName() const; + virtual void setControlName(const std::string& control_name, LLView* context); + virtual std::string getControlName() const; static void onSliderCommit(LLUICtrl* caller, void* userdata); static void onSliderMouseDown(LLUICtrl* caller,void* userdata); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index fb14470612..700558094b 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -86,10 +86,10 @@ LLPanel::LLPanel() : mRectControl() { init(); - setName("panel"); + setName(std::string("panel")); } -LLPanel::LLPanel(const LLString& name) +LLPanel::LLPanel(const std::string& name) : LLUICtrl(name, LLRect(0, 0, 0, 0), TRUE, NULL, NULL), mRectControl() { @@ -97,7 +97,7 @@ LLPanel::LLPanel(const LLString& name) } -LLPanel::LLPanel(const LLString& name, const LLRect& rect, BOOL bordered) +LLPanel::LLPanel(const std::string& name, const LLRect& rect, BOOL bordered) : LLUICtrl(name, rect, TRUE, NULL, NULL), mRectControl() { @@ -109,7 +109,7 @@ LLPanel::LLPanel(const LLString& name, const LLRect& rect, BOOL bordered) } -LLPanel::LLPanel(const LLString& name, const LLString& rect_control, BOOL bordered) +LLPanel::LLPanel(const std::string& name, const std::string& rect_control, BOOL bordered) : LLUICtrl(name, LLUI::sConfigGroup->getRect(rect_control), TRUE, NULL, NULL), mRectControl( rect_control ) { @@ -141,7 +141,7 @@ void LLPanel::addBorder(LLViewBorder::EBevel border_bevel, LLViewBorder::EStyle border_style, S32 border_thickness) { removeBorder(); - mBorder = new LLViewBorder( "panel border", + mBorder = new LLViewBorder( std::string("panel border"), LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), border_bevel, border_style, border_thickness ); mBorder->setSaveToXML(false); @@ -246,7 +246,7 @@ void LLPanel::setDefaultBtn(LLButton* btn) } } -void LLPanel::setDefaultBtn(const LLString& id) +void LLPanel::setDefaultBtn(const std::string& id) { LLButton *button = getChild<LLButton>(id); if (button) @@ -344,14 +344,14 @@ BOOL LLPanel::checkRequirements() { if (!mRequirementsError.empty()) { - LLString::format_map_t args; + LLStringUtil::format_map_t args; args["[COMPONENTS]"] = mRequirementsError; args["[FLOATER]"] = getName(); llwarns << getName() << " failed requirements check on: \n" << mRequirementsError << llendl; - alertXml("FailedRequirementsCheck", args); + alertXml(std::string("FailedRequirementsCheck"), args); mRequirementsError.clear(); return FALSE; } @@ -360,7 +360,7 @@ BOOL LLPanel::checkRequirements() } //static -void LLPanel::alertXml(LLString label, LLString::format_map_t args) +void LLPanel::alertXml(const std::string& label, LLStringUtil::format_map_t args) { sAlertQueue.push(LLAlertInfo(label,args)); } @@ -460,7 +460,7 @@ LLXMLNodePtr LLPanel::getXML(bool save_children) const LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *factory) { - LLString name("panel"); + std::string name("panel"); node->getAttributeString("name", name); LLPanel* panelp = factory->createFactoryPanel(name); @@ -489,7 +489,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *fac BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name = getName(); + std::string name = getName(); node->getAttributeString("name", name); setName(name); @@ -497,7 +497,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f initChildrenXML(node, factory); - LLString xml_filename; + std::string xml_filename; node->getAttributeString("filename", xml_filename); BOOL didPost; @@ -536,7 +536,7 @@ void LLPanel::initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory) // look for string declarations for programmatic text if (child->hasName("string")) { - LLString string_name; + std::string string_name; child->getAttributeString("name", string_name); if (!string_name.empty()) { @@ -564,9 +564,9 @@ void LLPanel::setPanelParameters(LLXMLNodePtr node, LLView* parent) LLViewBorder::getBevelFromAttribute(node, bevel_style); LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; - LLString border_string; + std::string border_string; node->getAttributeString("border_style", border_string); - LLString::toLower(border_string); + LLStringUtil::toLower(border_string); if (border_string == "texture") { @@ -601,12 +601,12 @@ void LLPanel::setPanelParameters(LLXMLNodePtr node, LLView* parent) LLUICtrlFactory::getAttributeColor(node,"bg_alpha_color", color); setTransparentColor(color); - LLString label = getLabel(); + std::string label = getLabel(); node->getAttributeString("label", label); setLabel(label); } -LLString LLPanel::getString(const LLString& name, const LLString::format_map_t& args) const +std::string LLPanel::getString(const std::string& name, const LLStringUtil::format_map_t& args) const { ui_string_map_t::const_iterator found_it = mUIStrings.find(name); if (found_it != mUIStrings.end()) @@ -616,7 +616,7 @@ LLString LLPanel::getString(const LLString& name, const LLString::format_map_t& formatted_string.setArgList(args); return formatted_string.getString(); } - LLString err_str("Failed to find string " + name + " in panel " + getName()); + std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate // *TODO: once the QAR-369 ui-cleanup work on settings is in we need to change the following line to be //if(LLUI::sConfigGroup->getBOOL("QAMode")) if(LLUI::sQAMode) @@ -627,10 +627,10 @@ LLString LLPanel::getString(const LLString& name, const LLString::format_map_t& { llwarns << err_str << llendl; } - return LLString::null; + return LLStringUtil::null; } -LLUIString LLPanel::getUIString(const LLString& name) const +LLUIString LLPanel::getUIString(const std::string& name) const { ui_string_map_t::const_iterator found_it = mUIStrings.find(name); if (found_it != mUIStrings.end()) @@ -638,11 +638,11 @@ LLUIString LLPanel::getUIString(const LLString& name) const return found_it->second; } llerrs << "Failed to find string " << name << " in panel " << getName() << llendl; - return LLUIString(LLString::null); + return LLUIString(LLStringUtil::null); } -void LLPanel::childSetVisible(const LLString& id, bool visible) +void LLPanel::childSetVisible(const std::string& id, bool visible) { LLView* child = getChild<LLView>(id); if (child) @@ -651,7 +651,7 @@ void LLPanel::childSetVisible(const LLString& id, bool visible) } } -bool LLPanel::childIsVisible(const LLString& id) const +bool LLPanel::childIsVisible(const std::string& id) const { LLView* child = getChild<LLView>(id); if (child) @@ -661,7 +661,7 @@ bool LLPanel::childIsVisible(const LLString& id) const return false; } -void LLPanel::childSetEnabled(const LLString& id, bool enabled) +void LLPanel::childSetEnabled(const std::string& id, bool enabled) { LLView* child = getChild<LLView>(id); if (child) @@ -670,7 +670,7 @@ void LLPanel::childSetEnabled(const LLString& id, bool enabled) } } -void LLPanel::childSetTentative(const LLString& id, bool tentative) +void LLPanel::childSetTentative(const std::string& id, bool tentative) { LLView* child = getChild<LLView>(id); if (child) @@ -679,7 +679,7 @@ void LLPanel::childSetTentative(const LLString& id, bool tentative) } } -bool LLPanel::childIsEnabled(const LLString& id) const +bool LLPanel::childIsEnabled(const std::string& id) const { LLView* child = getChild<LLView>(id); if (child) @@ -690,7 +690,7 @@ bool LLPanel::childIsEnabled(const LLString& id) const } -void LLPanel::childSetToolTip(const LLString& id, const LLString& msg) +void LLPanel::childSetToolTip(const std::string& id, const std::string& msg) { LLView* child = getChild<LLView>(id); if (child) @@ -699,7 +699,7 @@ void LLPanel::childSetToolTip(const LLString& id, const LLString& msg) } } -void LLPanel::childSetRect(const LLString& id, const LLRect& rect) +void LLPanel::childSetRect(const std::string& id, const LLRect& rect) { LLView* child = getChild<LLView>(id); if (child) @@ -708,7 +708,7 @@ void LLPanel::childSetRect(const LLString& id, const LLRect& rect) } } -bool LLPanel::childGetRect(const LLString& id, LLRect& rect) const +bool LLPanel::childGetRect(const std::string& id, LLRect& rect) const { LLView* child = getChild<LLView>(id); if (child) @@ -719,7 +719,7 @@ bool LLPanel::childGetRect(const LLString& id, LLRect& rect) const return false; } -void LLPanel::childSetFocus(const LLString& id, BOOL focus) +void LLPanel::childSetFocus(const std::string& id, BOOL focus) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -728,7 +728,7 @@ void LLPanel::childSetFocus(const LLString& id, BOOL focus) } } -BOOL LLPanel::childHasFocus(const LLString& id) +BOOL LLPanel::childHasFocus(const std::string& id) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -743,7 +743,7 @@ BOOL LLPanel::childHasFocus(const LLString& id) } -void LLPanel::childSetFocusChangedCallback(const LLString& id, void (*cb)(LLFocusableElement*, void*), void* user_data) +void LLPanel::childSetFocusChangedCallback(const std::string& id, void (*cb)(LLFocusableElement*, void*), void* user_data) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -752,7 +752,7 @@ void LLPanel::childSetFocusChangedCallback(const LLString& id, void (*cb)(LLFocu } } -void LLPanel::childSetCommitCallback(const LLString& id, void (*cb)(LLUICtrl*, void*), void *userdata ) +void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void *userdata ) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -762,7 +762,7 @@ void LLPanel::childSetCommitCallback(const LLString& id, void (*cb)(LLUICtrl*, v } } -void LLPanel::childSetDoubleClickCallback(const LLString& id, void (*cb)(void*), void *userdata ) +void LLPanel::childSetDoubleClickCallback(const std::string& id, void (*cb)(void*), void *userdata ) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -775,7 +775,7 @@ void LLPanel::childSetDoubleClickCallback(const LLString& id, void (*cb)(void*), } } -void LLPanel::childSetValidate(const LLString& id, BOOL (*cb)(LLUICtrl*, void*)) +void LLPanel::childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*)) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -784,7 +784,7 @@ void LLPanel::childSetValidate(const LLString& id, BOOL (*cb)(LLUICtrl*, void*)) } } -void LLPanel::childSetUserData(const LLString& id, void* userdata) +void LLPanel::childSetUserData(const std::string& id, void* userdata) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -793,7 +793,7 @@ void LLPanel::childSetUserData(const LLString& id, void* userdata) } } -void LLPanel::childSetColor(const LLString& id, const LLColor4& color) +void LLPanel::childSetColor(const std::string& id, const LLColor4& color) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -802,7 +802,7 @@ void LLPanel::childSetColor(const LLString& id, const LLColor4& color) } } -LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const LLString& id) const +LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const std::string& id) const { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -812,7 +812,7 @@ LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const LLString& id return NULL; } -LLCtrlListInterface* LLPanel::childGetListInterface(const LLString& id) const +LLCtrlListInterface* LLPanel::childGetListInterface(const std::string& id) const { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -822,7 +822,7 @@ LLCtrlListInterface* LLPanel::childGetListInterface(const LLString& id) const return NULL; } -LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const LLString& id) const +LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const std::string& id) const { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -832,7 +832,7 @@ LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const LLString& id) cons return NULL; } -void LLPanel::childSetValue(const LLString& id, LLSD value) +void LLPanel::childSetValue(const std::string& id, LLSD value) { LLView* child = getChild<LLView>(id, true); if (child) @@ -841,7 +841,7 @@ void LLPanel::childSetValue(const LLString& id, LLSD value) } } -LLSD LLPanel::childGetValue(const LLString& id) const +LLSD LLPanel::childGetValue(const std::string& id) const { LLView* child = getChild<LLView>(id, true); if (child) @@ -852,7 +852,7 @@ LLSD LLPanel::childGetValue(const LLString& id) const return LLSD(); } -BOOL LLPanel::childSetTextArg(const LLString& id, const LLString& key, const LLStringExplicit& text) +BOOL LLPanel::childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -862,7 +862,7 @@ BOOL LLPanel::childSetTextArg(const LLString& id, const LLString& key, const LLS return FALSE; } -BOOL LLPanel::childSetLabelArg(const LLString& id, const LLString& key, const LLStringExplicit& text) +BOOL LLPanel::childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text) { LLView* child = getChild<LLView>(id); if (child) @@ -872,7 +872,7 @@ BOOL LLPanel::childSetLabelArg(const LLString& id, const LLString& key, const LL return FALSE; } -BOOL LLPanel::childSetToolTipArg(const LLString& id, const LLString& key, const LLStringExplicit& text) +BOOL LLPanel::childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text) { LLView* child = getChildView(id, true, FALSE); if (child) @@ -882,7 +882,7 @@ BOOL LLPanel::childSetToolTipArg(const LLString& id, const LLString& key, const return FALSE; } -void LLPanel::childSetMinValue(const LLString& id, LLSD min_value) +void LLPanel::childSetMinValue(const std::string& id, LLSD min_value) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -891,7 +891,7 @@ void LLPanel::childSetMinValue(const LLString& id, LLSD min_value) } } -void LLPanel::childSetMaxValue(const LLString& id, LLSD max_value) +void LLPanel::childSetMaxValue(const std::string& id, LLSD max_value) { LLUICtrl* child = getChild<LLUICtrl>(id, true); if (child) @@ -900,7 +900,7 @@ void LLPanel::childSetMaxValue(const LLString& id, LLSD max_value) } } -void LLPanel::childShowTab(const LLString& id, const LLString& tabname, bool visible) +void LLPanel::childShowTab(const std::string& id, const std::string& tabname, bool visible) { LLTabContainer* child = getChild<LLTabContainer>(id); if (child) @@ -909,7 +909,7 @@ void LLPanel::childShowTab(const LLString& id, const LLString& tabname, bool vis } } -LLPanel *LLPanel::childGetVisibleTab(const LLString& id) const +LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const { LLTabContainer* child = getChild<LLTabContainer>(id); if (child) @@ -919,7 +919,7 @@ LLPanel *LLPanel::childGetVisibleTab(const LLString& id) const return NULL; } -void LLPanel::childSetTabChangeCallback(const LLString& id, const LLString& tabname, void (*on_tab_clicked)(void*, bool), void *userdata) +void LLPanel::childSetTabChangeCallback(const std::string& id, const std::string& tabname, void (*on_tab_clicked)(void*, bool), void *userdata) { LLTabContainer* child = getChild<LLTabContainer>(id); if (child) @@ -933,7 +933,7 @@ void LLPanel::childSetTabChangeCallback(const LLString& id, const LLString& tabn } } -void LLPanel::childSetKeystrokeCallback(const LLString& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data) +void LLPanel::childSetKeystrokeCallback(const std::string& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data) { LLLineEditor* child = getChild<LLLineEditor>(id); if (child) @@ -946,7 +946,7 @@ void LLPanel::childSetKeystrokeCallback(const LLString& id, void (*keystroke_cal } } -void LLPanel::childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWString &) ) +void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ) { LLLineEditor* child = getChild<LLLineEditor>(id); if (child) @@ -955,7 +955,7 @@ void LLPanel::childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWStri } } -void LLPanel::childSetWrappedText(const LLString& id, const LLString& text, bool visible) +void LLPanel::childSetWrappedText(const std::string& id, const std::string& text, bool visible) { LLTextBox* child = getChild<LLTextBox>(id); if (child) @@ -965,7 +965,7 @@ void LLPanel::childSetWrappedText(const LLString& id, const LLString& text, bool } } -void LLPanel::childSetAction(const LLString& id, void(*function)(void*), void* value) +void LLPanel::childSetAction(const std::string& id, void(*function)(void*), void* value) { LLButton* button = getChild<LLButton>(id); if (button) @@ -974,7 +974,7 @@ void LLPanel::childSetAction(const LLString& id, void(*function)(void*), void* v } } -void LLPanel::childSetActionTextbox(const LLString& id, void(*function)(void*)) +void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*)) { LLTextBox* textbox = getChild<LLTextBox>(id); if (textbox) @@ -983,7 +983,7 @@ void LLPanel::childSetActionTextbox(const LLString& id, void(*function)(void*)) } } -void LLPanel::childSetControlName(const LLString& id, const LLString& control_name) +void LLPanel::childSetControlName(const std::string& id, const std::string& control_name) { LLView* view = getChild<LLView>(id); if (view) @@ -993,7 +993,7 @@ void LLPanel::childSetControlName(const LLString& id, const LLString& control_na } //virtual -LLView* LLPanel::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const +LLView* LLPanel::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const { // just get child, don't try to create a dummy one LLView* view = LLUICtrl::getChildView(name, recurse, FALSE); @@ -1008,7 +1008,7 @@ LLView* LLPanel::getChildView(const LLString& name, BOOL recurse, BOOL create_if return view; } -void LLPanel::childNotFound(const LLString& id) const +void LLPanel::childNotFound(const std::string& id) const { if (mExpectedMembers.find(id) == mExpectedMembers.end()) { @@ -1022,7 +1022,7 @@ void LLPanel::childDisplayNotFound() { return; } - LLString msg; + std::string msg; expected_members_list_t::iterator itor; for (itor=mNewExpectedMembers.begin(); itor!=mNewExpectedMembers.end(); ++itor) { @@ -1031,7 +1031,7 @@ void LLPanel::childDisplayNotFound() mExpectedMembers.insert(*itor); } mNewExpectedMembers.clear(); - LLString::format_map_t args; + LLStringUtil::format_map_t args; args["[CONTROLS]"] = msg; LLAlertDialog::showXml("FloaterNotFound", args); } @@ -1071,7 +1071,7 @@ struct LLLayoutStack::LLEmbeddedPanel { min_dim = mMinWidth; } - mResizeBar = new LLResizeBar("resizer", mPanel, LLRect(), min_dim, S32_MAX, side); + mResizeBar = new LLResizeBar(std::string("resizer"), mPanel, LLRect(), min_dim, S32_MAX, side); mResizeBar->setEnableSnapping(FALSE); // panels initialized as hidden should not start out partially visible if (!mPanel->getVisible()) @@ -1166,7 +1166,7 @@ LLXMLNodePtr LLLayoutStack::getXML(bool save_children) const //static LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString orientation_string("vertical"); + std::string orientation_string("vertical"); node->getAttributeString("orientation", orientation_string); eLayoutOrientation orientation = VERTICAL; @@ -1190,7 +1190,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor // don't allow negative spacing values layout_stackp->mPanelSpacing = llmax(layout_stackp->mPanelSpacing, 0); - LLString name("stack"); + std::string name("stack"); node->getAttributeString("name", name); layout_stackp->setName(name); @@ -1223,7 +1223,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor BOOL user_resize = FALSE; child->getAttributeBOOL("user_resize", user_resize); - LLPanel* panelp = new LLPanel("auto_panel"); + LLPanel* panelp = new LLPanel(std::string("auto_panel")); LLView* new_child = factory->createWidget(panelp, child); if (new_child) { diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 0485274055..1fe6a5679e 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -51,10 +51,10 @@ const BOOL BORDER_NO = FALSE; struct LLAlertInfo { - LLString mLabel; - LLString::format_map_t mArgs; + std::string mLabel; + LLStringUtil::format_map_t mArgs; - LLAlertInfo(LLString label, LLString::format_map_t args) : mLabel(label), mArgs(args) { } + LLAlertInfo(std::string label, LLStringUtil::format_map_t args) : mLabel(label), mArgs(args) { } LLAlertInfo(){} }; @@ -71,13 +71,13 @@ public: // minimal constructor for data-driven initialization LLPanel(); - LLPanel(const LLString& name); + LLPanel(const std::string& name); // Position and size not saved - LLPanel(const LLString& name, const LLRect& rect, BOOL bordered = TRUE); + LLPanel(const std::string& name, const LLRect& rect, BOOL bordered = TRUE); // Position and size are saved to rect_control - LLPanel(const LLString& name, const LLString& rect_control, BOOL bordered = TRUE); + LLPanel(const std::string& name, const std::string& rect_control, BOOL bordered = TRUE); /*virtual*/ ~LLPanel(); @@ -87,7 +87,7 @@ public: /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; // Override to set not found list: - virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; + virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; // From LLFocusableElement /*virtual*/ void setFocus( BOOL b ); @@ -105,7 +105,7 @@ public: BOOL hasBorder() const { return mBorder != NULL; } void setBorderVisible( BOOL b ); - template <class T> void requires(LLString name) + template <class T> void requires(const std::string& name) { // check for widget with matching type and name if (LLView::getChild<T>(name) == NULL) @@ -115,7 +115,7 @@ public: } // requires LLView by default - void requires(LLString name) + void requires(const std::string& name) { requires<LLView>(name); } @@ -130,13 +130,13 @@ public: void setBackgroundOpaque(BOOL b) { mBgOpaque = b; } BOOL isBackgroundOpaque() const { return mBgOpaque; } void setDefaultBtn(LLButton* btn = NULL); - void setDefaultBtn(const LLString& id); + void setDefaultBtn(const std::string& id); void updateDefaultBtn(); void setLabel(const LLStringExplicit& label) { mLabel = label; } - LLString getLabel() const { return mLabel; } + std::string getLabel() const { return mLabel; } - void setRectControl(const LLString& rect_control) { mRectControl.assign(rect_control); } - const LLString& getRectControl() const { return mRectControl; } + void setRectControl(const std::string& rect_control) { mRectControl.assign(rect_control); } + const std::string& getRectControl() const { return mRectControl; } void storeRectControl(); void setCtrlsEnabled(BOOL b); @@ -151,83 +151,83 @@ public: void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory); void setPanelParameters(LLXMLNodePtr node, LLView *parentp); - LLString getString(const LLString& name, const LLString::format_map_t& args = LLUIString::sNullArgs) const; - LLUIString getUIString(const LLString& name) const; + std::string getString(const std::string& name, const LLStringUtil::format_map_t& args = LLUIString::sNullArgs) const; + LLUIString getUIString(const std::string& name) const; // ** Wrappers for setting child properties by name ** -TomY // LLView - void childSetVisible(const LLString& name, bool visible); - void childShow(const LLString& name) { childSetVisible(name, true); } - void childHide(const LLString& name) { childSetVisible(name, false); } - bool childIsVisible(const LLString& id) const; - void childSetTentative(const LLString& name, bool tentative); + void childSetVisible(const std::string& name, bool visible); + void childShow(const std::string& name) { childSetVisible(name, true); } + void childHide(const std::string& name) { childSetVisible(name, false); } + bool childIsVisible(const std::string& id) const; + void childSetTentative(const std::string& name, bool tentative); - void childSetEnabled(const LLString& name, bool enabled); - void childEnable(const LLString& name) { childSetEnabled(name, true); } - void childDisable(const LLString& name) { childSetEnabled(name, false); }; - bool childIsEnabled(const LLString& id) const; + void childSetEnabled(const std::string& name, bool enabled); + void childEnable(const std::string& name) { childSetEnabled(name, true); } + void childDisable(const std::string& name) { childSetEnabled(name, false); }; + bool childIsEnabled(const std::string& id) const; - void childSetToolTip(const LLString& id, const LLString& msg); - void childSetRect(const LLString& id, const LLRect &rect); - bool childGetRect(const LLString& id, LLRect& rect) const; + void childSetToolTip(const std::string& id, const std::string& msg); + void childSetRect(const std::string& id, const LLRect &rect); + bool childGetRect(const std::string& id, LLRect& rect) const; // LLUICtrl - void childSetFocus(const LLString& id, BOOL focus = TRUE); - BOOL childHasFocus(const LLString& id); - void childSetFocusChangedCallback(const LLString& id, void (*cb)(LLFocusableElement*, void*), void* user_data = NULL); + void childSetFocus(const std::string& id, BOOL focus = TRUE); + BOOL childHasFocus(const std::string& id); + void childSetFocusChangedCallback(const std::string& id, void (*cb)(LLFocusableElement*, void*), void* user_data = NULL); - void childSetCommitCallback(const LLString& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); - void childSetDoubleClickCallback(const LLString& id, void (*cb)(void*), void* userdata = NULL ); - void childSetValidate(const LLString& id, BOOL (*cb)(LLUICtrl*, void*) ); - void childSetUserData(const LLString& id, void* userdata); + void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); + void childSetDoubleClickCallback(const std::string& id, void (*cb)(void*), void* userdata = NULL ); + void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) ); + void childSetUserData(const std::string& id, void* userdata); - void childSetColor(const LLString& id, const LLColor4& color); + void childSetColor(const std::string& id, const LLColor4& color); - LLCtrlSelectionInterface* childGetSelectionInterface(const LLString& id) const; - LLCtrlListInterface* childGetListInterface(const LLString& id) const; - LLCtrlScrollInterface* childGetScrollInterface(const LLString& id) const; + LLCtrlSelectionInterface* childGetSelectionInterface(const std::string& id) const; + LLCtrlListInterface* childGetListInterface(const std::string& id) const; + LLCtrlScrollInterface* childGetScrollInterface(const std::string& id) const; // This is the magic bullet for data-driven UI - void childSetValue(const LLString& id, LLSD value); - LLSD childGetValue(const LLString& id) const; + void childSetValue(const std::string& id, LLSD value); + LLSD childGetValue(const std::string& id) const; // For setting text / label replacement params, e.g. "Hello [NAME]" // Not implemented for all types, defaults to noop, returns FALSE if not applicaple - BOOL childSetTextArg(const LLString& id, const LLString& key, const LLStringExplicit& text); - BOOL childSetLabelArg(const LLString& id, const LLString& key, const LLStringExplicit& text); - BOOL childSetToolTipArg(const LLString& id, const LLString& key, const LLStringExplicit& text); + BOOL childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text); + BOOL childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text); + BOOL childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text); // LLSlider / LLMultiSlider / LLSpinCtrl - void childSetMinValue(const LLString& id, LLSD min_value); - void childSetMaxValue(const LLString& id, LLSD max_value); + void childSetMinValue(const std::string& id, LLSD min_value); + void childSetMaxValue(const std::string& id, LLSD max_value); // LLTabContainer - void childShowTab(const LLString& id, const LLString& tabname, bool visible = true); - LLPanel *childGetVisibleTab(const LLString& id) const; - void childSetTabChangeCallback(const LLString& id, const LLString& tabname, void (*on_tab_clicked)(void*, bool), void *userdata); + void childShowTab(const std::string& id, const std::string& tabname, bool visible = true); + LLPanel *childGetVisibleTab(const std::string& id) const; + void childSetTabChangeCallback(const std::string& id, const std::string& tabname, void (*on_tab_clicked)(void*, bool), void *userdata); // LLTextBox - void childSetWrappedText(const LLString& id, const LLString& text, bool visible = true); + void childSetWrappedText(const std::string& id, const std::string& text, bool visible = true); // LLTextBox/LLTextEditor/LLLineEditor - void childSetText(const LLString& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } - LLString childGetText(const LLString& id) const { return childGetValue(id).asString(); } + void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } + std::string childGetText(const std::string& id) const { return childGetValue(id).asString(); } // LLLineEditor - void childSetKeystrokeCallback(const LLString& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data); - void childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWString &) ); + void childSetKeystrokeCallback(const std::string& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data); + void childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ); // LLButton - void childSetAction(const LLString& id, void(*function)(void*), void* value); - void childSetActionTextbox(const LLString& id, void(*function)(void*)); - void childSetControlName(const LLString& id, const LLString& control_name); + void childSetAction(const std::string& id, void(*function)(void*), void* value); + void childSetActionTextbox(const std::string& id, void(*function)(void*)); + void childSetControlName(const std::string& id, const std::string& control_name); // Error reporting - void childNotFound(const LLString& id) const; + void childNotFound(const std::string& id) const; void childDisplayNotFound(); - static void alertXml(LLString label, LLString::format_map_t args = LLString::format_map_t()); + static void alertXml(const std::string& label, LLStringUtil::format_map_t args = LLStringUtil::format_map_t()); static BOOL nextAlert(LLAlertInfo &alert); static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -245,11 +245,11 @@ private: virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group); // Unified error reporting for the child* functions - typedef std::set<LLString> expected_members_list_t; + typedef std::set<std::string> expected_members_list_t; mutable expected_members_list_t mExpectedMembers; mutable expected_members_list_t mNewExpectedMembers; - LLString mRectControl; + std::string mRectControl; LLColor4 mBgColorAlpha; LLColor4 mBgColorOpaque; LLColor4 mDefaultBtnHighlight; @@ -257,14 +257,14 @@ private: BOOL mBgOpaque; LLViewBorder* mBorder; LLButton* mDefaultBtn; - LLString mLabel; + std::string mLabel; S32 mLastTabGroup; LLRootHandle<LLPanel> mPanelHandle; - typedef std::map<LLString, LLUIString> ui_string_map_t; + typedef std::map<std::string, LLUIString> ui_string_map_t; ui_string_map_t mUIStrings; - LLString mRequirementsError; + std::string mRequirementsError; typedef std::queue<LLAlertInfo> alert_queue_t; static alert_queue_t sAlertQueue; diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 6d496b391f..b8f06e53ee 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -44,8 +44,8 @@ static LLRegisterWidget<LLRadioGroup> r("radio_group"); -LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect, - const LLString& control_name, +LLRadioGroup::LLRadioGroup(const std::string& name, const LLRect& rect, + const std::string& control_name, LLUICtrlCallback callback, void* userdata, BOOL border) @@ -56,7 +56,7 @@ LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect, init(border); } -LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect, +LLRadioGroup::LLRadioGroup(const std::string& name, const LLRect& rect, S32 initial_index, LLUICtrlCallback callback, void* userdata, @@ -71,7 +71,7 @@ void LLRadioGroup::init(BOOL border) { if (border) { - addChild( new LLViewBorder( "radio group border", + addChild( new LLViewBorder( std::string("radio group border"), LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), LLViewBorder::BEVEL_NONE, LLViewBorder::STYLE_LINE, @@ -252,7 +252,7 @@ void LLRadioGroup::draw() // When adding a button, we need to ensure that the radio // group gets a message when the button is clicked. -LLRadioCtrl* LLRadioGroup::addRadioButton(const LLString& name, const LLString& label, const LLRect& rect, const LLFontGL* font ) +LLRadioCtrl* LLRadioGroup::addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font ) { // Highlight will get fixed in draw method above LLRadioCtrl* radio = new LLRadioCtrl(name, rect, label, font, @@ -298,7 +298,7 @@ void LLRadioGroup::onClickButton(LLUICtrl* ui_ctrl, void* userdata) void LLRadioGroup::setValue( const LLSD& value ) { - LLString value_name = value.asString(); + std::string value_name = value.asString(); int idx = 0; for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) @@ -357,7 +357,7 @@ LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const LLXMLNodePtr child_node = radio->LLView::getXML(); child_node->setStringValue(radio->getLabel()); - child_node->setName("radio_item"); + child_node->setName(std::string("radio_item")); node->addChild(child_node); } @@ -368,7 +368,7 @@ LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const // static LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("radio_group"); + std::string name("radio_group"); node->getAttributeString("name", name); U32 initial_value = 0; @@ -387,7 +387,7 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory NULL, draw_border); - const LLString& contents = node->getValue(); + const std::string& contents = node->getValue(); LLRect group_rect = radio_group->getRect(); @@ -406,10 +406,10 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory while(token_iter != tokens.end()) { - const char* line = token_iter->c_str(); + const std::string& line = *token_iter; LLRect rect(HPAD, cur_y, group_rect.getWidth() - (2 * HPAD), cur_y - 15); cur_y -= VPAD + 15; - radio_group->addRadioButton("radio", line, rect, font); + radio_group->addRadioButton(std::string("radio"), line, rect, font); ++token_iter; } llwarns << "Legacy radio group format used! Please convert to use <radio_item> tags!" << llendl; @@ -425,10 +425,10 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory LLRect item_rect; createRect(child, item_rect, radio_group, rect); - LLString radioname("radio"); + std::string radioname("radio"); child->getAttributeString("name", radioname); - LLString item_label = child->getTextContents(); - LLRadioCtrl* radio = radio_group->addRadioButton(radioname, item_label.c_str(), item_rect, font); + std::string item_label = child->getTextContents(); + LLRadioCtrl* radio = radio_group->addRadioButton(radioname, item_label, item_rect, font); radio->initFromXML(child, radio_group); } diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h index b9e2167446..fce467872a 100644 --- a/indra/llui/llradiogroup.h +++ b/indra/llui/llradiogroup.h @@ -43,7 +43,7 @@ class LLRadioCtrl : public LLCheckBoxCtrl { public: - LLRadioCtrl(const LLString& name, const LLRect& rect, const LLString& label, const LLFontGL* font = NULL, + LLRadioCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLFontGL* font = NULL, void (*commit_callback)(LLUICtrl*, void*) = NULL, void* callback_userdata = NULL) : LLCheckBoxCtrl(name, rect, label, font, commit_callback, callback_userdata, FALSE, RADIO_STYLE) { @@ -67,15 +67,15 @@ public: // Build a radio group. The number (0...n-1) of the currently selected // element will be stored in the named control. After the control is // changed the callback will be called. - LLRadioGroup(const LLString& name, const LLRect& rect, - const LLString& control_name, + LLRadioGroup(const std::string& name, const LLRect& rect, + const std::string& control_name, LLUICtrlCallback callback = NULL, void* userdata = NULL, BOOL border = TRUE); // Another radio group constructor, but this one doesn't rely on // needing a control - LLRadioGroup(const LLString& name, const LLRect& rect, + LLRadioGroup(const std::string& name, const LLRect& rect, S32 initial_index, LLUICtrlCallback callback = NULL, void* userdata = NULL, @@ -106,7 +106,7 @@ public: // You must use this method to add buttons to a radio group. // Don't use addChild -- it won't set the callback function // correctly. - LLRadioCtrl* addRadioButton(const LLString& name, const LLString& label, const LLRect& rect, const LLFontGL* font); + LLRadioCtrl* addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font); LLRadioCtrl* getRadioButton(const S32& index) { return mRadioButtons[index]; } // Update the control as needed. Userdata must be a pointer to the button. static void onClickButton(LLUICtrl* radio, void* userdata); diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 82be9672b6..d69145d24e 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -39,7 +39,7 @@ #include "llfocusmgr.h" #include "llwindow.h" -LLResizeBar::LLResizeBar( const LLString& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ) +LLResizeBar::LLResizeBar( const std::string& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ) : LLView( name, rect, TRUE ), mDragLastScreenX( 0 ), diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index b760abf13d..bc7fdffc41 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -40,7 +40,7 @@ class LLResizeBar : public LLView public: enum Side { LEFT, TOP, RIGHT, BOTTOM }; - LLResizeBar(const LLString& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ); + LLResizeBar(const std::string& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ); // virtual void draw(); No appearance virtual BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp index 4da2d4fca1..096aa91c81 100644 --- a/indra/llui/llresizehandle.cpp +++ b/indra/llui/llresizehandle.cpp @@ -43,7 +43,7 @@ const S32 RESIZE_BORDER_WIDTH = 3; -LLResizeHandle::LLResizeHandle( const LLString& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner ) +LLResizeHandle::LLResizeHandle( const std::string& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner ) : LLView( name, rect, TRUE ), mDragLastScreenX( 0 ), diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h index 15336948e2..8054806e40 100644 --- a/indra/llui/llresizehandle.h +++ b/indra/llui/llresizehandle.h @@ -44,7 +44,7 @@ public: enum ECorner { LEFT_TOP, LEFT_BOTTOM, RIGHT_TOP, RIGHT_BOTTOM }; - LLResizeHandle(const LLString& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner = RIGHT_BOTTOM ); + LLResizeHandle(const std::string& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner = RIGHT_BOTTOM ); virtual void draw(); virtual BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 6cfc6a924b..cb4d8c3373 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -292,7 +292,7 @@ std::string LLResMgr::getMonetaryString( S32 input ) const BOOL negative_before = negative && (conv->n_sign_posn != 2); BOOL negative_after = negative && (conv->n_sign_posn == 2); - LLString digits = llformat("%u", abs(input)); + std::string digits = llformat("%u", abs(input)); if( !grouping || !grouping[0] ) { if( negative_before ) @@ -378,10 +378,10 @@ std::string LLResMgr::getMonetaryString( S32 input ) const return output; } -void LLResMgr::getIntegerString( LLString& output, S32 input ) const +void LLResMgr::getIntegerString( std::string& output, S32 input ) const { S32 fraction = 0; - LLString fraction_string; + std::string fraction_string; S32 remaining_count = input; while(remaining_count > 0) { @@ -415,16 +415,16 @@ void LLResMgr::getIntegerString( LLString& output, S32 input ) const } } -const LLString LLFONT_ID_NAMES[] = +const std::string LLFONT_ID_NAMES[] = { - LLString("OCRA"), - LLString("SANSSERIF"), - LLString("SANSSERIF_SMALL"), - LLString("SANSSERIF_BIG"), - LLString("SMALL"), + std::string("OCRA"), + std::string("SANSSERIF"), + std::string("SANSSERIF_SMALL"), + std::string("SANSSERIF_BIG"), + std::string("SMALL"), }; -const LLFontGL* LLResMgr::getRes( LLString font_id ) const +const LLFontGL* LLResMgr::getRes( std::string font_id ) const { for (S32 i=0; i<LLFONT_COUNT; ++i) { @@ -437,21 +437,21 @@ const LLFontGL* LLResMgr::getRes( LLString font_id ) const } #if LL_WINDOWS -const LLString LLLocale::USER_LOCALE("English_United States.1252");// = LLString::null; -const LLString LLLocale::SYSTEM_LOCALE("English_United States.1252"); +const std::string LLLocale::USER_LOCALE("English_United States.1252");// = LLStringUtil::null; +const std::string LLLocale::SYSTEM_LOCALE("English_United States.1252"); #elif LL_DARWIN -const LLString LLLocale::USER_LOCALE("en_US.iso8859-1");// = LLString::null; -const LLString LLLocale::SYSTEM_LOCALE("en_US.iso8859-1"); +const std::string LLLocale::USER_LOCALE("en_US.iso8859-1");// = LLStringUtil::null; +const std::string LLLocale::SYSTEM_LOCALE("en_US.iso8859-1"); #elif LL_SOLARIS -const LLString LLLocale::USER_LOCALE("en_US.ISO8859-1"); -const LLString LLLocale::SYSTEM_LOCALE("C"); +const std::string LLLocale::USER_LOCALE("en_US.ISO8859-1"); +const std::string LLLocale::SYSTEM_LOCALE("C"); #else // LL_LINUX likes this -const LLString LLLocale::USER_LOCALE("en_US.utf8"); -const LLString LLLocale::SYSTEM_LOCALE("C"); +const std::string LLLocale::USER_LOCALE("en_US.utf8"); +const std::string LLLocale::SYSTEM_LOCALE("C"); #endif -LLLocale::LLLocale(const LLString& locale_string) +LLLocale::LLLocale(const std::string& locale_string) { mPrevLocaleString = setlocale( LC_ALL, NULL ); char* new_locale_string = setlocale( LC_ALL, locale_string.c_str()); diff --git a/indra/llui/llresmgr.h b/indra/llui/llresmgr.h index 2e39387ae1..ddddec71a5 100644 --- a/indra/llui/llresmgr.h +++ b/indra/llui/llresmgr.h @@ -71,11 +71,11 @@ public: char getMonetaryDecimalPoint() const; char getMonetaryThousandsSeparator() const; std::string getMonetaryString( S32 input ) const; - void getIntegerString( LLString& output, S32 input ) const; + void getIntegerString( std::string& output, S32 input ) const; // const char* getRes( LLSTR_ID string_id ) const { return mStrings[ string_id ]; } const LLFontGL* getRes( LLFONT_ID font_id ) const { return mFonts[ font_id ]; } - const LLFontGL* getRes( LLString font_id ) const; + const LLFontGL* getRes( std::string font_id ) const; private: LLLOCALE_ID mLocale; @@ -92,14 +92,14 @@ private: class LLLocale { public: - LLLocale(const LLString& locale_string); + LLLocale(const std::string& locale_string); virtual ~LLLocale(); - static const LLString USER_LOCALE; - static const LLString SYSTEM_LOCALE; + static const std::string USER_LOCALE; + static const std::string SYSTEM_LOCALE; private: - LLString mPrevLocaleString; + std::string mPrevLocaleString; }; #endif // LL_RESMGR_ diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 5bc2c5cf85..07babd9f55 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -47,7 +47,7 @@ #include "llrender.h" LLScrollbar::LLScrollbar( - const LLString& name, LLRect rect, + const std::string& name, LLRect rect, LLScrollbar::ORIENTATION orientation, S32 doc_size, S32 doc_pos, S32 page_size, void (*change_callback)( S32 new_pos, LLScrollbar* self, void* userdata ), @@ -82,10 +82,10 @@ LLScrollbar::LLScrollbar( // Page up and page down buttons LLRect line_up_rect; - LLString line_up_img; - LLString line_up_selected_img; - LLString line_down_img; - LLString line_down_selected_img; + std::string line_up_img; + std::string line_up_selected_img; + std::string line_down_img; + std::string line_down_selected_img; LLRect line_down_rect; @@ -111,10 +111,9 @@ LLScrollbar::LLScrollbar( line_down_selected_img="UIImgBtnScrollRightInUUID"; } - LLButton* line_up_btn = new LLButton( - "Line Up", line_up_rect, - line_up_img, line_up_selected_img, "", - &LLScrollbar::onLineUpBtnPressed, this, LLFontGL::sSansSerif ); + LLButton* line_up_btn = new LLButton(std::string("Line Up"), line_up_rect, + line_up_img, line_up_selected_img, LLStringUtil::null, + &LLScrollbar::onLineUpBtnPressed, this, LLFontGL::sSansSerif ); if( LLScrollbar::VERTICAL == mOrientation ) { line_up_btn->setFollowsRight(); @@ -130,10 +129,9 @@ LLScrollbar::LLScrollbar( line_up_btn->setTabStop(FALSE); addChild(line_up_btn); - LLButton* line_down_btn = new LLButton( - "Line Down", line_down_rect, - line_down_img, line_down_selected_img, "", - &LLScrollbar::onLineDownBtnPressed, this, LLFontGL::sSansSerif ); + LLButton* line_down_btn = new LLButton(std::string("Line Down"), line_down_rect, + line_down_img, line_down_selected_img, LLStringUtil::null, + &LLScrollbar::onLineDownBtnPressed, this, LLFontGL::sSansSerif ); line_down_btn->setFollowsRight(); line_down_btn->setFollowsBottom(); line_down_btn->setHeldDownCallback( &LLScrollbar::onLineDownBtnPressed ); @@ -417,7 +415,7 @@ BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks) } BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, LLString &tooltip_msg) + EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg) { // enable this to get drag and drop to control scrollbars //if (!drop) diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index 4d3b711b1a..d35dc10bd4 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -51,7 +51,7 @@ class LLScrollbar public: enum ORIENTATION { HORIZONTAL, VERTICAL }; - LLScrollbar(const LLString& name, LLRect rect, + LLScrollbar(const std::string& name, LLRect rect, ORIENTATION orientation, S32 doc_size, S32 doc_pos, S32 page_size, void(*change_callback)( S32 new_pos, LLScrollbar* self, void* userdata ), @@ -69,7 +69,7 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, LLString &tooltip_msg); + EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 3cb4ecc172..8bb051f3f5 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -60,7 +60,7 @@ static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; static LLRegisterWidget<LLScrollableContainerView> r("scroll_container"); // Default constructor -LLScrollableContainerView::LLScrollableContainerView( const LLString& name, +LLScrollableContainerView::LLScrollableContainerView( const std::string& name, const LLRect& rect, LLView* scrolled_view, BOOL is_opaque, @@ -82,7 +82,7 @@ LLScrollableContainerView::LLScrollableContainerView( const LLString& name, } // LLUICtrl constructor -LLScrollableContainerView::LLScrollableContainerView( const LLString& name, const LLRect& rect, +LLScrollableContainerView::LLScrollableContainerView( const std::string& name, const LLRect& rect, LLUICtrl* scrolled_ctrl, BOOL is_opaque, const LLColor4& bg_color) : LLUICtrl( name, rect, FALSE, NULL, NULL ), @@ -104,7 +104,7 @@ LLScrollableContainerView::LLScrollableContainerView( const LLString& name, cons void LLScrollableContainerView::init() { LLRect border_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mBorder = new LLViewBorder( "scroll border", border_rect, LLViewBorder::BEVEL_IN ); + mBorder = new LLViewBorder( std::string("scroll border"), border_rect, LLViewBorder::BEVEL_IN ); addChild( mBorder ); mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); @@ -112,7 +112,7 @@ void LLScrollableContainerView::init() LLRect vertical_scroll_rect = mInnerRect; vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - SCROLLBAR_SIZE; - mScrollbar[VERTICAL] = new LLScrollbar( "scrollable vertical", + mScrollbar[VERTICAL] = new LLScrollbar( std::string("scrollable vertical"), vertical_scroll_rect, LLScrollbar::VERTICAL, mInnerRect.getHeight(), @@ -128,7 +128,7 @@ void LLScrollableContainerView::init() LLRect horizontal_scroll_rect = mInnerRect; horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + SCROLLBAR_SIZE; - mScrollbar[HORIZONTAL] = new LLScrollbar( "scrollable horizontal", + mScrollbar[HORIZONTAL] = new LLScrollbar( std::string("scrollable horizontal"), horizontal_scroll_rect, LLScrollbar::HORIZONTAL, mInnerRect.getWidth(), @@ -264,7 +264,7 @@ BOOL LLScrollableContainerView::handleDragAndDrop(S32 x, S32 y, MASK mask, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - LLString& tooltip_msg) + std::string& tooltip_msg) { // Scroll folder view if needed. Never accepts a drag or drop. *accept = ACCEPT_NO; @@ -336,7 +336,7 @@ BOOL LLScrollableContainerView::handleDragAndDrop(S32 x, S32 y, MASK mask, } -BOOL LLScrollableContainerView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect) +BOOL LLScrollableContainerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) { S32 local_x, local_y; for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) @@ -700,7 +700,7 @@ LLXMLNodePtr LLScrollableContainerView::getXML(bool save_children) const LLView* LLScrollableContainerView::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("scroll_container"); + std::string name("scroll_container"); node->getAttributeString("name", name); LLRect rect; @@ -738,7 +738,7 @@ LLView* LLScrollableContainerView::fromXML(LLXMLNodePtr node, LLView *parent, LL if (panelp == NULL) { - panelp = new LLPanel("dummy", LLRect::null, FALSE); + panelp = new LLPanel(std::string("dummy"), LLRect::null, FALSE); } ret->mScrolledView = panelp; diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index 64be2169ad..f3da92cc88 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -59,10 +59,10 @@ public: // scrollbars have priority for mouse and keyboard events. enum SCROLL_ORIENTATION { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT }; - LLScrollableContainerView( const LLString& name, const LLRect& rect, + LLScrollableContainerView( const std::string& name, const LLRect& rect, LLView* scrolled_view, BOOL is_opaque = FALSE, const LLColor4& bg_color = LLColor4(0,0,0,0) ); - LLScrollableContainerView( const LLString& name, const LLRect& rect, + LLScrollableContainerView( const std::string& name, const LLRect& rect, LLUICtrl* scrolled_ctrl, BOOL is_opaque = FALSE, const LLColor4& bg_color = LLColor4(0,0,0,0) ); virtual ~LLScrollableContainerView( void ); @@ -94,9 +94,9 @@ public: EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - LLString& tooltip_msg); + std::string& tooltip_msg); - virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); virtual void draw(); virtual LLXMLNodePtr getXML(bool save_children = true) const; diff --git a/indra/llui/llscrollingpanellist.cpp b/indra/llui/llscrollingpanellist.cpp index 28755ed30f..c05dacf4d8 100644 --- a/indra/llui/llscrollingpanellist.cpp +++ b/indra/llui/llscrollingpanellist.cpp @@ -141,7 +141,7 @@ void LLScrollingPanelList::draw() // static LLView* LLScrollingPanelList::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("scrolling_panel_list"); + std::string name("scrolling_panel_list"); node->getAttributeString("name", name); LLRect rect; diff --git a/indra/llui/llscrollingpanellist.h b/indra/llui/llscrollingpanellist.h index dc0dcbd460..406c832383 100644 --- a/indra/llui/llscrollingpanellist.h +++ b/indra/llui/llscrollingpanellist.h @@ -41,7 +41,7 @@ class LLScrollingPanel : public LLPanel { public: - LLScrollingPanel(const LLString& name, const LLRect& rect) : LLPanel(name, rect) { } + LLScrollingPanel(const std::string& name, const LLRect& rect) : LLPanel(name, rect) { } virtual void updatePanel(BOOL allow_modify) = 0; }; @@ -52,7 +52,7 @@ public: class LLScrollingPanelList : public LLUICtrl { public: - LLScrollingPanelList(const LLString& name, const LLRect& rect) + LLScrollingPanelList(const std::string& name, const LLRect& rect) : LLUICtrl(name, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_BOTTOM ) {} virtual void setValue(const LLSD& value) {}; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index b4a2ed874a..681c5ce5da 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -83,7 +83,7 @@ struct SortScrollListItem S32 order = sort_ascending ? 1 : -1; // ascending or descending sort for this column? if (cell1 && cell2) { - sort_result = order * LLString::compareDict(cell1->getValue().asString(), cell2->getValue().asString()); + sort_result = order * LLStringUtil::compareDict(cell1->getValue().asString(), cell2->getValue().asString()); if (sort_result != 0) { break; // we have a sort order! @@ -131,7 +131,7 @@ void LLScrollListIcon::setValue(const LLSD& value) } else { - LLString value_string = value.asString(); + std::string value_string = value.asString(); if (LLUUID::validate(value_string)) { setValue(LLUUID(value_string)); @@ -237,7 +237,7 @@ void LLScrollListSeparator::draw(const LLColor4& color, const LLColor4& highligh // U32 LLScrollListText::sCount = 0; -LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font, S32 width, U8 font_style, LLFontGL::HAlign font_alignment, LLColor4& color, BOOL use_color, BOOL visible) +LLScrollListText::LLScrollListText( const std::string& text, const LLFontGL* font, S32 width, U8 font_style, LLFontGL::HAlign font_alignment, LLColor4& color, BOOL use_color, BOOL visible) : LLScrollListCell(width), mText( text ), mFont( font ), @@ -416,9 +416,9 @@ void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell ) } } -LLString LLScrollListItem::getContentsCSV() const +std::string LLScrollListItem::getContentsCSV() const { - LLString ret; + std::string ret; S32 count = getNumColumns(); for (S32 i=0; i<count; ++i) @@ -474,7 +474,7 @@ void LLScrollListItem::setEnabled(BOOL b) //--------------------------------------------------------------------------- // LLScrollListItemComment //--------------------------------------------------------------------------- -LLScrollListItemComment::LLScrollListItemComment(const LLString& comment_string, const LLColor4& color) +LLScrollListItemComment::LLScrollListItemComment(const std::string& comment_string, const LLColor4& color) : LLScrollListItem(FALSE), mColor(color) { @@ -539,7 +539,7 @@ void LLScrollListItemSeparator::draw(const LLRect& rect, const LLColor4& fg_colo // LLScrollListCtrl //--------------------------------------------------------------------------- -LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect, +LLScrollListCtrl::LLScrollListCtrl(const std::string& name, const LLRect& rect, void (*commit_callback)(LLUICtrl* ctrl, void* userdata), void* callback_user_data, BOOL allow_multiple_selection, @@ -603,12 +603,12 @@ LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect, mItemListRect.mBottom, SCROLLBAR_SIZE, mItemListRect.getHeight()); - mScrollbar = new LLScrollbar( "Scrollbar", scroll_rect, - LLScrollbar::VERTICAL, - getItemCount(), - mScrollLines, - mPageLines, - &LLScrollListCtrl::onScrollChange, this ); + mScrollbar = new LLScrollbar( std::string("Scrollbar"), scroll_rect, + LLScrollbar::VERTICAL, + getItemCount(), + mScrollLines, + mPageLines, + &LLScrollListCtrl::onScrollChange, this ); mScrollbar->setFollowsRight(); mScrollbar->setFollowsTop(); mScrollbar->setFollowsBottom(); @@ -621,7 +621,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect, if (show_border) { LLRect border_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mBorder = new LLViewBorder( "dlg border", border_rect, LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, 1 ); + mBorder = new LLViewBorder( std::string("dlg border"), border_rect, LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, 1 ); addChild(mBorder); } @@ -756,7 +756,7 @@ std::vector<LLScrollListItem*> LLScrollListCtrl::getAllData() const // returns first matching item LLScrollListItem* LLScrollListCtrl::getItem(const LLSD& sd) const { - LLString string_val = sd.asString(); + std::string string_val = sd.asString(); item_list::const_iterator iter; for(iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -1398,7 +1398,7 @@ void LLScrollListCtrl::deselectAllItems(BOOL no_commit_on_change) /////////////////////////////////////////////////////////////////////////////////////////////////// // Use this to add comment text such as "Searching", which ignores column settings of list -LLScrollListItem* LLScrollListCtrl::addCommentText(const LLString& comment_text, EAddPosition pos) +LLScrollListItem* LLScrollListCtrl::addCommentText(const std::string& comment_text, EAddPosition pos) { LLScrollListItem* item = NULL; if (getItemCount() < mMaxItemCount) @@ -1419,7 +1419,7 @@ LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos) // Selects first enabled item of the given name. // Returns false if item not found. -BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensitive) +BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sensitive) { // ensure that no stale items are selected, even if we don't find a match deselectAllItems(TRUE); @@ -1429,10 +1429,10 @@ BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensit return FALSE; } - LLString target_text = label; + std::string target_text = label; if (!case_sensitive) { - LLString::toLower(target_text); + LLStringUtil::toLower(target_text); } BOOL found = FALSE; @@ -1443,10 +1443,10 @@ BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensit { LLScrollListItem* item = *iter; // Only select enabled items with matching names - LLString item_text = item->getColumn(0)->getValue().asString(); + std::string item_text = item->getColumn(0)->getValue().asString(); if (!case_sensitive) { - LLString::toLower(item_text); + LLStringUtil::toLower(item_text); } BOOL select = !found && item->getEnabled() && item_text == target_text; if (select) @@ -1466,7 +1466,7 @@ BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensit } -BOOL LLScrollListCtrl::selectItemByPrefix(const LLString& target, BOOL case_sensitive) +BOOL LLScrollListCtrl::selectItemByPrefix(const std::string& target, BOOL case_sensitive) { return selectItemByPrefix(utf8str_to_wstring(target), case_sensitive); } @@ -1503,7 +1503,7 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen if (!case_sensitive) { // do comparisons in lower case - LLWString::toLower(target_trimmed); + LLWStringUtil::toLower(target_trimmed); } for (item_list::iterator iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -1519,11 +1519,11 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen LLWString item_label = utf8str_to_wstring(cellp->getValue().asString()); if (!case_sensitive) { - LLWString::toLower(item_label); + LLWStringUtil::toLower(item_label); } // remove extraneous whitespace from searchable label LLWString trimmed_label = item_label; - LLWString::trim(trimmed_label); + LLWStringUtil::trim(trimmed_label); BOOL select = item->getEnabled() && trimmed_label.compare(0, target_trimmed.size(), target_trimmed) == 0; @@ -1547,7 +1547,7 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen return found; } -const LLString LLScrollListCtrl::getSelectedItemLabel(S32 column) const +const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const { LLScrollListItem* item; @@ -1557,14 +1557,14 @@ const LLString LLScrollListCtrl::getSelectedItemLabel(S32 column) const return item->getColumn(column)->getValue().asString(); } - return LLString::null; + return LLStringUtil::null; } /////////////////////////////////////////////////////////////////////////////////////////////////// // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which // has an associated, unique UUID, and only one of which can be selected at a time. -LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const LLString& item_text, const LLUUID& id, EAddPosition pos, BOOL enabled, S32 column_width) +LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos, BOOL enabled, S32 column_width) { LLScrollListItem* item = NULL; if (getItemCount() < mMaxItemCount) @@ -1792,7 +1792,7 @@ BOOL LLScrollListCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks) return handled; } -BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) +BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { S32 column_index = getColumnIndexFromOffset(x); LLScrollListColumn* columnp = getColumn(column_index); @@ -2532,7 +2532,7 @@ void LLScrollListCtrl::onScrollChange( S32 new_pos, LLScrollbar* scrollbar, void } -void LLScrollListCtrl::sortByColumn(LLString name, BOOL ascending) +void LLScrollListCtrl::sortByColumn(const std::string& name, BOOL ascending) { if (name.empty()) { @@ -2540,15 +2540,15 @@ void LLScrollListCtrl::sortByColumn(LLString name, BOOL ascending) return; } - std::map<LLString, LLScrollListColumn>::iterator itor = mColumns.find(name); + std::map<std::string, LLScrollListColumn>::iterator itor = mColumns.find(name); if (itor != mColumns.end()) { - sortByColumn((*itor).second.mIndex, ascending); + sortByColumnIndex((*itor).second.mIndex, ascending); } } // First column is column 0 -void LLScrollListCtrl::sortByColumn(U32 column, BOOL ascending) +void LLScrollListCtrl::sortByColumnIndex(U32 column, BOOL ascending) { if (setSort(column, ascending)) { @@ -2575,7 +2575,7 @@ void LLScrollListCtrl::dirtyColumns() // just in case someone indexes into it immediately mColumnsIndexed.resize(mColumns.size()); - std::map<LLString, LLScrollListColumn>::iterator column_itor; + std::map<std::string, LLScrollListColumn>::iterator column_itor; for (column_itor = mColumns.begin(); column_itor != mColumns.end(); ++column_itor) { LLScrollListColumn *column = &column_itor->second; @@ -2664,7 +2664,7 @@ LLXMLNodePtr LLScrollListCtrl::getXML(bool save_children) const // Contents - std::map<LLString, LLScrollListColumn>::const_iterator itor; + std::map<std::string, LLScrollListColumn>::const_iterator itor; std::vector<const LLScrollListColumn*> sorted_list; sorted_list.resize(mColumns.size()); for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) @@ -2756,7 +2756,7 @@ void LLScrollListCtrl::setScrollListParameters(LLXMLNodePtr node) // static LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("scroll_list"); + std::string name("scroll_list"); node->getAttributeString("name", name); LLRect rect; @@ -2806,7 +2806,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac if (sort_column >= 0) { - scroll_list->sortByColumn(sort_column, sort_ascending); + scroll_list->sortByColumnIndex(sort_column, sort_ascending); } LLSD columns; @@ -2817,19 +2817,19 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac { if (child->hasName("column")) { - LLString labelname(""); + std::string labelname(""); child->getAttributeString("label", labelname); - LLString columnname(labelname); + std::string columnname(labelname); child->getAttributeString("name", columnname); - LLString sortname(columnname); + std::string sortname(columnname); child->getAttributeString("sort", sortname); BOOL sort_ascending = TRUE; child->getAttributeBOOL("sort_ascending", sort_ascending); - LLString imagename; + std::string imagename; child->getAttributeString("image", imagename); BOOL columndynamicwidth = FALSE; @@ -2838,7 +2838,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac S32 columnwidth = -1; child->getAttributeS32("width", columnwidth); - LLString tooltip; + std::string tooltip; child->getAttributeString("tool_tip", tooltip); if(!columndynamicwidth) total_static += llmax(0, columnwidth); @@ -2883,15 +2883,15 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac { if (row_child->hasName("column")) { - LLString value = row_child->getTextContents(); + std::string value = row_child->getTextContents(); - LLString columnname(""); + std::string columnname(""); row_child->getAttributeString("name", columnname); - LLString font(""); + std::string font(""); row_child->getAttributeString("font", font); - LLString font_style(""); + std::string font_style(""); row_child->getAttributeString("font-style", font_style); row["columns"][column_idx]["column"] = columnname; @@ -2905,7 +2905,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac } } - LLString contents = node->getTextContents(); + std::string contents = node->getTextContents(); if (!contents.empty()) { typedef boost::tokenizer<boost::char_separator<char> > tokenizer; @@ -2915,7 +2915,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac while(token_iter != tokens.end()) { - const char* line = token_iter->c_str(); + const std::string& line = *token_iter; scroll_list->addSimpleElement(line); ++token_iter; } @@ -2929,7 +2929,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac // virtual void LLScrollListCtrl::copy() { - LLString buffer; + std::string buffer; std::vector<LLScrollListItem*> items = getAllSelected(); std::vector<LLScrollListItem*>::iterator itor; @@ -2999,7 +2999,7 @@ BOOL LLScrollListCtrl::canDeselect() const void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) { - LLString name = column["name"].asString(); + std::string name = column["name"].asString(); // if no column name provided, just use ordinal as name if (name.empty()) { @@ -3030,7 +3030,7 @@ void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) S32 top = mItemListRect.mTop; S32 left = mItemListRect.mLeft; { - std::map<LLString, LLScrollListColumn>::iterator itor; + std::map<std::string, LLScrollListColumn>::iterator itor; for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) { if (itor->second.mIndex < new_column->mIndex && @@ -3040,7 +3040,7 @@ void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) } } } - LLString button_name = "btn_" + name; + std::string button_name = "btn_" + name; S32 right = left+new_column->mWidth; if (new_column->mIndex != (S32)mColumns.size()-1) { @@ -3101,7 +3101,7 @@ void LLScrollListCtrl::onClickColumn(void *userdata) ascending = !parent->mSortColumns.back().second; } - parent->sortByColumn(column_index, ascending); + parent->sortByColumnIndex(column_index, ascending); if (parent->mOnSortChangedCallback) { @@ -3124,7 +3124,7 @@ BOOL LLScrollListCtrl::needsSorting() void LLScrollListCtrl::clearColumns() { - std::map<LLString, LLScrollListColumn>::iterator itor; + std::map<std::string, LLScrollListColumn>::iterator itor; for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) { LLColumnHeader *header = itor->second.mHeader; @@ -3138,9 +3138,9 @@ void LLScrollListCtrl::clearColumns() mSortColumns.clear(); } -void LLScrollListCtrl::setColumnLabel(const LLString& column, const LLString& label) +void LLScrollListCtrl::setColumnLabel(const std::string& column, const std::string& label) { - std::map<LLString, LLScrollListColumn>::iterator itor = mColumns.find(column); + std::map<std::string, LLScrollListColumn>::iterator itor = mColumns.find(column); if (itor != mColumns.end()) { itor->second.mLabel = label; @@ -3194,7 +3194,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p // skip unused columns in item passed in continue; } - LLString column = (*itor)["column"].asString(); + std::string column = (*itor)["column"].asString(); LLScrollListColumn* columnp = NULL; @@ -3206,7 +3206,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p column = new_name.str(); } - std::map<LLString, LLScrollListColumn>::iterator column_itor; + std::map<std::string, LLScrollListColumn>::iterator column_itor; column_itor = mColumns.find(column); if (column_itor != mColumns.end()) { @@ -3239,9 +3239,9 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p LLFontGL::HAlign font_alignment = columnp->mFontAlignment; LLSD value = (*itor)["value"]; - LLString fontname = (*itor)["font"].asString(); - LLString fontstyle = (*itor)["font-style"].asString(); - LLString type = (*itor)["type"].asString(); + std::string fontname = (*itor)["font"].asString(); + std::string fontstyle = (*itor)["font-style"].asString(); + std::string type = (*itor)["type"].asString(); BOOL has_color = (*itor).has("color"); LLColor4 color = ((*itor)["color"]); BOOL enabled = !(*itor).has("enabled") || (*itor)["enabled"].asBoolean() == true; @@ -3264,8 +3264,8 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p } else if (type == "checkbox") { - LLCheckBoxCtrl* ctrl = new LLCheckBoxCtrl("check", - LLRect(0, width, width, 0), " "); + LLCheckBoxCtrl* ctrl = new LLCheckBoxCtrl(std::string("check"), + LLRect(0, width, width, 0), std::string(" ")); ctrl->setEnabled(enabled); ctrl->setValue(value); LLScrollListCheck* cell = new LLScrollListCheck(ctrl,width); @@ -3308,7 +3308,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p if (new_item->getColumn(column_idx) == NULL) { LLScrollListColumn* column_ptr = &column_it->second; - new_item->setColumn(column_idx, new LLScrollListText("", LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->mWidth, LLFontGL::NORMAL)); + new_item->setColumn(column_idx, new LLScrollListText(LLStringUtil::null, LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->mWidth, LLFontGL::NORMAL)); } } @@ -3317,7 +3317,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p return new_item; } -LLScrollListItem* LLScrollListCtrl::addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) +LLScrollListItem* LLScrollListCtrl::addSimpleElement(const std::string& value, EAddPosition pos, const LLSD& id) { LLSD entry_id = id; @@ -3434,7 +3434,7 @@ void LLScrollListCtrl::onFocusLost() LLUICtrl::onFocusLost(); } -LLColumnHeader::LLColumnHeader(const LLString& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL* fontp) : +LLColumnHeader::LLColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL* fontp) : LLComboBox(label, rect, label, NULL, NULL), mColumn(column), mOrigLabel(label), @@ -3453,15 +3453,15 @@ LLColumnHeader::LLColumnHeader(const LLString& label, const LLRect &rect, LLScro mButton->setCallbackUserData(this); - mAscendingText = "[LOW]...[HIGH](Ascending)"; - mDescendingText = "[HIGH]...[LOW](Descending)"; + mAscendingText = std::string("[LOW]...[HIGH](Ascending)"); // *TODO: Translate + mDescendingText = std::string("[HIGH]...[LOW](Descending)"); // *TODO: Translate mList->reshape(llmax(mList->getRect().getWidth(), 110, getRect().getWidth()), mList->getRect().getHeight()); // resize handles on left and right const S32 RESIZE_BAR_THICKNESS = 3; mResizeBar = new LLResizeBar( - "resizebar", + std::string("resizebar"), this, LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), MIN_COLUMN_WIDTH, S32_MAX, LLResizeBar::RIGHT ); @@ -3514,7 +3514,7 @@ BOOL LLColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask) return TRUE; } -void LLColumnHeader::setImage(const LLString &image_name) +void LLColumnHeader::setImage(const std::string &image_name) { if (mButton) { @@ -3567,8 +3567,8 @@ void LLColumnHeader::showList() // move sort column over to this column and do initial sort mColumn->mParentCtrl->sortByColumn(mColumn->mSortingColumn, mColumn->mParentCtrl->getSortAscending()); - LLString low_item_text; - LLString high_item_text; + std::string low_item_text; + std::string high_item_text; LLScrollListItem* itemp = mColumn->mParentCtrl->getFirstData(); if (itemp) @@ -3604,11 +3604,11 @@ void LLColumnHeader::showList() } } - LLString::truncate(low_item_text, 3); - LLString::truncate(high_item_text, 3); + LLStringUtil::truncate(low_item_text, 3); + LLStringUtil::truncate(high_item_text, 3); - LLString ascending_string; - LLString descending_string; + std::string ascending_string; + std::string descending_string; if (low_item_text.empty() || high_item_text.empty()) { diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 04a6a181eb..05ef69c9a4 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -65,7 +65,7 @@ public: virtual S32 getWidth() const {return mWidth;} virtual S32 getContentWidth() const { return 0; } virtual S32 getHeight() const = 0; - virtual const LLSD getValue() const { return LLString::null; } + virtual const LLSD getValue() const { return LLStringUtil::null; } virtual void setValue(const LLSD& value) { } virtual BOOL getVisible() const { return TRUE; } virtual void setWidth(S32 width) { mWidth = width; } @@ -100,7 +100,7 @@ public: class LLScrollListText : public LLScrollListCell { public: - LLScrollListText( const LLString& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); + LLScrollListText( const std::string& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); /*virtual*/ ~LLScrollListText(); virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; @@ -145,7 +145,7 @@ public: virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; virtual S32 getWidth() const; virtual S32 getHeight() const { return mIcon ? mIcon->getHeight() : 0; } - virtual const LLSD getValue() const { return mIcon.isNull() ? LLString::null : mIcon->getName(); } + virtual const LLSD getValue() const { return mIcon.isNull() ? LLStringUtil::null : mIcon->getName(); } virtual void setColor(const LLColor4&); virtual BOOL isText()const { return FALSE; } virtual void setValue(const LLSD& value); @@ -201,7 +201,7 @@ public: mFontAlignment(LLFontGL::LEFT) { } - LLScrollListColumn(LLString name, LLString label, S32 width, F32 relwidth) : + LLScrollListColumn(std::string name, std::string label, S32 width, F32 relwidth) : mName(name), mSortingColumn(name), mSortAscending(TRUE), @@ -267,10 +267,10 @@ public: // Public data is fine so long as this remains a simple struct-like data class. // If it ever gets any smarter than that, these should all become private // with protected or public accessor methods added as needed. -MG - LLString mName; - LLString mSortingColumn; + std::string mName; + std::string mSortingColumn; BOOL mSortAscending; - LLString mLabel; + std::string mLabel; S32 mWidth; F32 mRelWidth; BOOL mDynamicWidth; @@ -284,7 +284,7 @@ public: class LLColumnHeader : public LLComboBox { public: - LLColumnHeader(const LLString& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL); + LLColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL); ~LLColumnHeader(); /*virtual*/ void draw(); @@ -294,12 +294,12 @@ public: /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding); /*virtual*/ void userSetShape(const LLRect& new_rect); - void setImage(const LLString &image_name); + void setImage(const std::string &image_name); LLScrollListColumn* getColumn() { return mColumn; } void setHasResizableElement(BOOL resizable); BOOL canResize(); void enableResizeBar(BOOL enable); - LLString getLabel() { return mOrigLabel; } + std::string getLabel() { return mOrigLabel; } static void onSelectSort(LLUICtrl* ctrl, void* user_data); static void onClick(void* user_data); @@ -309,7 +309,7 @@ public: private: LLScrollListColumn* mColumn; LLResizeBar* mResizeBar; - LLString mOrigLabel; + std::string mOrigLabel; LLUIString mAscendingText; LLUIString mDescendingText; BOOL mShowSortOptions; @@ -340,7 +340,7 @@ public: // If width = 0, just use the width of the text. Otherwise override with // specified width in pixels. - void addColumn( const LLString& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE) + void addColumn( const std::string& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE) { mColumns.push_back( new LLScrollListText(text, font, width, font_style, font_alignment, LLColor4::black, FALSE, visible) ); } void addColumn( LLUIImagePtr icon, S32 width = 0 ) @@ -357,7 +357,7 @@ public: LLScrollListCell *getColumn(const S32 i) const { if (0 <= i && i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; } - LLString getContentsCSV() const; + std::string getContentsCSV() const; virtual void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); @@ -377,7 +377,7 @@ private: class LLScrollListItemComment : public LLScrollListItem { public: - LLScrollListItemComment(const LLString& comment_string, const LLColor4& color); + LLScrollListItemComment(const std::string& comment_string, const LLColor4& color); /*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); private: @@ -397,7 +397,7 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, { public: LLScrollListCtrl( - const LLString& name, + const std::string& name, const LLRect& rect, void (*commit_callback)(LLUICtrl*, void*), void* callback_userdata, @@ -416,14 +416,14 @@ public: // Sets an array of column descriptors void setColumnHeadings(LLSD headings); - void sortByColumn(U32 column, BOOL ascending); + void sortByColumnIndex(U32 column, BOOL ascending); // LLCtrlListInterface functions virtual S32 getItemCount() const; // Adds a single column descriptor: ["name" : string, "label" : string, "width" : integer, "relwidth" : integer ] virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); virtual void clearColumns(); - virtual void setColumnLabel(const LLString& column, const LLString& label); + virtual void setColumnLabel(const std::string& column, const std::string& label); virtual LLScrollListColumn* getColumn(S32 index); virtual S32 getNumColumns() const { return mColumnsIndexed.size(); } @@ -435,7 +435,7 @@ public: // Simple add element. Takes a single array of: // [ "value" => value, "font" => font, "font-style" => style ] virtual void clearRows(); // clears all elements - virtual void sortByColumn(LLString name, BOOL ascending); + virtual void sortByColumn(const std::string& name, BOOL ascending); // These functions take and return an array of arrays of elements, as above virtual void setValue(const LLSD& value ); @@ -490,24 +490,24 @@ public: S32 getItemIndex( LLScrollListItem* item ) const; S32 getItemIndex( const LLUUID& item_id ) const; - LLScrollListItem* addCommentText( const LLString& comment_text, EAddPosition pos = ADD_BOTTOM); + LLScrollListItem* addCommentText( const std::string& comment_text, EAddPosition pos = ADD_BOTTOM); LLScrollListItem* addSeparator(EAddPosition pos); // "Simple" interface: use this when you're creating a list that contains only unique strings, only // one of which can be selected at a time. - virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); + virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); - BOOL selectItemByLabel( const LLString& item, BOOL case_sensitive = TRUE ); // FALSE if item not found - BOOL selectItemByPrefix(const LLString& target, BOOL case_sensitive = TRUE); + BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE ); // FALSE if item not found + BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE); BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); - const LLString getSelectedItemLabel(S32 column = 0) const; + const std::string getSelectedItemLabel(S32 column = 0) const; LLSD getSelectedValue(); // DEPRECATED: Use LLSD versions of addCommentText() and getSelectedValue(). // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which // has an associated, unique UUID, and only one of which can be selected at a time. - LLScrollListItem* addStringUUIDItem(const LLString& item_text, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE, S32 column_width = 0); + LLScrollListItem* addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE, S32 column_width = 0); LLUUID getStringUUIDSelectedItem() const; LLScrollListItem* getFirstSelected() const; @@ -565,7 +565,7 @@ public: /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); /*virtual*/ void setEnabled(BOOL enabled); /*virtual*/ void setFocus( BOOL b ); /*virtual*/ void onFocusReceived(); @@ -716,7 +716,7 @@ private: BOOL mSorted; - typedef std::map<LLString, LLScrollListColumn> column_map_t; + typedef std::map<std::string, LLScrollListColumn> column_map_t; column_map_t mColumns; BOOL mDirty; diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index d53e957c9c..28058d0005 100644 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -46,7 +46,7 @@ static LLRegisterWidget<LLSlider> r2("volume_slider"); LLSlider::LLSlider( - const LLString& name, + const std::string& name, const LLRect& rect, void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), void* callback_userdata, @@ -55,7 +55,7 @@ LLSlider::LLSlider( F32 max_value, F32 increment, BOOL volume, - const LLString& control_name) + const std::string& control_name) : LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, FOLLOWS_LEFT | FOLLOWS_TOP), @@ -303,7 +303,7 @@ LLXMLNodePtr LLSlider::getXML(bool save_children) const //static LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory) { - LLString name("slider_bar"); + std::string name("slider_bar"); node->getAttributeString("name", name); LLRect rect; diff --git a/indra/llui/llslider.h b/indra/llui/llslider.h index ba0fac1465..a0fa543e98 100644 --- a/indra/llui/llslider.h +++ b/indra/llui/llslider.h @@ -41,7 +41,7 @@ class LLSlider : public LLUICtrl { public: LLSlider( - const LLString& name, + const std::string& name, const LLRect& rect, void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), void* callback_userdata, @@ -50,7 +50,7 @@ public: F32 max_value, F32 increment, BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG - const LLString& control_name = LLString::null ); + const std::string& control_name = LLStringUtil::null ); virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index a2b0718c50..41ca6f6319 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -53,8 +53,8 @@ const U32 MAX_STRING_LENGTH = 10; static LLRegisterWidget<LLSliderCtrl> r("slider"); -LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, - const LLString& label, +LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect, + const std::string& label, const LLFontGL* font, S32 label_width, S32 text_left, @@ -64,7 +64,7 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, void (*commit_callback)(LLUICtrl*, void*), void* callback_user_data, F32 initial_value, F32 min_value, F32 max_value, F32 increment, - const LLString& control_which) + const std::string& control_which) : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data ), mFont(font), mShowText( show_text ), @@ -93,7 +93,7 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, label_width = font->getWidth(label); } LLRect label_rect( left, top, label_width, bottom ); - mLabelBox = new LLTextBox( "SliderCtrl Label", label_rect, label.c_str(), font ); + mLabelBox = new LLTextBox( std::string("SliderCtrl Label"), label_rect, label, font ); addChild(mLabelBox); } @@ -105,12 +105,11 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, S32 slider_left = label_width ? label_width + SLIDERCTRL_SPACING : 0; LLRect slider_rect( slider_left, top, slider_right, bottom ); - mSlider = new LLSlider( - "slider", - slider_rect, - LLSliderCtrl::onSliderCommit, this, - initial_value, min_value, max_value, increment, volume, - control_which ); + mSlider = new LLSlider(std::string("slider"), + slider_rect, + LLSliderCtrl::onSliderCommit, this, + initial_value, min_value, max_value, increment, volume, + control_which ); addChild( mSlider ); if( show_text ) @@ -118,11 +117,11 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); if( can_edit_text ) { - mEditor = new LLLineEditor( "SliderCtrl Editor", text_rect, - "", font, - MAX_STRING_LENGTH, - &LLSliderCtrl::onEditorCommit, NULL, NULL, this, - &LLLineEditor::prevalidateFloat ); + mEditor = new LLLineEditor( std::string("SliderCtrl Editor"), text_rect, + LLStringUtil::null, font, + MAX_STRING_LENGTH, + &LLSliderCtrl::onEditorCommit, NULL, NULL, this, + &LLLineEditor::prevalidateFloat ); mEditor->setFollowsLeft(); mEditor->setFollowsBottom(); mEditor->setFocusReceivedCallback( &LLSliderCtrl::onEditorGainFocus, this ); @@ -134,7 +133,7 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, } else { - mTextBox = new LLTextBox( "SliderCtrl Text", text_rect, "", font); + mTextBox = new LLTextBox( std::string("SliderCtrl Text"), text_rect, LLStringUtil::null, font); mTextBox->setFollowsLeft(); mTextBox->setFollowsBottom(); addChild(mTextBox); @@ -162,7 +161,7 @@ void LLSliderCtrl::setValue(F32 v, BOOL from_event) updateText(); } -BOOL LLSliderCtrl::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLSliderCtrl::setLabelArg( const std::string& key, const LLStringExplicit& text ) { BOOL res = FALSE; if (mLabelBox) @@ -192,11 +191,11 @@ void LLSliderCtrl::clear() setValue(0.0f); if( mEditor ) { - mEditor->setText( LLString::null ); + mEditor->setText( LLStringUtil::null ); } if( mTextBox ) { - mTextBox->setText( LLString::null ); + mTextBox->setText( LLStringUtil::null ); } } @@ -210,8 +209,8 @@ void LLSliderCtrl::updateText() // Don't display very small negative values as -0.000 F32 displayed_value = (F32)(floor(getValueF32() * pow(10.0, (F64)mPrecision) + 0.5) / pow(10.0, (F64)mPrecision)); - LLString format = llformat("%%.%df", mPrecision); - LLString text = llformat(format.c_str(), displayed_value); + std::string format = llformat("%%.%df", mPrecision); + std::string text = llformat(format.c_str(), displayed_value); if( mEditor ) { mEditor->setText( text ); @@ -233,7 +232,7 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) F32 val = self->mValue; F32 saved_val = self->mValue; - LLString text = self->mEditor->getText(); + std::string text = self->mEditor->getText(); if( LLLineEditor::postvalidateFloat( text ) ) { LLLocale locale(LLLocale::USER_LOCALE); @@ -450,10 +449,10 @@ LLXMLNodePtr LLSliderCtrl::getXML(bool save_children) const LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("slider"); + std::string name("slider"); node->getAttributeString("name", name); - LLString label; + std::string label; node->getAttributeString("label", label); LLRect rect; @@ -499,13 +498,13 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory { // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) if ( max_value ) - text_left = font->getWidth("0") * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); + text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); if ( increment < 1.0f ) - text_left += font->getWidth("."); // (mostly) take account of decimal point in value + text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value if ( min_value < 0.0f || max_value < 0.0f ) - text_left += font->getWidth("-"); // (mostly) take account of minus sign + text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign // padding to make things look nicer text_left += 8; diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h index 992fbafe38..4e7fe36bb4 100644 --- a/indra/llui/llsliderctrl.h +++ b/indra/llui/llsliderctrl.h @@ -48,9 +48,9 @@ const S32 SLIDERCTRL_HEIGHT = 16; class LLSliderCtrl : public LLUICtrl { public: - LLSliderCtrl(const LLString& name, + LLSliderCtrl(const std::string& name, const LLRect& rect, - const LLString& label, + const std::string& label, const LLFontGL* font, S32 slider_left, S32 text_left, @@ -60,7 +60,7 @@ public: void (*commit_callback)(LLUICtrl*, void*), void* callback_userdata, F32 initial_value, F32 min_value, F32 max_value, F32 increment, - const LLString& control_which = LLString::null ); + const std::string& control_which = LLStringUtil::null ); virtual ~LLSliderCtrl() {} // Children all cleaned up by default view destructor. @@ -72,7 +72,7 @@ public: virtual void setValue(const LLSD& value) { setValue((F32)value.asReal(), TRUE); } virtual LLSD getValue() const { return LLSD(getValueF32()); } - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); } @@ -101,13 +101,13 @@ public: virtual void setTentative(BOOL b); // marks value as tentative virtual void onCommit(); // mark not tentative, then commit - virtual void setControlName(const LLString& control_name, LLView* context) + virtual void setControlName(const std::string& control_name, LLView* context) { LLView::setControlName(control_name, context); mSlider->setControlName(control_name, context); } - virtual LLString getControlName() const { return mSlider->getControlName(); } + virtual std::string getControlName() const { return mSlider->getControlName(); } static void onSliderCommit(LLUICtrl* caller, void* userdata); static void onSliderMouseDown(LLUICtrl* caller,void* userdata); diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index c577b35e19..e7fc10912e 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -53,11 +53,11 @@ const U32 MAX_STRING_LENGTH = 32; static LLRegisterWidget<LLSpinCtrl> r2("spinner"); -LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString& label, const LLFontGL* font, +LLSpinCtrl::LLSpinCtrl( const std::string& name, const LLRect& rect, const std::string& label, const LLFontGL* font, void (*commit_callback)(LLUICtrl*, void*), void* callback_user_data, F32 initial_value, F32 min_value, F32 max_value, F32 increment, - const LLString& control_name, + const std::string& control_name, S32 label_width) : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data, FOLLOWS_LEFT | FOLLOWS_TOP ), @@ -82,7 +82,7 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString if( !label.empty() ) { LLRect label_rect( 0, centered_top, label_width, centered_bottom ); - mLabelBox = new LLTextBox( "SpinCtrl Label", label_rect, label.c_str(), font ); + mLabelBox = new LLTextBox( std::string("SpinCtrl Label"), label_rect, label, font ); addChild(mLabelBox); btn_left += label_rect.mRight + SPINCTRL_SPACING; @@ -92,14 +92,13 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString // Spin buttons LLRect up_rect( btn_left, top, btn_right, top - SPINCTRL_BTN_HEIGHT ); - LLString out_id = "UIImgBtnSpinUpOutUUID"; - LLString in_id = "UIImgBtnSpinUpInUUID"; - mUpBtn = new LLButton( - "SpinCtrl Up", up_rect, - out_id, - in_id, - "", - &LLSpinCtrl::onUpBtn, this, LLFontGL::sSansSerif ); + std::string out_id = "UIImgBtnSpinUpOutUUID"; + std::string in_id = "UIImgBtnSpinUpInUUID"; + mUpBtn = new LLButton(std::string("SpinCtrl Up"), up_rect, + out_id, + in_id, + LLStringUtil::null, + &LLSpinCtrl::onUpBtn, this, LLFontGL::sSansSerif ); mUpBtn->setFollowsLeft(); mUpBtn->setFollowsBottom(); mUpBtn->setHeldDownCallback( &LLSpinCtrl::onUpBtn ); @@ -109,12 +108,11 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString LLRect down_rect( btn_left, top - SPINCTRL_BTN_HEIGHT, btn_right, bottom ); out_id = "UIImgBtnSpinDownOutUUID"; in_id = "UIImgBtnSpinDownInUUID"; - mDownBtn = new LLButton( - "SpinCtrl Down", down_rect, - out_id, - in_id, - "", - &LLSpinCtrl::onDownBtn, this, LLFontGL::sSansSerif ); + mDownBtn = new LLButton(std::string("SpinCtrl Down"), down_rect, + out_id, + in_id, + LLStringUtil::null, + &LLSpinCtrl::onDownBtn, this, LLFontGL::sSansSerif ); mDownBtn->setFollowsLeft(); mDownBtn->setFollowsBottom(); mDownBtn->setHeldDownCallback( &LLSpinCtrl::onDownBtn ); @@ -122,10 +120,10 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString addChild(mDownBtn); LLRect editor_rect( btn_right + 1, centered_top, getRect().getWidth(), centered_bottom ); - mEditor = new LLLineEditor( "SpinCtrl Editor", editor_rect, "", font, - MAX_STRING_LENGTH, - &LLSpinCtrl::onEditorCommit, NULL, NULL, this, - &LLLineEditor::prevalidateFloat ); + mEditor = new LLLineEditor( std::string("SpinCtrl Editor"), editor_rect, LLStringUtil::null, font, + MAX_STRING_LENGTH, + &LLSpinCtrl::onEditorCommit, NULL, NULL, this, + &LLLineEditor::prevalidateFloat ); mEditor->setFollowsLeft(); mEditor->setFollowsBottom(); mEditor->setFocusReceivedCallback( &LLSpinCtrl::onEditorGainFocus, this ); @@ -282,8 +280,8 @@ void LLSpinCtrl::updateEditor() // displayed_value = 0.f; // } - LLString format = llformat("%%.%df", mPrecision); - LLString text = llformat(format.c_str(), displayed_value); + std::string format = llformat("%%.%df", mPrecision); + std::string text = llformat(format.c_str(), displayed_value); mEditor->setText( text ); } @@ -294,7 +292,7 @@ void LLSpinCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) LLSpinCtrl* self = (LLSpinCtrl*) userdata; llassert( caller == self->mEditor ); - LLString text = self->mEditor->getText(); + std::string text = self->mEditor->getText(); if( LLLineEditor::postvalidateFloat( text ) ) { LLLocale locale(LLLocale::USER_LOCALE); @@ -493,10 +491,10 @@ LLXMLNodePtr LLSpinCtrl::getXML(bool save_children) const LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("spinner"); + std::string name("spinner"); node->getAttributeString("name", name); - LLString label; + std::string label; node->getAttributeString("label", label); LLRect rect; @@ -539,7 +537,7 @@ LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * min_value, max_value, increment, - "", + LLStringUtil::null, label_width); spinner->setPrecision(precision); diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h index eb9c60d442..1ed9462f00 100644 --- a/indra/llui/llspinctrl.h +++ b/indra/llui/llspinctrl.h @@ -52,13 +52,13 @@ class LLSpinCtrl : public LLUICtrl { public: - LLSpinCtrl(const LLString& name, const LLRect& rect, - const LLString& label, + LLSpinCtrl(const std::string& name, const LLRect& rect, + const std::string& label, const LLFontGL* font, void (*commit_callback)(LLUICtrl*, void*), void* callback_userdata, F32 initial_value, F32 min_value, F32 max_value, F32 increment, - const LLString& control_name = LLString(), + const std::string& control_name = std::string(), S32 label_width = SPINCTRL_DEFAULT_LABEL_WIDTH ); virtual ~LLSpinCtrl() {} // Children all cleaned up by default view destructor. diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index 38608745c1..0bdc208a9e 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -39,7 +39,7 @@ LLStyle::LLStyle() { - init(TRUE, LLColor4(0,0,0,1),""); + init(TRUE, LLColor4(0,0,0,1),LLStringUtil::null); } LLStyle::LLStyle(const LLStyle &style) @@ -62,21 +62,21 @@ LLStyle::LLStyle(const LLStyle &style) } else { - init(TRUE, LLColor4(0,0,0,1),""); + init(TRUE, LLColor4(0,0,0,1),LLStringUtil::null); } } -LLStyle::LLStyle(BOOL is_visible, const LLColor4 &color, const LLString& font_name) +LLStyle::LLStyle(BOOL is_visible, const LLColor4 &color, const std::string& font_name) { init(is_visible, color, font_name); } -void LLStyle::init(BOOL is_visible, const LLColor4 &color, const LLString& font_name) +void LLStyle::init(BOOL is_visible, const LLColor4 &color, const std::string& font_name) { mVisible = is_visible; mColor = color; setFontName(font_name); - setLinkHREF(""); + setLinkHREF(LLStringUtil::null); mItalic = FALSE; mBold = FALSE; mUnderline = FALSE; @@ -110,12 +110,12 @@ LLStyle &LLStyle::operator=(const LLStyle &rhs) } -void LLStyle::setFontName(const LLString& fontname) +void LLStyle::setFontName(const std::string& fontname) { mFontName = fontname; - LLString fontname_lc = fontname; - LLString::toLower(fontname_lc); + std::string fontname_lc = fontname; + LLStringUtil::toLower(fontname_lc); mFontID = LLFONT_OCRA; // default @@ -138,7 +138,7 @@ void LLStyle::setFontName(const LLString& fontname) } -void LLStyle::setLinkHREF(const LLString& href) +void LLStyle::setLinkHREF(const std::string& href) { mLink = href; } diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index 6896ee288f..ecb2d3c541 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -42,11 +42,11 @@ class LLStyle : public LLRefCount public: LLStyle(); LLStyle(const LLStyle &style); - LLStyle(BOOL is_visible, const LLColor4 &color, const LLString& font_name); + LLStyle(BOOL is_visible, const LLColor4 &color, const std::string& font_name); LLStyle &operator=(const LLStyle &rhs); - virtual void init (BOOL is_visible, const LLColor4 &color, const LLString& font_name); + virtual void init (BOOL is_visible, const LLColor4 &color, const std::string& font_name); virtual const LLColor4& getColor() const { return mColor; } virtual void setColor(const LLColor4 &color) { mColor = color; } @@ -54,12 +54,12 @@ public: virtual BOOL isVisible() const; virtual void setVisible(BOOL is_visible); - virtual const LLString& getFontString() const { return mFontName; } - virtual void setFontName(const LLString& fontname); + virtual const std::string& getFontString() const { return mFontName; } + virtual void setFontName(const std::string& fontname); virtual LLFONT_ID getFontID() const { return mFontID; } - virtual const LLString& getLinkHREF() const { return mLink; } - virtual void setLinkHREF(const LLString& href); + virtual const std::string& getLinkHREF() const { return mLink; } + virtual void setLinkHREF(const std::string& href); virtual BOOL isLink() const; virtual LLUIImagePtr getImage() const; @@ -105,9 +105,9 @@ protected: private: BOOL mVisible; LLColor4 mColor; - LLString mFontName; + std::string mFontName; LLFONT_ID mFontID; - LLString mLink; + std::string mLink; LLUIImagePtr mImagep; BOOL mIsEmbeddedItem; }; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index ccf6e90161..488e62c61e 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -65,7 +65,7 @@ const S32 TABCNTRV_PAD = 0; static LLRegisterWidget<LLTabContainer> r("tab_container"); -LLTabContainer::LLTabContainer(const LLString& name, const LLRect& rect, TabPosition pos, +LLTabContainer::LLTabContainer(const std::string& name, const LLRect& rect, TabPosition pos, BOOL bordered, BOOL is_vertical ) : LLPanel(name, rect, bordered), @@ -121,7 +121,7 @@ void LLTabContainer::reshape(S32 width, S32 height, BOOL called_from_parent) } //virtual -LLView* LLTabContainer::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const +LLView* LLTabContainer::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const { tuple_list_t::const_iterator itor; for (itor = mTabList.begin(); itor != mTabList.end(); ++itor) @@ -460,7 +460,7 @@ BOOL LLTabContainer::handleMouseUp( S32 x, S32 y, MASK mask ) } // virtual -BOOL LLTabContainer::handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_rect ) +BOOL LLTabContainer::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect ) { BOOL handled = LLPanel::handleToolTip( x, y, msg, sticky_rect ); if (!handled && getTabCount() > 0) @@ -604,7 +604,7 @@ LLXMLNodePtr LLTabContainer::getXML(bool save_children) const } // virtual -BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, LLString &tooltip) +BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, std::string &tooltip) { BOOL has_scroll_arrows = (getMaxScrollPos() > 0); @@ -656,7 +656,7 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDrag } void LLTabContainer::addTabPanel(LLPanel* child, - const LLString& label, + const std::string& label, BOOL select, void (*on_tab_clicked)(void*, bool), void* userdata, @@ -673,8 +673,8 @@ void LLTabContainer::addTabPanel(LLPanel* child, // Store the original label for possible xml export. child->setLabel(label); - LLString trimmed_label = label; - LLString::trim(trimmed_label); + std::string trimmed_label = label; + LLStringUtil::trim(trimmed_label); S32 button_width = mMinTabWidth; if (!mIsVertical) @@ -723,8 +723,8 @@ void LLTabContainer::addTabPanel(LLPanel* child, // Tab button LLRect btn_rect; // Note: btn_rect.mLeft is just a dummy. Will be updated in draw(). - LLString tab_img; - LLString tab_selected_img; + std::string tab_img; + std::string tab_selected_img; S32 tab_fudge = 1; // To make new tab art look better, nudge buttons up 1 pel if (mIsVertical) @@ -755,21 +755,21 @@ void LLTabContainer::addTabPanel(LLPanel* child, btn_rect.translate(0, -LLBUTTON_V_PAD-2); textbox = new LLTextBox(trimmed_label, btn_rect, trimmed_label, font); - btn = new LLButton("", LLRect(0,0,0,0)); + btn = new LLButton(LLStringUtil::null, LLRect(0,0,0,0)); } else { if (mIsVertical) { - btn = new LLButton("vert tab button", + btn = new LLButton(std::string("vert tab button"), btn_rect, - "", - "", - "", + LLStringUtil::null, + LLStringUtil::null, + LLStringUtil::null, &LLTabContainer::onTabBtn, NULL, font, trimmed_label, trimmed_label); - btn->setImages("tab_left.tga", "tab_left_selected.tga"); + btn->setImages(std::string("tab_left.tga"), std::string("tab_left_selected.tga")); btn->setScaleImage(TRUE); btn->setHAlign(LLFontGL::LEFT); btn->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); @@ -781,13 +781,13 @@ void LLTabContainer::addTabPanel(LLPanel* child, } else { - LLString tooltip = trimmed_label; + std::string tooltip = trimmed_label; tooltip += "\nAlt-Left arrow for previous tab"; tooltip += "\nAlt-Right arrow for next tab"; - btn = new LLButton(LLString(child->getName()) + " tab", + btn = new LLButton(std::string(child->getName()) + " tab", btn_rect, - "", "", "", + LLStringUtil::null, LLStringUtil::null, LLStringUtil::null, &LLTabContainer::onTabBtn, NULL, // set userdata below font, trimmed_label, trimmed_label ); @@ -844,7 +844,7 @@ void LLTabContainer::addTabPanel(LLPanel* child, updateMaxScrollPos(); } -void LLTabContainer::addPlaceholder(LLPanel* child, const LLString& label) +void LLTabContainer::addPlaceholder(LLPanel* child, const std::string& label) { addTabPanel(child, label, FALSE, NULL, NULL, 0, TRUE); } @@ -1011,7 +1011,7 @@ S32 LLTabContainer::getIndexForPanel(LLPanel* panel) return -1; } -S32 LLTabContainer::getPanelIndexByTitle(const LLString& title) +S32 LLTabContainer::getPanelIndexByTitle(const std::string& title) { for (S32 index = 0 ; index < (S32)mTabList.size(); index++) { @@ -1023,7 +1023,7 @@ S32 LLTabContainer::getPanelIndexByTitle(const LLString& title) return -1; } -LLPanel *LLTabContainer::getPanelByName(const LLString& name) +LLPanel *LLTabContainer::getPanelByName(const std::string& name) { for (S32 index = 0 ; index < (S32)mTabList.size(); index++) { @@ -1037,7 +1037,7 @@ LLPanel *LLTabContainer::getPanelByName(const LLString& name) } // Change the name of the button for the current tab. -void LLTabContainer::setCurrentTabName(const LLString& name) +void LLTabContainer::setCurrentTabName(const std::string& name) { // Might not have a tab selected if (mCurrentTabIdx < 0) return; @@ -1211,7 +1211,7 @@ BOOL LLTabContainer::selectTab(S32 which) return is_visible; } -BOOL LLTabContainer::selectTabByName(const LLString& name) +BOOL LLTabContainer::selectTabByName(const std::string& name) { LLPanel* panel = getPanelByName(name); if (!panel) @@ -1275,7 +1275,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L } } -void LLTabContainer::setTitle(const LLString& title) +void LLTabContainer::setTitle(const std::string& title) { if (mTitleBox) { @@ -1283,14 +1283,14 @@ void LLTabContainer::setTitle(const LLString& title) } } -const LLString LLTabContainer::getPanelTitle(S32 index) +const std::string LLTabContainer::getPanelTitle(S32 index) { if (index >= 0 && index < (S32)mTabList.size()) { LLButton* tab_button = mTabList[index]->mButton; return tab_button->getLabelSelected(); } - return LLString::null; + return LLStringUtil::null; } void LLTabContainer::setTopBorderHeight(S32 height) @@ -1328,7 +1328,7 @@ void LLTabContainer::setRightTabBtnOffset(S32 offset) updateMaxScrollPos(); } -void LLTabContainer::setPanelTitle(S32 index, const LLString& title) +void LLTabContainer::setPanelTitle(S32 index, const std::string& title) { if (index >= 0 && index < getTabCount()) { @@ -1434,7 +1434,7 @@ void LLTabContainer::onPrevBtnHeld( void* userdata ) // static LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("tab_container"); + std::string name("tab_container"); node->getAttributeString("name", name); // Figure out if we are creating a vertical or horizontal tab container. @@ -1442,9 +1442,9 @@ LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto LLTabContainer::TabPosition tab_position = LLTabContainer::TOP; if (node->hasAttribute("tab_position")) { - LLString tab_position_string; + std::string tab_position_string; node->getAttributeString("tab_position", tab_position_string); - LLString::toLower(tab_position_string); + LLStringUtil::toLower(tab_position_string); if ("top" == tab_position_string) { @@ -1506,7 +1506,7 @@ LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto if (control && control->isPanel()) { LLPanel* panelp = (LLPanel*)control; - LLString label; + std::string label; child->getAttributeString("label", label); if (label.empty()) { @@ -1514,7 +1514,7 @@ LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto } BOOL placeholder = FALSE; child->getAttributeBOOL("placeholder", placeholder); - tab_container->addTabPanel(panelp, label.c_str(), false, + tab_container->addTabPanel(panelp, label, false, NULL, NULL, 0, placeholder); } } @@ -1538,8 +1538,8 @@ void LLTabContainer::initButtons() return; // Don't have a rect yet or already got called } - LLString out_id; - LLString in_id; + std::string out_id; + std::string in_id; if (mIsVertical) { @@ -1555,16 +1555,16 @@ void LLTabContainer::initButtons() out_id = "UIImgBtnScrollUpOutUUID"; in_id = "UIImgBtnScrollUpInUUID"; - mPrevArrowBtn = new LLButton("Up Arrow", up_arrow_btn_rect, - out_id, in_id, "", + mPrevArrowBtn = new LLButton(std::string("Up Arrow"), up_arrow_btn_rect, + out_id, in_id, LLStringUtil::null, &onPrevBtn, this, NULL ); mPrevArrowBtn->setFollowsTop(); mPrevArrowBtn->setFollowsLeft(); out_id = "UIImgBtnScrollDownOutUUID"; in_id = "UIImgBtnScrollDownInUUID"; - mNextArrowBtn = new LLButton("Down Arrow", down_arrow_btn_rect, - out_id, in_id, "", + mNextArrowBtn = new LLButton(std::string("Down Arrow"), down_arrow_btn_rect, + out_id, in_id, LLStringUtil::null, &onNextBtn, this, NULL ); mNextArrowBtn->setFollowsBottom(); mNextArrowBtn->setFollowsLeft(); @@ -1603,31 +1603,31 @@ void LLTabContainer::initButtons() out_id = "UIImgBtnJumpLeftOutUUID"; in_id = "UIImgBtnJumpLeftInUUID"; - mJumpPrevArrowBtn = new LLButton("Jump Left Arrow", jump_left_arrow_btn_rect, - out_id, in_id, "", + mJumpPrevArrowBtn = new LLButton(std::string("Jump Left Arrow"), jump_left_arrow_btn_rect, + out_id, in_id, LLStringUtil::null, &LLTabContainer::onJumpFirstBtn, this, LLFontGL::sSansSerif ); mJumpPrevArrowBtn->setFollowsLeft(); out_id = "UIImgBtnScrollLeftOutUUID"; in_id = "UIImgBtnScrollLeftInUUID"; - mPrevArrowBtn = new LLButton("Left Arrow", left_arrow_btn_rect, - out_id, in_id, "", + mPrevArrowBtn = new LLButton(std::string("Left Arrow"), left_arrow_btn_rect, + out_id, in_id, LLStringUtil::null, &LLTabContainer::onPrevBtn, this, LLFontGL::sSansSerif ); mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld); mPrevArrowBtn->setFollowsLeft(); out_id = "UIImgBtnJumpRightOutUUID"; in_id = "UIImgBtnJumpRightInUUID"; - mJumpNextArrowBtn = new LLButton("Jump Right Arrow", jump_right_arrow_btn_rect, - out_id, in_id, "", + mJumpNextArrowBtn = new LLButton(std::string("Jump Right Arrow"), jump_right_arrow_btn_rect, + out_id, in_id, LLStringUtil::null, &LLTabContainer::onJumpLastBtn, this, LLFontGL::sSansSerif); mJumpNextArrowBtn->setFollowsRight(); out_id = "UIImgBtnScrollRightOutUUID"; in_id = "UIImgBtnScrollRightInUUID"; - mNextArrowBtn = new LLButton("Right Arrow", right_arrow_btn_rect, - out_id, in_id, "", + mNextArrowBtn = new LLButton(std::string("Right Arrow"), right_arrow_btn_rect, + out_id, in_id, LLStringUtil::null, &LLTabContainer::onNextBtn, this, LLFontGL::sSansSerif); mNextArrowBtn->setFollowsRight(); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index f4da5e5aed..eef5a70a3b 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -55,7 +55,7 @@ public: RIGHT_OF_CURRENT } eInsertionPoint; - LLTabContainer( const LLString& name, const LLRect& rect, TabPosition pos, + LLTabContainer( const std::string& name, const LLRect& rect, TabPosition pos, BOOL bordered, BOOL is_vertical); /*virtual*/ ~LLTabContainer(); @@ -68,23 +68,23 @@ public: /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect ); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect ); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, - EAcceptance* accept, LLString& tooltip); + EAcceptance* accept, std::string& tooltip); /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; - /*virtual*/ LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; + /*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; void addTabPanel(LLPanel* child, - const LLString& label, + const std::string& label, BOOL select = FALSE, void (*on_tab_clicked)(void*, bool) = NULL, void* userdata = NULL, S32 indent = 0, BOOL placeholder = FALSE, eInsertionPoint insertion_point = END); - void addPlaceholder(LLPanel* child, const LLString& label); + void addPlaceholder(LLPanel* child, const std::string& label); void removeTabPanel( LLPanel* child ); void lockTabs(S32 num_tabs = 0); void unlockTabs(); @@ -96,9 +96,9 @@ public: S32 getTabCount(); LLPanel* getPanelByIndex(S32 index); S32 getIndexForPanel(LLPanel* panel); - S32 getPanelIndexByTitle(const LLString& title); - LLPanel* getPanelByName(const LLString& name); - void setCurrentTabName(const LLString& name); + S32 getPanelIndexByTitle(const std::string& title); + LLPanel* getPanelByName(const std::string& name); + void setCurrentTabName(const std::string& name); void selectFirstTab(); void selectLastTab(); @@ -106,13 +106,13 @@ public: void selectPrevTab(); BOOL selectTabPanel( LLPanel* child ); BOOL selectTab(S32 which); - BOOL selectTabByName(const LLString& title); + BOOL selectTabByName(const std::string& title); BOOL getTabPanelFlashing(LLPanel* child); void setTabPanelFlashing(LLPanel* child, BOOL state); void setTabImage(LLPanel* child, std::string img_name, const LLColor4& color = LLColor4::white); - void setTitle( const LLString& title ); - const LLString getPanelTitle(S32 index); + void setTitle( const std::string& title ); + const std::string getPanelTitle(S32 index); void setTopBorderHeight(S32 height); S32 getTopBorderHeight() const; @@ -121,7 +121,7 @@ public: void setTabUserData(LLPanel* tab, void* userdata); void setRightTabBtnOffset( S32 offset ); - void setPanelTitle(S32 index, const LLString& title); + void setPanelTitle(S32 index, const std::string& title); TabPosition getTabPosition() const { return mTabPosition; } void setMinTabWidth(S32 width) { mMinTabWidth = width; } diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 1c3c8329e6..ac2f2a64a3 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -36,7 +36,7 @@ static LLRegisterWidget<LLTextBox> r("text"); -LLTextBox::LLTextBox(const LLString& name, const LLRect& rect, const LLString& text, +LLTextBox::LLTextBox(const std::string& name, const LLRect& rect, const std::string& text, const LLFontGL* font, BOOL mouse_opaque) : LLUICtrl(name, rect, mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP ), mFontGL(font ? font : LLFontGL::sSansSerifSmall), @@ -63,7 +63,7 @@ LLTextBox::LLTextBox(const LLString& name, const LLRect& rect, const LLString& t setTabStop(FALSE); } -LLTextBox::LLTextBox(const LLString& name, const LLString& text, F32 max_width, +LLTextBox::LLTextBox(const std::string& name, const std::string& text, F32 max_width, const LLFontGL* font, BOOL mouse_opaque) : LLUICtrl(name, LLRect(0, 0, 1, 1), mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), mFontGL(font ? font : LLFontGL::sSansSerifSmall), @@ -91,7 +91,7 @@ LLTextBox::LLTextBox(const LLString& name, const LLString& text, F32 max_width, setTabStop(FALSE); } -LLTextBox::LLTextBox(const LLString& name_and_label, const LLRect& rect) : +LLTextBox::LLTextBox(const std::string& name_and_label, const LLRect& rect) : LLUICtrl(name_and_label, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), mFontGL(LLFontGL::sSansSerifSmall), mTextColor(LLUI::sColorsGroup->getColor("LabelTextColor")), @@ -113,7 +113,7 @@ LLTextBox::LLTextBox(const LLString& name_and_label, const LLRect& rect) : setTabStop(FALSE); } -LLTextBox::LLTextBox(const LLString& name_and_label) : +LLTextBox::LLTextBox(const std::string& name_and_label) : LLUICtrl(name_and_label, LLRect(0, 0, 1, 1), TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), mFontGL(LLFontGL::sSansSerifSmall), mTextColor(LLUI::sColorsGroup->getColor("LabelTextColor")), @@ -211,15 +211,15 @@ void LLTextBox::setLineLengths() { mLineLengthList.clear(); - LLString::size_type cur = 0; - LLString::size_type len = mText.getWString().size(); + std::string::size_type cur = 0; + std::string::size_type len = mText.getWString().size(); while (cur < len) { - LLString::size_type end = mText.getWString().find('\n', cur); - LLString::size_type runLen; + std::string::size_type end = mText.getWString().find('\n', cur); + std::string::size_type runLen; - if (end == LLString::npos) + if (end == std::string::npos) { runLen = len - cur; cur = len; @@ -276,7 +276,7 @@ void LLTextBox::setWrappedText(const LLStringExplicit& in_text, F32 max_width) } } - LLString final_text = wstring_to_utf8str(final_wtext); + std::string final_text = wstring_to_utf8str(final_wtext); setText(final_text); } @@ -316,7 +316,7 @@ S32 LLTextBox::getTextPixelHeight() } -BOOL LLTextBox::setTextArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text ) { mText.setArg(key, text); setLineLengths(); @@ -451,11 +451,11 @@ LLXMLNodePtr LLTextBox::getXML(bool save_children) const // static LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("text_box"); + std::string name("text_box"); node->getAttributeString("name", name); LLFontGL* font = LLView::selectFont(node); - LLString text = node->getTextContents(); + std::string text = node->getTextContents(); LLTextBox* text_box = new LLTextBox(name, LLRect(), @@ -469,7 +469,7 @@ LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f text_box->initFromXML(node, parent); - LLString font_style; + std::string font_style; if (node->getAttributeString("font-style", font_style)) { text_box->mFontStyle = LLFontGL::getStyleFromString(font_style); diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 91d47795a5..b1e8e0b7c6 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -45,16 +45,16 @@ public: // By default, follows top and left and is mouse-opaque. // If no text, text = name. // If no font, uses default system font. - LLTextBox(const LLString& name, const LLRect& rect, const LLString& text, + LLTextBox(const std::string& name, const LLRect& rect, const std::string& text, const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); // Construct a textbox which handles word wrapping for us. - LLTextBox(const LLString& name, const LLString& text, F32 max_width = 200, + LLTextBox(const std::string& name, const std::string& text, F32 max_width = 200, const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); // "Simple" constructors for text boxes that have the same name and label *TO BE DEPRECATED* - LLTextBox(const LLString& name_and_label, const LLRect& rect); - LLTextBox(const LLString& name_and_label); + LLTextBox(const std::string& name_and_label, const LLRect& rect); + LLTextBox(const std::string& name_and_label); virtual ~LLTextBox() {} @@ -95,13 +95,13 @@ public: void reshapeToFitText(); - const LLString& getText() const { return mText.getString(); } + const std::string& getText() const { return mText.getString(); } S32 getTextPixelWidth(); S32 getTextPixelHeight(); virtual void setValue(const LLSD& value ) { setText(value.asString()); } virtual LLSD getValue() const { return LLSD(getText()); } - virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); private: void setLineLengths(); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 06df996088..a2063358bd 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -86,7 +86,7 @@ const S32 PREEDIT_STANDOUT_POSITION = 2; const S32 PREEDIT_STANDOUT_THICKNESS = 2; LLColor4 LLTextEditor::mLinkColor = LLColor4::blue; -void (* LLTextEditor::mURLcallback)(const char*) = NULL; +void (* LLTextEditor::mURLcallback)(const std::string&) = NULL; bool (* LLTextEditor::mSecondlifeURLcallback)(const std::string&) = NULL; bool (* LLTextEditor::mSecondlifeURLcallbackRightClick)(const std::string&) = NULL; @@ -104,7 +104,7 @@ public: virtual BOOL execute( LLTextEditor* editor, S32* delta ) { *delta = insert(editor, getPosition(), mWString ); - LLWString::truncate(mWString, *delta); + LLWStringUtil::truncate(mWString, *delta); //mWString = wstring_truncate(mWString, *delta); return (*delta != 0); } @@ -142,7 +142,7 @@ public: virtual BOOL execute( LLTextEditor* editor, S32* delta ) { *delta = insert(editor, getPosition(), mWString); - LLWString::truncate(mWString, *delta); + LLWStringUtil::truncate(mWString, *delta); //mWString = wstring_truncate(mWString, *delta); return (*delta != 0); } @@ -240,10 +240,10 @@ private: /////////////////////////////////////////////////////////////////// LLTextEditor::LLTextEditor( - const LLString& name, + const std::string& name, const LLRect& rect, S32 max_length, // In bytes - const LLString &default_text, + const std::string &default_text, const LLFontGL* font, BOOL allow_embedded_items) : @@ -308,7 +308,7 @@ LLTextEditor::LLTextEditor( SCROLLBAR_SIZE, getRect().getHeight() - 1); S32 lines_in_doc = getLineCount(); - mScrollbar = new LLScrollbar( "Scrollbar", scroll_rect, + mScrollbar = new LLScrollbar( std::string("Scrollbar"), scroll_rect, LLScrollbar::VERTICAL, lines_in_doc, 0, @@ -322,7 +322,7 @@ LLTextEditor::LLTextEditor( mScrollbar->setOnScrollEndCallback(mOnScrollEndCallback, mOnScrollEndData); addChild(mScrollbar); - mBorder = new LLViewBorder( "text ed border", LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, UI_TEXTEDITOR_BORDER ); + mBorder = new LLViewBorder( std::string("text ed border"), LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, UI_TEXTEDITOR_BORDER ); addChild( mBorder ); appendText(default_text, FALSE, FALSE); @@ -330,7 +330,7 @@ LLTextEditor::LLTextEditor( resetDirty(); // Update saved text state mParseHTML=FALSE; - mHTML=""; + mHTML.clear(); } @@ -493,7 +493,7 @@ BOOL LLTextEditor::truncate() void LLTextEditor::setText(const LLStringExplicit &utf8str) { - // LLString::removeCRLF(utf8str); + // LLStringUtil::removeCRLF(utf8str); mUTF8Text = utf8str_removeCRLF(utf8str); // mUTF8Text = utf8str; mWText = utf8str_to_wstring(mUTF8Text); @@ -535,7 +535,7 @@ void LLTextEditor::setValue(const LLSD& value) setText(value.asString()); } -const LLString& LLTextEditor::getText() const +const std::string& LLTextEditor::getText() const { if (!mTextIsUpToDate) { @@ -588,7 +588,7 @@ void LLTextEditor::setHideScrollbarForShortDocs(BOOL b) } } -void LLTextEditor::selectNext(const LLString& search_text_in, BOOL case_insensitive, BOOL wrap) +void LLTextEditor::selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap) { if (search_text_in.empty()) { @@ -599,8 +599,8 @@ void LLTextEditor::selectNext(const LLString& search_text_in, BOOL case_insensit LLWString search_text = utf8str_to_wstring(search_text_in); if (case_insensitive) { - LLWString::toLower(text); - LLWString::toLower(search_text); + LLWStringUtil::toLower(text); + LLWStringUtil::toLower(search_text); } if (mIsSelecting) @@ -638,7 +638,7 @@ void LLTextEditor::selectNext(const LLString& search_text_in, BOOL case_insensit mSelectionStart = llmin((S32)getLength(), (S32)(mCursorPos + search_text.size())); } -BOOL LLTextEditor::replaceText(const LLString& search_text_in, const LLString& replace_text, +BOOL LLTextEditor::replaceText(const std::string& search_text_in, const std::string& replace_text, BOOL case_insensitive, BOOL wrap) { BOOL replaced = FALSE; @@ -656,8 +656,8 @@ BOOL LLTextEditor::replaceText(const LLString& search_text_in, const LLString& r if (case_insensitive) { - LLWString::toLower(selected_text); - LLWString::toLower(search_text); + LLWStringUtil::toLower(selected_text); + LLWStringUtil::toLower(search_text); } if (selected_text == search_text) @@ -671,7 +671,7 @@ BOOL LLTextEditor::replaceText(const LLString& search_text_in, const LLString& r return replaced; } -void LLTextEditor::replaceTextAll(const LLString& search_text, const LLString& replace_text, BOOL case_insensitive) +void LLTextEditor::replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive) { S32 cur_pos = mScrollbar->getDocPos(); @@ -1058,7 +1058,7 @@ void LLTextEditor::selectAll() } -BOOL LLTextEditor::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) +BOOL LLTextEditor::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) @@ -1389,7 +1389,7 @@ BOOL LLTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) BOOL LLTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, - LLString& tooltip_msg) + std::string& tooltip_msg) { *accept = ACCEPT_NO; @@ -1876,7 +1876,7 @@ void LLTextEditor::paste() // Clean up string (replace tabs and remove characters that our fonts don't support). LLWString clean_string(paste); - LLWString::replaceTabsWithSpaces(clean_string, SPACES_PER_TAB); + LLWStringUtil::replaceTabsWithSpaces(clean_string, SPACES_PER_TAB); if( mAllowEmbeddedItems ) { const llwchar LF = 10; @@ -2567,7 +2567,7 @@ void LLTextEditor::drawSelectionBackground() { // extend selection slightly beyond end of line // to indicate selection of newline character (use "n" character to determine width) - const LLWString nstr(utf8str_to_wstring(LLString("n"))); + const LLWString nstr(utf8str_to_wstring(std::string("n"))); line_endings.push(mTextRect.mLeft + mGLFont->getWidth(line, 0, line_end - line_start, mAllowEmbeddedItems) + mGLFont->getWidth(nstr.c_str())); } @@ -2704,7 +2704,7 @@ void LLTextEditor::drawCursor() if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) { cursor_left += CURSOR_THICKNESS; - const LLWString space(utf8str_to_wstring(LLString(" "))); + const LLWString space(utf8str_to_wstring(std::string(" "))); F32 spacew = mGLFont->getWidthF32(space.c_str()); if (mCursorPos == line_end) { @@ -3080,7 +3080,7 @@ void LLTextEditor::onTabInto() // virtual void LLTextEditor::clear() { - setText(LLString::null); + setText(LLStringUtil::null); } // Start or stop the editor from accepting text-editing keystrokes @@ -3408,7 +3408,7 @@ void LLTextEditor::autoIndent() } // Inserts new text at the cursor position -void LLTextEditor::insertText(const LLString &new_text) +void LLTextEditor::insertText(const std::string &new_text) { BOOL enabled = getEnabled(); setEnabled( TRUE ); @@ -3428,11 +3428,11 @@ void LLTextEditor::insertText(const LLString &new_text) } -void LLTextEditor::appendColoredText(const LLString &new_text, +void LLTextEditor::appendColoredText(const std::string &new_text, bool allow_undo, bool prepend_newline, const LLColor4 &color, - const LLString& font_name) + const std::string& font_name) { LLStyleSP style(new LLStyle); style->setVisible(true); @@ -3441,7 +3441,7 @@ void LLTextEditor::appendColoredText(const LLString &new_text, appendStyledText(new_text, allow_undo, prepend_newline, &style); } -void LLTextEditor::appendStyledText(const LLString &new_text, +void LLTextEditor::appendStyledText(const std::string &new_text, bool allow_undo, bool prepend_newline, const LLStyleSP *stylep) @@ -3450,7 +3450,7 @@ void LLTextEditor::appendStyledText(const LLString &new_text, { S32 start=0,end=0; - LLString text = new_text; + std::string text = new_text; while ( findHTML(text, &start, &end) ) { LLStyleSP html(new LLStyle); @@ -3484,7 +3484,7 @@ void LLTextEditor::appendStyledText(const LLString &new_text, } // Appends new text to end of document -void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool prepend_newline, +void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool prepend_newline, const LLStyleSP *stylep) { // Save old state @@ -3504,7 +3504,7 @@ void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool pr if (getLength() != 0 && prepend_newline) { - LLString final_text = "\n"; + std::string final_text = "\n"; final_text += new_text; append(utf8str_to_wstring(final_text), TRUE); } @@ -3685,20 +3685,18 @@ void LLTextEditor::updateTextRect() getRect().getHeight() - 2 * UI_TEXTEDITOR_BORDER - UI_TEXTEDITOR_V_PAD_TOP ); } -void LLTextEditor::loadKeywords(const LLString& filename, - const LLDynamicArray<const char*>& funcs, - const LLDynamicArray<const char*>& tooltips, +void LLTextEditor::loadKeywords(const std::string& filename, + const std::vector<std::string>& funcs, + const std::vector<std::string>& tooltips, const LLColor3& color) { if(mKeywords.loadFromFile(filename)) { - S32 count = funcs.count(); - LLString name; + S32 count = llmin(funcs.size(), tooltips.size()); for(S32 i = 0; i < count; i++) { - name = funcs.get(i); - name = utf8str_trim(name); - mKeywords.addToken(LLKeywordToken::WORD, name.c_str(), color, tooltips.get(i) ); + std::string name = utf8str_trim(funcs[i]); + mKeywords.addToken(LLKeywordToken::WORD, name, color, tooltips[i] ); } mKeywords.findSegments( &mSegments, mWText, mDefaultColor ); @@ -3840,9 +3838,9 @@ BOOL LLTextEditor::handleMouseUpOverSegment(S32 x, S32 y, MASK mask) //Special handling for slurls if ( (mSecondlifeURLcallback!=NULL) && !(*mSecondlifeURLcallback)(mHTML) ) { - if (mURLcallback!=NULL) (*mURLcallback)(mHTML.c_str()); + if (mURLcallback!=NULL) (*mURLcallback)(mHTML); } - mHTML=""; + mHTML.clear(); } } @@ -3894,7 +3892,7 @@ void LLTextEditor::setOnScrollEndCallback(void (*callback)(void*), void* userdat /////////////////////////////////////////////////////////////////// // Hack for Notecards -BOOL LLTextEditor::importBuffer(const LLString& buffer ) +BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) { std::istringstream instream(buffer); @@ -3983,7 +3981,7 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer ) return success; } -BOOL LLTextEditor::exportBuffer(LLString &buffer ) +BOOL LLTextEditor::exportBuffer(std::string &buffer ) { std::ostringstream outstream(buffer); @@ -4016,7 +4014,7 @@ LLTextSegment::LLTextSegment( const LLStyleSP& style, S32 start, S32 end ) : { } LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is_visible) : - mStyle(new LLStyle(is_visible,color,"")), + mStyle(new LLStyle(is_visible,color,LLStringUtil::null)), mStart( start), mEnd( end ), mToken(NULL), @@ -4024,7 +4022,7 @@ LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is { } LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end ) : - mStyle(new LLStyle(TRUE, color,"" )), + mStyle(new LLStyle(TRUE, color,LLStringUtil::null )), mStart( start), mEnd( end ), mToken(NULL), @@ -4032,7 +4030,7 @@ LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end ) : { } LLTextSegment::LLTextSegment( const LLColor3& color, S32 start, S32 end ) : - mStyle(new LLStyle(TRUE, color,"" )), + mStyle(new LLStyle(TRUE, color,LLStringUtil::null )), mStart( start), mEnd( end ), mToken(NULL), @@ -4040,7 +4038,7 @@ LLTextSegment::LLTextSegment( const LLColor3& color, S32 start, S32 end ) : { } -BOOL LLTextSegment::getToolTip(LLString& msg) const +BOOL LLTextSegment::getToolTip(std::string& msg) const { if (mToken && !mToken->getToolTip().empty()) { @@ -4095,7 +4093,7 @@ LLXMLNodePtr LLTextEditor::getXML(bool save_children) const // static LLView* LLTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("text_editor"); + std::string name("text_editor"); node->getAttributeString("name", name); LLRect rect; @@ -4109,7 +4107,7 @@ LLView* LLTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory LLFontGL* font = LLView::selectFont(node); - LLString text = node->getTextContents().substr(0, max_text_length - 1); + std::string text = node->getTextContents().substr(0, max_text_length - 1); LLTextEditor* text_editor = new LLTextEditor(name, rect, @@ -4161,10 +4159,10 @@ void LLTextEditor::setTextEditorParameters(LLXMLNodePtr node) } /////////////////////////////////////////////////////////////////// -S32 LLTextEditor::findHTMLToken(const LLString &line, S32 pos, BOOL reverse) const +S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) const { - LLString openers=" \t('\"[{<>"; - LLString closers=" \t)'\"]}><;"; + std::string openers=" \t('\"[{<>"; + std::string closers=" \t)'\"]}><;"; S32 m2; S32 retval; @@ -4198,7 +4196,7 @@ S32 LLTextEditor::findHTMLToken(const LLString &line, S32 pos, BOOL reverse) con return retval; } -BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) const +BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end) const { S32 m1,m2,m3; @@ -4215,7 +4213,7 @@ BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) const m2 = line.substr(*begin,(m1 - *begin)).find("http"); m3 = line.substr(*begin,(m1 - *begin)).find("secondlife"); - LLString badneighbors=".,<>?';\"][}{=-+_)(*&^%$#@!~`\t\r\n\\"; + std::string badneighbors=".,<>?';\"][}{=-+_)(*&^%$#@!~`\t\r\n\\"; if (m2 >= 0 || m3>=0) { @@ -4241,7 +4239,7 @@ BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) const if ( ( *end - m1 ) > 2 && m1 > *begin) { - LLString badneighbors=".,<>/?';\"][}{=-+_)(*&^%$#@!~`"; + std::string badneighbors=".,<>/?';\"][}{=-+_)(*&^%$#@!~`"; m2 = badneighbors.find(line.substr(m1+1,1)); m3 = badneighbors.find(line.substr(m1-1,1)); if (m3<0 && m2<0) @@ -4257,8 +4255,8 @@ BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) const { S32 strpos, strpos2; - LLString url = line.substr(*begin,*end - *begin); - LLString slurlID = "slurl.com/secondlife/"; + std::string url = line.substr(*begin,*end - *begin); + std::string slurlID = "slurl.com/secondlife/"; strpos = url.find(slurlID); if (strpos < 0) diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index af2dbcfd5f..e261d13872 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -62,10 +62,10 @@ public: static const llwchar LAST_EMBEDDED_CHAR = 0x10ffff; static const S32 MAX_EMBEDDED_ITEMS = LAST_EMBEDDED_CHAR - FIRST_EMBEDDED_CHAR + 1; - LLTextEditor(const LLString& name, + LLTextEditor(const std::string& name, const LLRect& rect, S32 max_length, - const LLString &default_text, + const std::string &default_text, const LLFontGL* glfont = NULL, BOOL allow_embedded_items = FALSE); @@ -85,10 +85,10 @@ public: virtual BOOL handleKeyHere(KEY key, MASK mask ); virtual BOOL handleUnicodeCharHere(llwchar uni_char); - virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, - EAcceptance *accept, LLString& tooltip_msg); + EAcceptance *accept, std::string& tooltip_msg); virtual void onMouseCaptureLost(); // view overrides @@ -123,9 +123,9 @@ public: virtual void deselect(); virtual BOOL canDeselect() const; - void selectNext(const LLString& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE); - BOOL replaceText(const LLString& search_text, const LLString& replace_text, BOOL case_insensitive, BOOL wrap = TRUE); - void replaceTextAll(const LLString& search_text, const LLString& replace_text, BOOL case_insensitive); + void selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE); + BOOL replaceText(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive, BOOL wrap = TRUE); + void replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive); // Undo/redo stack void blockUndo(); @@ -136,17 +136,17 @@ public: BOOL allowsEmbeddedItems() const { return mAllowEmbeddedItems; } // inserts text at cursor - void insertText(const LLString &text); + void insertText(const std::string &text); // appends text at end - void appendText(const LLString &wtext, bool allow_undo, bool prepend_newline, + void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline, const LLStyleSP *stylep = NULL); - void appendColoredText(const LLString &wtext, bool allow_undo, + void appendColoredText(const std::string &wtext, bool allow_undo, bool prepend_newline, const LLColor4 &color, - const LLString& font_name = LLString::null); + const std::string& font_name = LLStringUtil::null); // if styled text starts a line, you need to prepend a newline. - void appendStyledText(const LLString &new_text, bool allow_undo, + void appendStyledText(const std::string &new_text, bool allow_undo, bool prepend_newline, const LLStyleSP *stylep = NULL); @@ -162,10 +162,9 @@ public: void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap ); - // Keywords support - void loadKeywords(const LLString& filename, - const LLDynamicArray<const char*>& funcs, - const LLDynamicArray<const char*>& tooltips, + void loadKeywords(const std::string& filename, + const std::vector<std::string>& funcs, + const std::vector<std::string>& tooltips, const LLColor3& func_color); LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } @@ -195,8 +194,8 @@ public: void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; } // Hack to handle Notecards - virtual BOOL importBuffer(const LLString& buffer ); - virtual BOOL exportBuffer(LLString& buffer ); + virtual BOOL importBuffer(const char* buffer, S32 length ); + virtual BOOL exportBuffer(std::string& buffer ); // If takes focus, will take keyboard focus on click. void setTakesFocus(BOOL b) { mTakesFocus = b; } @@ -210,7 +209,7 @@ public: // Callbacks static void setLinkColor(LLColor4 color) { mLinkColor = color; } - static void setURLCallbacks(void (*callback1) (const char* url), + static void setURLCallbacks(void (*callback1) (const std::string& url), bool (*callback2) (const std::string& url), bool (*callback3) (const std::string& url) ) { mURLcallback = callback1; mSecondlifeURLcallback = callback2; mSecondlifeURLcallbackRightClick = callback3;} @@ -221,7 +220,7 @@ public: void setValue(const LLSD& value); LLSD getValue() const; - const LLString& getText() const; + const std::string& getText() const; // Non-undoable void setText(const LLStringExplicit &utf8str); @@ -261,7 +260,7 @@ protected: void updateTextRect(); const LLRect& getTextRect() const { return mTextRect; } - void assignEmbedded(const LLString &s); + void assignEmbedded(const std::string &s); BOOL truncate(); // Returns true if truncation occurs static BOOL isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } @@ -313,8 +312,8 @@ protected: virtual void bindEmbeddedChars(LLFontGL* font) const {} virtual void unbindEmbeddedChars(LLFontGL* font) const {} - S32 findHTMLToken(const LLString &line, S32 pos, BOOL reverse) const; - BOOL findHTML(const LLString &line, S32 *begin, S32 *end) const; + S32 findHTMLToken(const std::string &line, S32 pos, BOOL reverse) const; + BOOL findHTML(const std::string &line, S32 *begin, S32 *end) const; // Abstract inner base class representing an undoable editor command. // Concrete sub-classes can be defined for operations such as insert, remove, etc. @@ -399,7 +398,7 @@ protected: S32 mLastSelectionY; BOOL mParseHTML; - LLString mHTML; + std::string mHTML; typedef std::vector<LLTextSegment *> segment_list_t; segment_list_t mSegments; @@ -436,7 +435,7 @@ private: // LLKeywords mKeywords; static LLColor4 mLinkColor; - static void (*mURLcallback) (const char* url); + static void (*mURLcallback) (const std::string& url); static bool (*mSecondlifeURLcallback) (const std::string& url); static bool (*mSecondlifeURLcallbackRightClick) (const std::string& url); @@ -447,7 +446,7 @@ private: class LLTextCmdRemove; LLWString mWText; - mutable LLString mUTF8Text; + mutable std::string mUTF8Text; mutable BOOL mTextIsUpToDate; S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes @@ -544,7 +543,7 @@ public: BOOL getIsDefault() const { return mIsDefault; } void setToken( LLKeywordToken* token ) { mToken = token; } LLKeywordToken* getToken() const { return mToken; } - BOOL getToolTip( LLString& msg ) const; + BOOL getToolTip( std::string& msg ) const; void dump() const; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 6ef485d82c..ac263250ff 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -63,8 +63,8 @@ const LLColor4 UI_VERTEX_COLOR(1.f, 1.f, 1.f, 1.f); BOOL gShowTextEditCursor = TRUE; // Language for UI construction -std::map<LLString, LLString> gTranslation; -std::list<LLString> gUntranslated; +std::map<std::string, std::string> gTranslation; +std::list<std::string> gUntranslated; LLControlGroup* LLUI::sConfigGroup = NULL; LLControlGroup* LLUI::sColorsGroup = NULL; @@ -80,8 +80,9 @@ BOOL LLUI::sQAMode = FALSE; // // Functions // -void make_ui_sound(const LLString& name) +void make_ui_sound(const char* namep) { + std::string name = ll_safe_string(namep); if (!LLUI::sConfigGroup->controlExists(name)) { llwarns << "tried to make ui sound for unknown sound name: " << name << llendl; @@ -1557,7 +1558,7 @@ void LLUI::initClass(LLControlGroup* config, LLImageProviderInterface* image_provider, LLUIAudioCallback audio_callback, const LLVector2* scale_factor, - const LLString& language) + const std::string& language) { sConfigGroup = config; sColorsGroup = colors; @@ -1647,10 +1648,10 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y) } //static -LLString LLUI::locateSkin(const LLString& filename) +std::string LLUI::locateSkin(const std::string& filename) { - LLString slash = gDirUtilp->getDirDelimiter(); - LLString found_file = filename; + std::string slash = gDirUtilp->getDirDelimiter(); + std::string found_file = filename; if (!gDirUtilp->fileExists(found_file)) { found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS? @@ -1659,18 +1660,18 @@ LLString LLUI::locateSkin(const LLString& filename) { if (!gDirUtilp->fileExists(found_file)) { - LLString localization(sConfigGroup->getString("Language")); + std::string localization(sConfigGroup->getString("Language")); if(localization == "default") { localization = sConfigGroup->getString("SystemLanguage"); } - LLString local_skin = "xui" + slash + localization + slash + filename; + std::string local_skin = "xui" + slash + localization + slash + filename; found_file = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, local_skin); } } if (!gDirUtilp->fileExists(found_file)) { - LLString local_skin = "xui" + slash + "en-us" + slash + filename; + std::string local_skin = "xui" + slash + "en-us" + slash + filename; found_file = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, local_skin); } if (!gDirUtilp->fileExists(found_file)) @@ -1718,7 +1719,7 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen) } //static -LLUIImage* LLUI::getUIImage(const LLString& name) +LLUIImage* LLUI::getUIImage(const std::string& name) { if (!name.empty()) return sImageProvider->getUIImage(name); @@ -1806,7 +1807,7 @@ LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled) // LLUIImage // -LLUIImage::LLUIImage(const LLString& name, LLPointer<LLImageGL> image) : +LLUIImage::LLUIImage(const std::string& name, LLPointer<LLImageGL> image) : mName(name), mImage(image), mScaleRegion(0.f, 1.f, 1.f, 0.f), diff --git a/indra/llui/llui.h b/indra/llui/llui.h index ab45e36175..d434dbd6d1 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -56,7 +56,7 @@ class LLUIImage; // UI colors extern const LLColor4 UI_VERTEX_COLOR; -void make_ui_sound(const LLString& name); +void make_ui_sound(const char* name); BOOL ui_point_in_rect(S32 x, S32 y, S32 left, S32 top, S32 right, S32 bottom); void gl_state_for_2d(S32 width, S32 height); @@ -144,7 +144,7 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL // void init_tr(); // Returns a string from the string table in the correct language -// LLString tr(const LLString& english_chars); +// std::string tr(const std::string& english_chars); // Used to hide the flashing text cursor when window doesn't have focus. extern BOOL gShowTextEditCursor; @@ -164,7 +164,7 @@ public: LLImageProviderInterface* image_provider, LLUIAudioCallback audio_callback = NULL, const LLVector2 *scale_factor = NULL, - const LLString& language = LLString::null); + const std::string& language = LLStringUtil::null); static void cleanupClass(); static void pushMatrix(); @@ -173,12 +173,12 @@ public: static void translate(F32 x, F32 y, F32 z = 0.0f); //helper functions (should probably move free standing rendering helper functions here) - static LLString locateSkin(const LLString& filename); + static std::string locateSkin(const std::string& filename); static void setCursorPositionScreen(S32 x, S32 y); static void setCursorPositionLocal(const LLView* viewp, S32 x, S32 y); static void setScaleFactor(const LLVector2& scale_factor); static void setLineWidth(F32 width); - static LLUIImage* getUIImage(const LLString& name); + static LLUIImage* getUIImage(const std::string& name); static LLVector2 getWindowSize(); static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); @@ -411,7 +411,7 @@ public: class LLUIImage : public LLRefCount { public: - LLUIImage(const LLString& name, LLPointer<LLImageGL> image); + LLUIImage(const std::string& name, LLPointer<LLImageGL> image); void setClipRegion(const LLRectf& region); void setScaleRegion(const LLRectf& region); @@ -431,7 +431,7 @@ public: void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); } void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, mImage->getWidth(0), mImage->getHeight(0), color, border_width); } - const LLString& getName() const { return mName; } + const std::string& getName() const { return mName; } S32 getWidth() const; S32 getHeight() const; @@ -441,7 +441,7 @@ public: S32 getTextureHeight() const; protected: - LLString mName; + std::string mName; LLRectf mScaleRegion; LLRectf mClipRegion; LLPointer<LLImageGL> mImage; @@ -592,7 +592,7 @@ public: LLImageProviderInterface() {}; virtual ~LLImageProviderInterface() {}; - virtual LLUIImagePtr getUIImage(const LLString& name) = 0; + virtual LLUIImagePtr getUIImage(const std::string& name) = 0; virtual LLUIImagePtr getUIImageByID(const LLUUID& id) = 0; virtual void cleanUp() = 0; }; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index aa44663fd0..c01845e524 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -98,7 +98,7 @@ LLUICtrl::LLUICtrl() : { } -LLUICtrl::LLUICtrl(const LLString& name, const LLRect& rect, BOOL mouse_opaque, +LLUICtrl::LLUICtrl(const std::string& name, const LLRect& rect, BOOL mouse_opaque, void (*on_commit_callback)(LLUICtrl*, void*), void* callback_userdata, U32 reshape) @@ -147,13 +147,13 @@ LLSD LLUICtrl::getValue() const } // virtual -BOOL LLUICtrl::setTextArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLUICtrl::setTextArg( const std::string& key, const LLStringExplicit& text ) { return FALSE; } // virtual -BOOL LLUICtrl::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLUICtrl::setLabelArg( const std::string& key, const LLStringExplicit& text ) { return FALSE; } @@ -495,7 +495,7 @@ LLUICtrl* LLUICtrl::findRootMostFocusRoot() const /* // Don't let the children handle the tool tip. Handle it here instead. -BOOL LLUICtrl::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) +BOOL LLUICtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { BOOL handled = FALSE; if (getVisible() && pointInView( x, y ) ) diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 6863940ddd..52ea37ffdd 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -69,7 +69,7 @@ public: typedef BOOL (*LLUICtrlValidate)(LLUICtrl* ctrl, void* userdata); LLUICtrl(); - LLUICtrl( const LLString& name, const LLRect& rect, BOOL mouse_opaque, + LLUICtrl( const std::string& name, const LLRect& rect, BOOL mouse_opaque, LLUICtrlCallback callback, void* callback_userdata, U32 reshape=FOLLOWS_NONE); @@ -78,7 +78,7 @@ public: // LLView interface /*virtual*/ void initFromXML(LLXMLNodePtr node, LLView* parent); /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; - /*virtual*/ BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); /*virtual*/ void onFocusReceived(); /*virtual*/ void onFocusLost(); /*virtual*/ BOOL isCtrl() const; @@ -97,7 +97,7 @@ public: virtual class LLCtrlScrollInterface* getScrollInterface(); virtual LLSD getValue() const; - virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); virtual void setIsChrome(BOOL is_chrome); virtual BOOL acceptsTextInput() const; // Defaults to false diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index c2dc9a1e90..15601850ae 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -76,18 +76,18 @@ const S32 VPAD = 4; const S32 FLOATER_H_MARGIN = 15; const S32 MIN_WIDGET_HEIGHT = 10; -std::vector<LLString> LLUICtrlFactory::mXUIPaths; +std::vector<std::string> LLUICtrlFactory::mXUIPaths; // UI Ctrl class for padding class LLUICtrlLocate : public LLUICtrl { public: - LLUICtrlLocate() : LLUICtrl("locate", LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); } + LLUICtrlLocate() : LLUICtrl(std::string("locate"), LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); } virtual void draw() { } static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("pad"); + std::string name("pad"); node->getAttributeString("name", name); LLUICtrlLocate *new_ctrl = new LLUICtrlLocate(); @@ -117,7 +117,7 @@ LLUICtrlFactory::~LLUICtrlFactory() void LLUICtrlFactory::setupPaths() { - LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); LLXMLNodePtr root; BOOL success = LLXMLNode::parseFile(filename, root, NULL); @@ -126,12 +126,12 @@ void LLUICtrlFactory::setupPaths() if (success) { LLXMLNodePtr path; - LLString app_dir = gDirUtilp->getAppRODataDir(); + std::string app_dir = gDirUtilp->getAppRODataDir(); for (path = root->getFirstChild(); path.notNull(); path = path->getNextSibling()) { LLUIString path_val_ui(path->getValue()); - LLString language = "en-us"; + std::string language = "en-us"; if (LLUI::sConfigGroup) { language = LLUI::sConfigGroup->getString("Language"); @@ -141,7 +141,7 @@ void LLUICtrlFactory::setupPaths() } } path_val_ui.setArg("[Language]", language); - LLString fullpath = app_dir + path_val_ui.getString(); + std::string fullpath = app_dir + path_val_ui.getString(); if (std::find(mXUIPaths.begin(), mXUIPaths.end(), fullpath) == mXUIPaths.end()) { @@ -151,8 +151,8 @@ void LLUICtrlFactory::setupPaths() } else // parsing failed { - LLString slash = gDirUtilp->getDirDelimiter(); - LLString dir = gDirUtilp->getAppRODataDir() + slash + "skins" + slash + "xui" + slash + "en-us" + slash; + std::string slash = gDirUtilp->getDirDelimiter(); + std::string dir = gDirUtilp->getAppRODataDir() + slash + "skins" + slash + "xui" + slash + "en-us" + slash; llwarns << "XUI::config file unable to open." << llendl; mXUIPaths.push_back(dir); } @@ -163,7 +163,7 @@ void LLUICtrlFactory::setupPaths() //----------------------------------------------------------------------------- // getLayeredXMLNode() //----------------------------------------------------------------------------- -bool LLUICtrlFactory::getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& root) +bool LLUICtrlFactory::getLayeredXMLNode(const std::string &filename, LLXMLNodePtr& root) { if (!LLXMLNode::parseFile(mXUIPaths.front() + filename, root, NULL)) { @@ -176,12 +176,12 @@ bool LLUICtrlFactory::getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& LLXMLNodePtr updateRoot; - std::vector<LLString>::const_iterator itor; + std::vector<std::string>::const_iterator itor; for (itor = mXUIPaths.begin(), ++itor; itor != mXUIPaths.end(); ++itor) { - LLString nodeName; - LLString updateName; + std::string nodeName; + std::string updateName; LLXMLNode::parseFile((*itor) + filename, updateRoot, NULL); @@ -201,7 +201,7 @@ bool LLUICtrlFactory::getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& //----------------------------------------------------------------------------- // buildFloater() //----------------------------------------------------------------------------- -void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename, +void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename, const LLCallbackMap::map_t* factory_map, BOOL open) /* Flawfinder: ignore */ { LLXMLNodePtr root; @@ -242,9 +242,9 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename //----------------------------------------------------------------------------- // saveToXML() //----------------------------------------------------------------------------- -S32 LLUICtrlFactory::saveToXML(LLView* viewp, const LLString& filename) +S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) { - llofstream out(filename.c_str()); + llofstream out(filename); if (!out.good()) { llwarns << "Unable to open " << filename << " for output." << llendl; @@ -264,7 +264,7 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const LLString& filename) //----------------------------------------------------------------------------- // buildPanel() //----------------------------------------------------------------------------- -BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, +BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, const LLCallbackMap::map_t* factory_map) { BOOL didPost = FALSE; @@ -308,7 +308,7 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, //----------------------------------------------------------------------------- // buildMenu() //----------------------------------------------------------------------------- -LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp) +LLMenuGL *LLUICtrlFactory::buildMenu(const std::string &filename, LLView* parentp) { // TomY TODO: Break this function into buildMenu and buildMenuBar LLXMLNodePtr root; @@ -346,7 +346,7 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp) //----------------------------------------------------------------------------- // buildMenu() //----------------------------------------------------------------------------- -LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* parentp) +LLPieMenu *LLUICtrlFactory::buildPieMenu(const std::string &filename, LLView* parentp) { LLXMLNodePtr root; @@ -362,7 +362,7 @@ LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* paren return NULL; } - LLString name("menu"); + std::string name("menu"); root->getAttributeString("name", name); LLPieMenu *menu = new LLPieMenu(name); @@ -387,7 +387,7 @@ void LLUICtrlFactory::rebuild() built_panel_it != mBuiltPanels.end(); ++built_panel_it) { - LLString filename = built_panel_it->second; + std::string filename = built_panel_it->second; LLPanel* panelp = built_panel_it->first.get(); if (!panelp) { @@ -415,7 +415,7 @@ void LLUICtrlFactory::rebuild() { continue; } - LLString filename = built_floater_it->second; + std::string filename = built_floater_it->second; llinfos << "Rebuilding UI floater " << floaterp->getName() << " from " << filename << llendl; @@ -435,8 +435,8 @@ void LLUICtrlFactory::rebuild() LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) { - LLString ctrl_type = node->getName()->mString; - LLString::toLower(ctrl_type); + std::string ctrl_type = node->getName()->mString; + LLStringUtil::toLower(ctrl_type); LLWidgetClassRegistry::factory_func_t func = LLWidgetClassRegistry::getInstance()->getCreatorFunc(ctrl_type); @@ -477,7 +477,7 @@ LLView* LLUICtrlFactory::createWidget(LLPanel *parent, LLXMLNodePtr node) //----------------------------------------------------------------------------- // createFactoryPanel() //----------------------------------------------------------------------------- -LLPanel* LLUICtrlFactory::createFactoryPanel(LLString name) +LLPanel* LLUICtrlFactory::createFactoryPanel(const std::string& name) { std::deque<const LLCallbackMap::map_t*>::iterator itor; for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor) @@ -499,10 +499,10 @@ LLPanel* LLUICtrlFactory::createFactoryPanel(LLString name) //----------------------------------------------------------------------------- //static -BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const LLString& name, LLColor4& color) +BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color) { - LLString colorstring; - BOOL res = node->getAttributeString(name, colorstring); + std::string colorstring; + BOOL res = node->getAttributeString(name.c_str(), colorstring); if (res && LLUI::sColorsGroup) { if (LLUI::sColorsGroup->controlExists(colorstring)) @@ -516,11 +516,11 @@ BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const LLString& name, } if (!res) { - res = LLColor4::parseColor(colorstring.c_str(), &color); + res = LLColor4::parseColor(colorstring, &color); } if (!res) { - res = node->getAttributeColor(name, color); + res = node->getAttributeColor(name.c_str(), color); } return res; } diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index cd4fa8cacf..8638986c9f 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -50,44 +50,45 @@ public: void setupPaths(); - void buildFloater(LLFloater* floaterp, const LLString &filename, + void buildFloater(LLFloater* floaterp, const std::string &filename, const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE); - BOOL buildPanel(LLPanel* panelp, const LLString &filename, + BOOL buildPanel(LLPanel* panelp, const std::string &filename, const LLCallbackMap::map_t* factory_map = NULL); void removePanel(LLPanel* panelp) { mBuiltPanels.erase(panelp->getHandle()); } void removeFloater(LLFloater* floaterp) { mBuiltFloaters.erase(floaterp->getHandle()); } - class LLMenuGL *buildMenu(const LLString &filename, LLView* parentp); - class LLPieMenu *buildPieMenu(const LLString &filename, LLView* parentp); + class LLMenuGL *buildMenu(const std::string &filename, LLView* parentp); + class LLPieMenu *buildPieMenu(const std::string &filename, LLView* parentp); // Does what you want for LLFloaters and LLPanels // Returns 0 on success - S32 saveToXML(LLView* viewp, const LLString& filename); + S32 saveToXML(LLView* viewp, const std::string& filename); // Rebuilds all currently built panels. void rebuild(); - static BOOL getAttributeColor(LLXMLNodePtr node, const LLString& name, LLColor4& color); + static BOOL getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color); - LLPanel* createFactoryPanel(LLString name); + LLPanel* createFactoryPanel(const std::string& name); virtual LLView* createCtrlWidget(LLPanel *parent, LLXMLNodePtr node); virtual LLView* createWidget(LLPanel *parent, LLXMLNodePtr node); - static bool getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& root); + static bool getLayeredXMLNode(const std::string &filename, LLXMLNodePtr& root); private: - typedef std::map<LLHandle<LLPanel>, LLString> built_panel_t; + typedef std::map<LLHandle<LLPanel>, std::string> built_panel_t; built_panel_t mBuiltPanels; - typedef std::map<LLHandle<LLFloater>, LLString> built_floater_t; + typedef std::map<LLHandle<LLFloater>, std::string> built_floater_t; built_floater_t mBuiltFloaters; std::deque<const LLCallbackMap::map_t*> mFactoryStack; - static std::vector<LLString> mXUIPaths; + + static std::vector<std::string> mXUIPaths; LLPanel* mDummyPanel; }; diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index d6496b1a41..0dde20934c 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -32,29 +32,29 @@ #include "linden_common.h" #include "lluistring.h" -const LLString::format_map_t LLUIString::sNullArgs; +const LLStringUtil::format_map_t LLUIString::sNullArgs; -LLUIString::LLUIString(const LLString& instring, const LLString::format_map_t& args) +LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) : mOrig(instring), mArgs(args) { format(); } -void LLUIString::assign(const LLString& s) +void LLUIString::assign(const std::string& s) { mOrig = s; format(); } -void LLUIString::setArgList(const LLString::format_map_t& args) +void LLUIString::setArgList(const LLStringUtil::format_map_t& args) { mArgs = args; format(); } -void LLUIString::setArg(const LLString& key, const LLString& replacement) +void LLUIString::setArg(const std::string& key, const std::string& replacement) { mArgs[key] = replacement; format(); @@ -64,7 +64,7 @@ void LLUIString::truncate(S32 maxchars) { if (mWResult.size() > (size_t)maxchars) { - LLWString::truncate(mWResult, maxchars); + LLWStringUtil::truncate(mWResult, maxchars); mResult = wstring_to_utf8str(mWResult); } } @@ -98,6 +98,6 @@ void LLUIString::clear() void LLUIString::format() { mResult = mOrig; - LLString::format(mResult, mArgs); + LLStringUtil::format(mResult, mArgs); mWResult = utf8str_to_wstring(mResult); } diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index dd787baafe..773bc09763 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -1,7 +1,7 @@ /** * @file lluistring.h * @author: Steve Bennetts - * @brief A fancy wrapper for LLString supporting argument substitutions. + * @brief A fancy wrapper for std::string supporting argument substitutions. * * $LicenseInfo:firstyear=2006&license=viewergpl$ * @@ -47,15 +47,15 @@ // LLUIString mMessage("Welcome [USERNAME] to [SECONDLIFE]!"); // mMessage.setArg("[USERNAME]", "Steve"); // mMessage.setArg("[SECONDLIFE]", "Second Life"); -// llinfos << mMessage.getString().c_str() << llendl; // outputs "Welcome Steve to Second Life" +// llinfos << mMessage.getString() << llendl; // outputs "Welcome Steve to Second Life" // mMessage.setArg("[USERNAME]", "Joe"); -// llinfos << mMessage.getString().c_str() << llendl; // outputs "Welcome Joe to Second Life" +// llinfos << mMessage.getString() << llendl; // outputs "Welcome Joe to Second Life" // mMessage = "Recepción a la [SECONDLIFE] [USERNAME]" // mMessage.setArg("[SECONDLIFE]", "Segunda Vida"); -// llinfos << mMessage.getString().c_str() << llendl; // outputs "Recepción a la Segunda Vida Joe" +// llinfos << mMessage.getString() << llendl; // outputs "Recepción a la Segunda Vida Joe" // Implementation Notes: -// Attempting to have operator[](const LLString& s) return mArgs[s] fails because we have +// Attempting to have operator[](const std::string& s) return mArgs[s] fails because we have // to call format() after the assignment happens. class LLUIString @@ -64,17 +64,17 @@ public: // These methods all perform appropriate argument substitution // and modify mOrig where appropriate LLUIString() {} - LLUIString(const LLString& instring, const LLString::format_map_t& args); - LLUIString(const LLString& instring) { assign(instring); } + LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args); + LLUIString(const std::string& instring) { assign(instring); } - void assign(const LLString& instring); - LLUIString& operator=(const LLString& s) { assign(s); return *this; } + void assign(const std::string& instring); + LLUIString& operator=(const std::string& s) { assign(s); return *this; } - void setArgList(const LLString::format_map_t& args); - void setArg(const LLString& key, const LLString& replacement); + void setArgList(const LLStringUtil::format_map_t& args); + void setArg(const std::string& key, const std::string& replacement); - const LLString& getString() const { return mResult; } - operator LLString() const { return mResult; } + const std::string& getString() const { return mResult; } + operator std::string() const { return mResult; } const LLWString& getWString() const { return mWResult; } operator LLWString() const { return mWResult; } @@ -92,15 +92,15 @@ public: void insert(S32 charidx, const LLWString& wchars); void replace(S32 charidx, llwchar wc); - static const LLString::format_map_t sNullArgs; + static const LLStringUtil::format_map_t sNullArgs; private: void format(); - LLString mOrig; - LLString mResult; + std::string mOrig; + std::string mResult; LLWString mWResult; // for displaying - LLString::format_map_t mArgs; + LLStringUtil::format_map_t mArgs; }; #endif // LL_LLUISTRING_H diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index a239968e5d..c20bfe6ac0 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -62,7 +62,7 @@ BOOL LLView::sDebugRects = FALSE; BOOL LLView::sDebugKeys = FALSE; S32 LLView::sDepth = 0; BOOL LLView::sDebugMouseHandling = FALSE; -LLString LLView::sMouseHandlerMessage; +std::string LLView::sMouseHandlerMessage; S32 LLView::sSelectID = GL_NAME_UI_RESERVED; BOOL LLView::sEditingUI = FALSE; BOOL LLView::sForceReshape = FALSE; @@ -90,7 +90,7 @@ LLView::LLView() : { } -LLView::LLView(const LLString& name, BOOL mouse_opaque) : +LLView::LLView(const std::string& name, BOOL mouse_opaque) : mParentView(NULL), mName(name), mReshapeFlags(FOLLOWS_NONE), @@ -109,7 +109,7 @@ LLView::LLView(const LLString& name, BOOL mouse_opaque) : LLView::LLView( - const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 reshape) : + const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 reshape) : mParentView(NULL), mName(name), mRect(rect), @@ -194,7 +194,7 @@ BOOL LLView::setToolTipArg(const LLStringExplicit& key, const LLStringExplicit& return TRUE; } -void LLView::setToolTipArgs( const LLString::format_map_t& args ) +void LLView::setToolTipArgs( const LLStringUtil::format_map_t& args ) { mToolTipMsg.setArgList(args); } @@ -221,9 +221,9 @@ BOOL LLView::getUseBoundingRect() } // virtual -const LLString& LLView::getName() const +const std::string& LLView::getName() const { - static const LLString unnamed("(no name)"); + static const std::string unnamed("(no name)"); return mName.empty() ? unnamed : mName; } @@ -460,7 +460,7 @@ void LLView::setEnabled(BOOL enabled) } //virtual -BOOL LLView::setLabelArg( const LLString& key, const LLStringExplicit& text ) +BOOL LLView::setLabelArg( const std::string& key, const LLStringExplicit& text ) { return FALSE; } @@ -666,11 +666,11 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask) return handled; } -LLString LLView::getShowNamesToolTip() +std::string LLView::getShowNamesToolTip() { LLView* view = getParent(); - LLString name; - LLString tool_tip = mName; + std::string name; + std::string tool_tip = mName; while (view) { @@ -678,7 +678,7 @@ LLString LLView::getShowNamesToolTip() if (name == "root") break; - if (view->getToolTip().find(".xml") != LLString::npos) + if (view->getToolTip().find(".xml") != std::string::npos) { tool_tip = view->getToolTip() + "/" + tool_tip; break; @@ -695,11 +695,11 @@ LLString LLView::getShowNamesToolTip() } -BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) +BOOL LLView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { BOOL handled = FALSE; - LLString tool_tip; + std::string tool_tip; for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) { @@ -719,8 +719,8 @@ BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_scre tool_tip = mToolTipMsg.getString(); if ( LLUI::sShowXUINames && - (tool_tip.find(".xml", 0) == LLString::npos) && - (mName.find("Drag", 0) == LLString::npos)) + (tool_tip.find(".xml", 0) == std::string::npos) && + (mName.find("Drag", 0) == std::string::npos)) { tool_tip = getShowNamesToolTip(); } @@ -824,7 +824,7 @@ BOOL LLView::handleUnicodeCharHere(llwchar uni_char ) BOOL LLView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - LLString& tooltip_msg) + std::string& tooltip_msg) { // CRO this is an experiment to allow drag and drop into object inventory based on the DragAndDrop tool's permissions rather than the parent BOOL handled = childrenHandleDragAndDrop( x, y, mask, drop, @@ -847,7 +847,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - LLString& tooltip_msg) + std::string& tooltip_msg) { LLView* handled_view = FALSE; // CRO this is an experiment to allow drag and drop into object inventory based on the DragAndDrop tool's permissions rather than the parent @@ -987,7 +987,7 @@ LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks) { if (sDebugMouseHandling) { - sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; + sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; } handled_view = viewp; @@ -1015,7 +1015,7 @@ LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) { if (sDebugMouseHandling) { - sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; + sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; } handled_view = viewp; @@ -1093,7 +1093,7 @@ LLView* LLView::childrenHandleMouseDown(S32 x, S32 y, MASK mask) { if (sDebugMouseHandling) { - sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; + sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; } handled_view = viewp; break; @@ -1120,7 +1120,7 @@ LLView* LLView::childrenHandleRightMouseDown(S32 x, S32 y, MASK mask) { if (sDebugMouseHandling) { - sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; + sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; } handled_view = viewp; break; @@ -1148,7 +1148,7 @@ LLView* LLView::childrenHandleDoubleClick(S32 x, S32 y, MASK mask) { if (sDebugMouseHandling) { - sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; + sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; } handled_view = viewp; break; @@ -1178,7 +1178,7 @@ LLView* LLView::childrenHandleMouseUp(S32 x, S32 y, MASK mask) { if (sDebugMouseHandling) { - sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; + sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; } handled_view = viewp; break; @@ -1205,7 +1205,7 @@ LLView* LLView::childrenHandleRightMouseUp(S32 x, S32 y, MASK mask) { if (sDebugMouseHandling) { - sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; + sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; } handled_view = viewp; break; @@ -1326,7 +1326,7 @@ void LLView::drawDebugRect() gGL.color4fv( border_color.mV ); x = debug_rect.getWidth()/2; y = debug_rect.getHeight()/2; - LLString debug_text = llformat("%s (%d x %d)", getName().c_str(), + std::string debug_text = llformat("%s (%d x %d)", getName().c_str(), debug_rect.getWidth(), debug_rect.getHeight()); LLFontGL::sSansSerifSmall->renderUTF8(debug_text, 0, (F32)x, (F32)y, border_color, LLFontGL::HCENTER, LLFontGL::BASELINE, LLFontGL::NORMAL, @@ -1537,7 +1537,7 @@ BOOL LLView::hasAncestor(const LLView* parentp) const //----------------------------------------------------------------------------- -BOOL LLView::childHasKeyboardFocus( const LLString& childname ) const +BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const { LLView *child = getChildView(childname, TRUE, FALSE); if (child) @@ -1552,7 +1552,7 @@ BOOL LLView::childHasKeyboardFocus( const LLString& childname ) const //----------------------------------------------------------------------------- -BOOL LLView::hasChild(const LLString& childname, BOOL recurse) const +BOOL LLView::hasChild(const std::string& childname, BOOL recurse) const { return getChildView(childname, recurse, FALSE) != NULL; } @@ -1560,7 +1560,7 @@ BOOL LLView::hasChild(const LLString& childname, BOOL recurse) const //----------------------------------------------------------------------------- // getChildView() //----------------------------------------------------------------------------- -LLView* LLView::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const +LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const { //richard: should we allow empty names? //if(name.empty()) @@ -1923,33 +1923,18 @@ LLView* LLView::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fact // static void LLView::addColorXML(LLXMLNodePtr node, const LLColor4& color, - const LLString& xml_name, const LLString& control_name) + const char* xml_name, const char* control_name) { - if (color != LLUI::sColorsGroup->getColor(control_name)) + if (color != LLUI::sColorsGroup->getColor(ll_safe_string(control_name))) { node->createChild(xml_name, TRUE)->setFloatValue(4, color.mV); } } -// static -void LLView::saveColorToXML(std::ostream& out, const LLColor4& color, - const LLString& xml_name, const LLString& control_name, - const LLString& indent) -{ - if (color != LLUI::sColorsGroup->getColor(control_name)) - { - out << indent << xml_name << "=\"" - << color.mV[VRED] << ", " - << color.mV[VGREEN] << ", " - << color.mV[VBLUE] << ", " - << color.mV[VALPHA] << "\"\n"; - } -} - //static -LLString LLView::escapeXML(const LLString& xml, LLString& indent) +std::string LLView::escapeXML(const std::string& xml, std::string& indent) { - LLString ret = indent + "\"" + LLXMLNode::escapeXML(xml); + std::string ret = indent + "\"" + LLXMLNode::escapeXML(xml); //replace every newline with a close quote, new line, indent, open quote size_t index = ret.size()-1; @@ -2404,12 +2389,12 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna // Listener dispatch functions //----------------------------------------------------------------------------- -void LLView::registerEventListener(LLString name, LLSimpleListener* function) +void LLView::registerEventListener(std::string name, LLSimpleListener* function) { - mDispatchList.insert(std::pair<LLString, LLSimpleListener*>(name, function)); + mDispatchList.insert(std::pair<std::string, LLSimpleListener*>(name, function)); } -void LLView::deregisterEventListener(LLString name) +void LLView::deregisterEventListener(std::string name) { dispatch_list_t::iterator itor = mDispatchList.find(name); if (itor != mDispatchList.end()) @@ -2418,7 +2403,7 @@ void LLView::deregisterEventListener(LLString name) } } -LLString LLView::findEventListener(LLSimpleListener *listener) const +std::string LLView::findEventListener(LLSimpleListener *listener) const { dispatch_list_t::const_iterator itor; for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) @@ -2432,10 +2417,10 @@ LLString LLView::findEventListener(LLSimpleListener *listener) const { return mParentView->findEventListener(listener); } - return LLString::null; + return LLStringUtil::null; } -LLSimpleListener* LLView::getListenerByName(const LLString& callback_name) +LLSimpleListener* LLView::getListenerByName(const std::string& callback_name) { LLSimpleListener* callback = NULL; dispatch_list_t::iterator itor = mDispatchList.find(callback_name); @@ -2450,7 +2435,7 @@ LLSimpleListener* LLView::getListenerByName(const LLString& callback_name) return callback; } -LLControlVariable *LLView::findControl(LLString name) +LLControlVariable *LLView::findControl(const std::string& name) { control_map_t::iterator itor = mFloaterControls.find(name); if (itor != mFloaterControls.end()) @@ -2494,7 +2479,7 @@ U32 LLView::createRect(LLXMLNodePtr node, LLRect &rect, LLView* parent_view, con } } - LLString rect_control; + std::string rect_control; node->getAttributeString("rect_control", rect_control); if (! rect_control.empty()) { @@ -2655,14 +2640,14 @@ void LLView::initFromXML(LLXMLNodePtr node, LLView* parent) if (node->hasAttribute("control_name")) { - LLString control_name; + std::string control_name; node->getAttributeString("control_name", control_name); setControlName(control_name, NULL); } if (node->hasAttribute("tool_tip")) { - LLString tool_tip_msg(""); + std::string tool_tip_msg; node->getAttributeString("tool_tip", tool_tip_msg); setToolTip(tool_tip_msg); } @@ -2695,7 +2680,7 @@ void LLView::parseFollowsFlags(LLXMLNodePtr node) { setFollowsNone(); - LLString follows; + std::string follows; node->getAttributeString("follows", follows); typedef boost::tokenizer<boost::char_separator<char> > tokenizer; @@ -2739,10 +2724,10 @@ LLFontGL* LLView::selectFont(LLXMLNodePtr node) if (node->hasAttribute("font")) { - LLString font_name; + std::string font_name; node->getAttributeString("font", font_name); - gl_font = LLFontGL::fontFromName(font_name.c_str()); + gl_font = LLFontGL::fontFromName(font_name); } return gl_font; } @@ -2754,7 +2739,7 @@ LLFontGL::HAlign LLView::selectFontHAlign(LLXMLNodePtr node) if (node->hasAttribute("halign")) { - LLString horizontal_align_name; + std::string horizontal_align_name; node->getAttributeString("halign", horizontal_align_name); gl_hfont_align = LLFontGL::hAlignFromName(horizontal_align_name); } @@ -2768,7 +2753,7 @@ LLFontGL::VAlign LLView::selectFontVAlign(LLXMLNodePtr node) if (node->hasAttribute("valign")) { - LLString vert_align_name; + std::string vert_align_name; node->getAttributeString("valign", vert_align_name); gl_vfont_align = LLFontGL::vAlignFromName(vert_align_name); } @@ -2782,7 +2767,7 @@ LLFontGL::StyleFlags LLView::selectFontStyle(LLXMLNodePtr node) if (node->hasAttribute("style")) { - LLString style_flags_name; + std::string style_flags_name; node->getAttributeString("style", style_flags_name); if (style_flags_name == "normal") @@ -2808,7 +2793,7 @@ LLFontGL::StyleFlags LLView::selectFontStyle(LLXMLNodePtr node) bool LLView::setControlValue(const LLSD& value) { - LLString ctrlname = getControlName(); + std::string ctrlname = getControlName(); if (!ctrlname.empty()) { LLUI::sConfigGroup->setValue(ctrlname, value); @@ -2818,7 +2803,7 @@ bool LLView::setControlValue(const LLSD& value) } //virtual -void LLView::setControlName(const LLString& control_name, LLView *context) +void LLView::setControlName(const std::string& control_name, LLView *context) { if (context == NULL) { @@ -2870,12 +2855,12 @@ bool LLView::controlListener(const LLSD& newvalue, LLHandle<LLView> handle, std: return false; } -void LLView::addBoolControl(LLString name, bool initial_value) +void LLView::addBoolControl(const std::string& name, bool initial_value) { - mFloaterControls[name] = new LLControlVariable(name, TYPE_BOOLEAN, initial_value, "Internal floater control"); + mFloaterControls[name] = new LLControlVariable(name, TYPE_BOOLEAN, initial_value, std::string("Internal floater control")); } -LLControlVariable *LLView::getControl(LLString name) +LLControlVariable *LLView::getControl(const std::string& name) { control_map_t::iterator itor = mFloaterControls.find(name); if (itor != mFloaterControls.end()) @@ -2910,20 +2895,20 @@ LLWidgetClassRegistry::LLWidgetClassRegistry() { } -void LLWidgetClassRegistry::registerCtrl(const LLString& tag, LLWidgetClassRegistry::factory_func_t function) +void LLWidgetClassRegistry::registerCtrl(const std::string& tag, LLWidgetClassRegistry::factory_func_t function) { - LLString lower_case_tag = tag; - LLString::toLower(lower_case_tag); + std::string lower_case_tag = tag; + LLStringUtil::toLower(lower_case_tag); mCreatorFunctions[lower_case_tag] = function; } -BOOL LLWidgetClassRegistry::isTagRegistered(const LLString &tag) +BOOL LLWidgetClassRegistry::isTagRegistered(const std::string &tag) { return mCreatorFunctions.find(tag) != mCreatorFunctions.end(); } -LLWidgetClassRegistry::factory_func_t LLWidgetClassRegistry::getCreatorFunc(const LLString& ctrl_type) +LLWidgetClassRegistry::factory_func_t LLWidgetClassRegistry::getCreatorFunc(const std::string& ctrl_type) { factory_map_t::const_iterator found_it = mCreatorFunctions.find(ctrl_type); if (found_it == mCreatorFunctions.end()) diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 94811adaa5..2e1d0e3868 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -89,7 +89,7 @@ virtual void setVisible(BOOL visible); LLFloater, LLAlertDialog, LLMenuItemGL, LLModalDialog virtual void setEnabled(BOOL enabled) { mEnabled = enabled; } LLCheckBoxCtrl, LLComboBox, LLLineEditor, LLMenuGL, LLRadioGroup, etc -virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ) { return FALSE; } +virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) { return FALSE; } LLUICtrl, LLButton, LLCheckBoxCtrl, LLLineEditor, LLMenuGL, LLSliderCtrl virtual void onVisibilityChange ( BOOL curVisibilityIn ); LLMenuGL @@ -114,7 +114,7 @@ virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); * virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); * -virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,EDragAndDropType cargo_type,void* cargo_data,EAcceptance* accept,LLString& tooltip_msg); +virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,EDragAndDropType cargo_type,void* cargo_data,EAcceptance* accept,std::string& tooltip_msg); * virtual void draw(); * @@ -128,11 +128,11 @@ virtual void onFocusLost() {} LLUICtrl, LLScrollListCtrl, LLMenuGL, LLLineEditor, LLComboBox virtual void onFocusReceived() {} LLUICtrl, LLTextEditor, LLScrollListVtrl, LLMenuGL, LLLineEditor -virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; +virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; LLTabContainer, LLPanel, LLMenuGL -virtual void setControlName(const LLString& control, LLView *context); +virtual void setControlName(const std::string& control, LLView *context); LLSliderCtrl, LLCheckBoxCtrl -virtual LLString getControlName() const { return mControlName; } +virtual std::string getControlName() const { return mControlName; } LLSliderCtrl, LLCheckBoxCtrl virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); LLMenuItem @@ -154,11 +154,11 @@ class LLWidgetClassRegistry : public LLSingleton<LLWidgetClassRegistry> friend class LLSingleton<LLWidgetClassRegistry>; public: typedef LLView* (*factory_func_t)(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - typedef std::map<LLString, factory_func_t> factory_map_t; + typedef std::map<std::string, factory_func_t> factory_map_t; - void registerCtrl(const LLString& xml_tag, factory_func_t function); - BOOL isTagRegistered(const LLString& xml_tag); - factory_func_t getCreatorFunc(const LLString& xml_tag); + void registerCtrl(const std::string& xml_tag, factory_func_t function); + BOOL isTagRegistered(const std::string& xml_tag); + factory_func_t getCreatorFunc(const std::string& xml_tag); // get (first) xml tag for a given class template <class T> std::string getTag() @@ -179,7 +179,7 @@ private: LLWidgetClassRegistry(); virtual ~LLWidgetClassRegistry() {}; - typedef std::set<LLString> ctrl_name_set_t; + typedef std::set<std::string> ctrl_name_set_t; ctrl_name_set_t mUICtrlNames; // map of xml tags to widget creator functions @@ -252,8 +252,8 @@ public: typedef child_tab_order_t::const_reverse_iterator child_tab_order_const_reverse_iter_t; LLView(); - LLView(const LLString& name, BOOL mouse_opaque); - LLView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE); + LLView(const std::string& name, BOOL mouse_opaque); + LLView(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE); virtual ~LLView(); @@ -274,7 +274,7 @@ public: BOOL getMouseOpaque() const { return mMouseOpaque; } void setToolTip( const LLStringExplicit& msg ); BOOL setToolTipArg( const LLStringExplicit& key, const LLStringExplicit& text ); - void setToolTipArgs( const LLString::format_map_t& args ); + void setToolTipArgs( const LLStringUtil::format_map_t& args ); virtual void setRect(const LLRect &rect); void setFollows(U32 flags) { mReshapeFlags = flags; } @@ -288,11 +288,11 @@ public: void setFollowsAll() { mReshapeFlags |= FOLLOWS_ALL; } void setSoundFlags(U8 flags) { mSoundFlags = flags; } - void setName(LLString name) { mName = name; } + void setName(std::string name) { mName = name; } void setUseBoundingRect( BOOL use_bounding_rect ); BOOL getUseBoundingRect(); - const LLString& getToolTip() const { return mToolTipMsg.getString(); } + const std::string& getToolTip() const { return mToolTipMsg.getString(); } void sendChildToFront(LLView* child); void sendChildToBack(LLView* child); @@ -340,7 +340,7 @@ public: BOOL getEnabled() const { return mEnabled; } U8 getSoundFlags() const { return mSoundFlags; } - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual void onVisibilityChange ( BOOL curVisibilityIn ); @@ -374,8 +374,8 @@ public: S32 getChildCount() const { return (S32)mChildList.size(); } template<class _Pr3> void sortChildren(_Pr3 _Pred) { mChildList.sort(_Pred); } BOOL hasAncestor(const LLView* parentp) const; - BOOL hasChild(const LLString& childname, BOOL recurse = FALSE) const; - BOOL childHasKeyboardFocus( const LLString& childname ) const; + BOOL hasChild(const std::string& childname, BOOL recurse = FALSE) const; + BOOL childHasKeyboardFocus( const std::string& childname ) const; // @@ -403,9 +403,9 @@ public: EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - LLString& tooltip_msg); + std::string& tooltip_msg); - LLString getShowNamesToolTip(); + std::string getShowNamesToolTip(); virtual void draw(); @@ -439,19 +439,19 @@ public: void localRectToScreen( const LLRect& local, LLRect* screen ) const; // Listener dispatching functions (Dispatcher deletes pointers to listeners on deregistration or destruction) - LLSimpleListener* getListenerByName(const LLString &callback_name); - void registerEventListener(LLString name, LLSimpleListener* function); - void deregisterEventListener(LLString name); - LLString findEventListener(LLSimpleListener *listener) const; - void addListenerToControl(LLEventDispatcher *observer, const LLString& name, LLSD filter, LLSD userdata); + LLSimpleListener* getListenerByName(const std::string& callback_name); + void registerEventListener(std::string name, LLSimpleListener* function); + void deregisterEventListener(std::string name); + std::string findEventListener(LLSimpleListener *listener) const; + void addListenerToControl(LLEventDispatcher *observer, const std::string& name, LLSD filter, LLSD userdata); - void addBoolControl(LLString name, bool initial_value); - LLControlVariable *getControl(LLString name); - LLControlVariable *findControl(LLString name); + void addBoolControl(const std::string& name, bool initial_value); + LLControlVariable *getControl(const std::string& name); + LLControlVariable *findControl(const std::string& name); bool setControlValue(const LLSD& value); - virtual void setControlName(const LLString& control, LLView *context); - virtual LLString getControlName() const { return mControlName; } + virtual void setControlName(const std::string& control, LLView *context); + virtual std::string getControlName() const { return mControlName; } // virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); virtual void setValue(const LLSD& value); virtual LLSD getValue() const; @@ -467,15 +467,15 @@ public: /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); // Display mToolTipMsg if no child handles it. - /*virtual*/ const LLString& getName() const; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); // Display mToolTipMsg if no child handles it. + /*virtual*/ const std::string& getName() const; /*virtual*/ void onMouseCaptureLost(); /*virtual*/ BOOL hasMouseCapture(); /*virtual*/ BOOL isView(); // Hack to support LLFocusMgr /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; - template <class T> T* getChild(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const + template <class T> T* getChild(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const { LLView* child = getChildView(name, recurse, FALSE); T* result = dynamic_cast<T*>(child); @@ -495,22 +495,22 @@ public: return result; } - virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; + virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; - template <class T> T* createDummyWidget(const LLString& name) const + template <class T> T* createDummyWidget(const std::string& name) const { T* widget = getDummyWidget<T>(name); if (!widget) { // get xml tag name corresponding to requested widget type (e.g. "button") - LLString xml_tag = LLWidgetClassRegistry::getInstance()->getTag<T>(); + std::string xml_tag = LLWidgetClassRegistry::getInstance()->getTag<T>(); if (xml_tag.empty()) { llwarns << "No xml tag registered for this class " << llendl; return NULL; } // create dummy xml node (<button name="foo"/>) - LLXMLNodePtr new_node_ptr = new LLXMLNode(xml_tag, FALSE); + LLXMLNodePtr new_node_ptr = new LLXMLNode(xml_tag.c_str(), FALSE); new_node_ptr->createChild("name", TRUE)->setStringValue(name); widget = dynamic_cast<T*>(createWidget(new_node_ptr)); @@ -530,7 +530,7 @@ public: return widget; } - template <class T> T* getDummyWidget(const LLString& name) const + template <class T> T* getDummyWidget(const std::string& name) const { dummy_widget_map_t::const_iterator found_it = mDummyWidgets.find(name); if (found_it == mDummyWidgets.end()) @@ -554,17 +554,14 @@ public: // Only saves color if different from default setting. static void addColorXML(LLXMLNodePtr node, const LLColor4& color, - const LLString& xml_name, const LLString& control_name); - static void saveColorToXML(std::ostream& out, const LLColor4& color, - const LLString& xml_name, const LLString& control_name, - const LLString& indent); // DEPRECATED + const char* xml_name, const char* control_name); // Escapes " (quot) ' (apos) & (amp) < (lt) > (gt) - //static LLString escapeXML(const LLString& xml); + //static std::string escapeXML(const std::string& xml); static LLWString escapeXML(const LLWString& xml); //same as above, but wraps multiple lines in quotes and prepends //indent as leading white space on each line - static LLString escapeXML(const LLString& xml, LLString& indent); + static std::string escapeXML(const std::string& xml, std::string& indent); // focuses the item in the list after the currently-focused item, wrapping if necessary static BOOL focusNext(LLView::child_list_t & result); @@ -594,7 +591,7 @@ protected: EDragAndDropType type, void* data, EAcceptance* accept, - LLString& tooltip_msg); + std::string& tooltip_msg); LLView* childrenHandleHover(S32 x, S32 y, MASK mask); LLView* childrenHandleMouseUp(S32 x, S32 y, MASK mask); @@ -606,14 +603,14 @@ protected: static bool controlListener(const LLSD& newvalue, LLHandle<LLView> handle, std::string type); - typedef std::map<LLString, LLControlVariable*> control_map_t; + typedef std::map<std::string, LLControlVariable*> control_map_t; control_map_t mFloaterControls; private: LLView* mParentView; child_list_t mChildList; - LLString mName; + std::string mName; // location in pixels, relative to surrounding structure, bottom,left=0,0 LLRect mRect; LLRect mBoundingRect; @@ -643,12 +640,12 @@ private: static LLWindow* sWindow; // All root views must know about their window. - typedef std::map<LLString, LLPointer<LLSimpleListener> > dispatch_list_t; + typedef std::map<std::string, LLPointer<LLSimpleListener> > dispatch_list_t; dispatch_list_t mDispatchList; - LLString mControlName; + std::string mControlName; - typedef std::map<LLString, LLView*> dummy_widget_map_t; + typedef std::map<std::string, LLView*> dummy_widget_map_t; dummy_widget_map_t mDummyWidgets; boost::signals::connection mControlConnection; @@ -658,7 +655,7 @@ public: static BOOL sDebugKeys; static S32 sDepth; static BOOL sDebugMouseHandling; - static LLString sMouseHandlerMessage; + static std::string sMouseHandlerMessage; static S32 sSelectID; static BOOL sEditingUI; static LLView* sEditingUIView; diff --git a/indra/llui/llviewborder.cpp b/indra/llui/llviewborder.cpp index 2148957ce3..a4cec9a53f 100644 --- a/indra/llui/llviewborder.cpp +++ b/indra/llui/llviewborder.cpp @@ -35,7 +35,7 @@ static LLRegisterWidget<LLViewBorder> r("view_border"); -LLViewBorder::LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel, EStyle style, S32 width ) +LLViewBorder::LLViewBorder( const std::string& name, const LLRect& rect, EBevel bevel, EStyle style, S32 width ) : LLView( name, rect, FALSE ), mBevel( bevel ), @@ -277,9 +277,9 @@ BOOL LLViewBorder::getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel { if (node->hasAttribute("bevel_style")) { - LLString bevel_string; + std::string bevel_string; node->getAttributeString("bevel_style", bevel_string); - LLString::toLower(bevel_string); + LLStringUtil::toLower(bevel_string); if (bevel_string == "none") { @@ -306,7 +306,7 @@ BOOL LLViewBorder::getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel // static LLView* LLViewBorder::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - LLString name("view_border"); + std::string name("view_border"); node->getAttributeString("name", name); LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_IN; diff --git a/indra/llui/llviewborder.h b/indra/llui/llviewborder.h index 3353103e96..d1bea62cb7 100644 --- a/indra/llui/llviewborder.h +++ b/indra/llui/llviewborder.h @@ -41,7 +41,7 @@ public: enum EBevel { BEVEL_IN, BEVEL_OUT, BEVEL_BRIGHT, BEVEL_NONE }; enum EStyle { STYLE_LINE, STYLE_TEXTURE }; - LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel = BEVEL_OUT, EStyle style = STYLE_LINE, S32 width = 1 ); + LLViewBorder( const std::string& name, const LLRect& rect, EBevel bevel = BEVEL_OUT, EStyle style = STYLE_LINE, S32 width = 1 ); virtual void setValue(const LLSD& val) { setRect(LLRect(val)); } |