From d3d39b98aa0b0161be4e573c440ce642617d6d15 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 20 Jul 2010 15:17:46 +0300 Subject: EXT-8458 FIXED ensure that static pointer to instance of LLPanelStandStopFlying is always valid to prevent crash. Consequences of root cause: Static pointer to LLPanelStandStopFlying in LLPanelStandStopFlying::getInstance() becomes invalid when the instance of the LLPanelStandStopFlying is a child of floater while it is destroying. Next usage of that pointed cause a crash. Root Cause: 1. LLFloater::closeFloater sets floater invisible and marks floater as "dead" but does not destroy it. 2. But that instance was still in LLFloaterReg map. It is removed in LLFloater's destructor. 3. So it was possible on low fps to get "dead" floater with LLFloaterReg, LLFloaterMove in this case. 4. Then LLMortician deleted floater instance shown on previous step. Call of setVisible(false) from the LLFloater's destructor does not call overridden LLFloaterMove's method (which is expected behavior.) So, child panel LLPanelStandStopFlying was not re-parented to Main View and was destroyed with LLFloaterMove. That leaded to the "Top Reason" described above. FIX: 1. Ensure that LLPanelStandStopFlying is not a child of LLFloaterMove on its destroying. 2. Synchronized removing of a floater instance from the LLFloaterReg when it is marked as "dead". Note: both changes fixes this bug independently, but I included both of them into result patch to avoid similar but in the future. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/781/ --HG-- branch : product-engine --- indra/llui/llfloater.cpp | 8 ++++++++ indra/llui/llfloater.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 39a6855273..22d6f6ca52 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -451,6 +451,14 @@ void LLFloater::enableResizeCtrls(bool enable) } } +void LLFloater::destroy() +{ + // LLFloaterReg should be synchronized with "dead" floater to avoid returning dead instance before + // it was deleted via LLMortician::updateClass(). See EXT-8458. + LLFloaterReg::removeInstance(mInstanceName, mKey); + die(); +} + // virtual LLFloater::~LLFloater() { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 3ea035777c..42f422f91c 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -308,7 +308,7 @@ protected: BOOL getAutoFocus() const { return mAutoFocus; } LLDragHandle* getDragHandle() const { return mDragHandle; } - void destroy() { die(); } // Don't call this directly. You probably want to call closeFloater() + void destroy(); // Don't call this directly. You probably want to call closeFloater() virtual void onClickCloseBtn(); -- cgit v1.2.3 From 20ce01811e3a5565a27de150e4658e996bac3108 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 20 Jul 2010 18:39:36 -0700 Subject: EXT-7654 FIX About Land Floater> Icons missing --- indra/llui/llcheckboxctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 3d32157406..6f81f5434c 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -191,7 +191,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) static LLUICachedControl llcheckboxctrl_btn_size ("UICheckboxctrlBtnSize", 0); const S32 FUDGE = 10; - S32 text_width = mFont->getWidth( mLabel->getText() ) + FUDGE; + S32 text_width = mLabel->getTextBoundingRect().getWidth() + FUDGE; S32 text_height = llround(mFont->getLineHeight()); LLRect label_rect; label_rect.setOriginAndSize( -- cgit v1.2.3 From a96f47db68dd52fa94bc3e9f652623583f85c60a Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Wed, 21 Jul 2010 19:00:57 +0300 Subject: EXT-8164 FIXED (Accordions should be reset to default state after Edit Outfit panel reopening) Now accordion on panels 'Edit Outfit', 'Editing Shape', 'Editing Hair', 'Editing Eyes', 'Editing Skin', 'Group Profile' and 'Place Profile' are reset when the panels are closed and then opened again. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/782/ --HG-- branch : product-engine --- indra/llui/llaccordionctrl.cpp | 25 +++++++++++++++++++++++++ indra/llui/llaccordionctrl.h | 1 + 2 files changed, 26 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 673631f99a..2bc8ea054a 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -811,6 +811,31 @@ void LLAccordionCtrl::reset () mScrollbar->setDocPos(0); } +void LLAccordionCtrl::expandDefaultTab() +{ + if (mAccordionTabs.size() > 0) + { + LLAccordionCtrlTab* tab = mAccordionTabs.front(); + + if (!tab->getDisplayChildren()) + { + tab->setDisplayChildren(true); + } + + for (size_t i = 1; i < mAccordionTabs.size(); ++i) + { + tab = mAccordionTabs[i]; + + if (tab->getDisplayChildren()) + { + tab->setDisplayChildren(false); + } + } + + arrange(); + } +} + void LLAccordionCtrl::sort() { if (!mTabComparator) diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index b5fdf796cd..8241ee1518 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -122,6 +122,7 @@ public: S32 notifyParent(const LLSD& info); void reset (); + void expandDefaultTab(); void setComparator(const LLTabComparator* comp) { mTabComparator = comp; } void sort(); -- cgit v1.2.3 From 98bd370952bfa54f629991b77c3e68b3064e5c9c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 22 Jul 2010 12:09:23 -0700 Subject: fix for checkbox truncation --- indra/llui/llcheckboxctrl.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 6f81f5434c..0c524cd470 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -81,17 +81,6 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p) // must be big enough to hold all children setUseBoundingRect(TRUE); - // Label (add a little space to make sure text actually renders) - const S32 FUDGE = 10; - S32 text_width = mFont->getWidth( p.label ) + FUDGE; - S32 text_height = llround(mFont->getLineHeight()); - LLRect label_rect; - label_rect.setOriginAndSize( - llcheckboxctrl_hpad + llcheckboxctrl_btn_size + llcheckboxctrl_spacing, - llcheckboxctrl_vpad + 1, // padding to get better alignment - text_width + llcheckboxctrl_hpad, - text_height ); - // *HACK Get rid of this with SL-55508... // this allows blank check boxes and radio boxes for now std::string local_label = p.label; @@ -101,7 +90,6 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p) } LLTextBox::Params tbparams = p.label_text; - tbparams.rect(label_rect); tbparams.initial_value(local_label); if (p.font.isProvided()) { @@ -111,6 +99,17 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p) mLabel = LLUICtrlFactory::create (tbparams); addChild(mLabel); + S32 text_width = mLabel->getTextBoundingRect().getWidth(); + S32 text_height = llround(mFont->getLineHeight()); + LLRect label_rect; + label_rect.setOriginAndSize( + llcheckboxctrl_hpad + llcheckboxctrl_btn_size + llcheckboxctrl_spacing, + llcheckboxctrl_vpad + 1, // padding to get better alignment + text_width + llcheckboxctrl_hpad, + text_height ); + mLabel->setShape(label_rect); + + // Button // Note: button cover the label by extending all the way to the right. LLRect btn_rect; @@ -190,8 +189,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) static LLUICachedControl llcheckboxctrl_vpad ("UICheckboxctrlVPad", 0); static LLUICachedControl llcheckboxctrl_btn_size ("UICheckboxctrlBtnSize", 0); - const S32 FUDGE = 10; - S32 text_width = mLabel->getTextBoundingRect().getWidth() + FUDGE; + S32 text_width = mLabel->getTextBoundingRect().getWidth(); S32 text_height = llround(mFont->getLineHeight()); LLRect label_rect; label_rect.setOriginAndSize( @@ -199,7 +197,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) llcheckboxctrl_vpad, text_width, text_height ); - mLabel->setRect(label_rect); + mLabel->setShape(label_rect); LLRect btn_rect; btn_rect.setOriginAndSize( @@ -207,7 +205,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) llcheckboxctrl_vpad, llcheckboxctrl_btn_size + llcheckboxctrl_spacing + text_width, llmax( text_height, llcheckboxctrl_btn_size() ) ); - mButton->setRect( btn_rect ); + mButton->setShape( btn_rect ); LLUICtrl::reshape(width, height, called_from_parent); } -- cgit v1.2.3 From 3c4f82b2984c0cf70b2bc61190495cf9cf1a6aad Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 23 Jul 2010 10:26:28 +0300 Subject: EXT-8318 ADDITIONAL FIXED ensure that thousands separator is in utf8 format (on Windows) before converting it to LLWString. Problem on Windows: ================== LLPanelMainInventory::updateItemcountText() formats number using viewer locale. non-break space is detected as unknown symbols while converting utf8str_to_wstring when formatted text is set to LLTextBox. FIX: === Added converting of string to multi-byte string and then to utf8 string while formatting on Windows. created opposite to "ll_convert_wide_to_string" function "ll_convert_string_to_wide" and helper function to call both of them. It is used now to convert result of formatted string while formatting integer number in locale. Fix affects Windows only. Reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/775/ --HG-- branch : product-engine --- indra/llui/llresmgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index ed870d46d5..9158bc70f5 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -298,11 +298,11 @@ void LLResMgr::getIntegerString( std::string& output, S32 input ) const { if (fraction == remaining_count) { - fraction_string = llformat("%d%c", fraction, getThousandsSeparator()); + fraction_string = llformat_to_utf8("%d%c", fraction, getThousandsSeparator()); } else { - fraction_string = llformat("%3.3d%c", fraction, getThousandsSeparator()); + fraction_string = llformat_to_utf8("%3.3d%c", fraction, getThousandsSeparator()); } output = fraction_string + output; } -- cgit v1.2.3 From a8632670db7366d7b1be362fa2300c6896cc0f61 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 23 Jul 2010 17:06:27 +0300 Subject: EXT-6739 FIXED Provided updating of object inspector gear menu 'Touch' and 'Sit' entries. Details: 1 Provided using Object.EnableSit and Object.EnableTouch callbacks for both object menu and inspector gear menu. Now default menu item label stores in hash map and since callback receives triggered control no need to hardcode updating menu item labels from callback. 2 Removed redundant attribute 'parameter' from menu xml's since now handler callbacks receives triggered menu item as function parameter. 3 Replaced LLObjectEnableTouch class with enable_object_touch function, since there no need on triggering callback on menu commit event. 4 Added symmetric method LLMenuItemGL::getValue(). 5 Removed unused "Object.EnableGearSit" callback. reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/774/ --HG-- branch : product-engine --- indra/llui/llmenugl.cpp | 6 ++++++ indra/llui/llmenugl.h | 1 + 2 files changed, 7 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index b4a1bcb7c5..8610d79142 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -217,6 +217,12 @@ void LLMenuItemGL::setValue(const LLSD& value) setLabel(value.asString()); } +//virtual +LLSD LLMenuItemGL::getValue() const +{ + return getLabel(); +} + //virtual BOOL LLMenuItemGL::handleAcceleratorKey(KEY key, MASK mask) { diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 7668f301ea..a484405eaa 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -95,6 +95,7 @@ public: // LLUICtrl overrides /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ LLSD getValue() const; virtual BOOL handleAcceleratorKey(KEY key, MASK mask); -- cgit v1.2.3