From eb228dcf3af8db371fd452e595396d8694c869fe Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 8 Jan 2010 16:41:39 -0800 Subject: fast timer performance tuning --- indra/llui/llfloater.cpp | 2 +- indra/llui/llkeywords.cpp | 2 +- indra/llui/lllayoutstack.cpp | 2 +- indra/llui/llpanel.cpp | 8 ++++---- indra/llui/lltextbase.cpp | 4 ++-- indra/llui/lltexteditor.cpp | 2 +- indra/llui/lluictrlfactory.cpp | 16 ++++++++-------- indra/llui/lluictrlfactory.h | 6 +++--- indra/llui/lluistring.cpp | 2 +- indra/llui/llview.cpp | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 845203b420..406e672efd 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2692,7 +2692,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p) } } -LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build"); +LLFastTimerUtil::DeclareTimer POST_BUILD("Floater Post Build"); bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index ede32084d0..a1ef9ff340 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -231,7 +231,7 @@ LLColor3 LLKeywords::readColor( const std::string& s ) return LLColor3( r, g, b ); } -LLFastTimer::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring"); +LLFastTimerUtil::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring"); // Walk through a string, applying the rules specified by the keyword token list and // create a list of color segments. diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 1aaba88c49..825cafb80d 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -437,7 +437,7 @@ bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_widt return NULL != panel; } -static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { LLFastTimer ft(FTM_UPDATE_LAYOUT); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index db32882438..24f6a89da1 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -369,7 +369,7 @@ void LLPanel::setBorderVisible(BOOL b) } } -LLFastTimer::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction"); +LLFastTimerUtil::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction"); LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_node) { @@ -476,9 +476,9 @@ void LLPanel::initFromParams(const LLPanel::Params& p) mBgAlphaImage = p.bg_alpha_image(); } -static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); -static LLFastTimer::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); -static LLFastTimer::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild"); +static LLFastTimerUtil::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); +static LLFastTimerUtil::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); +static LLFastTimerUtil::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild"); BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5ebf49c488..400e627d84 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1065,7 +1065,7 @@ S32 LLTextBase::getLeftOffset(S32 width) } -static LLFastTimer::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); +static LLFastTimerUtil::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow(S32 start_index) { LLFastTimer ft(FTM_TEXT_REFLOW); @@ -1377,7 +1377,7 @@ void LLTextBase::removeDocumentChild(LLView* view) } -static LLFastTimer::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); void LLTextBase::updateSegments() { LLFastTimer ft(FTM_UPDATE_TEXT_SEGMENTS); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index e8fc9475a5..a4c2770e20 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2498,7 +2498,7 @@ BOOL LLTextEditor::tryToRevertToPristineState() } -static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); +static LLFastTimerUtil::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); void LLTextEditor::loadKeywords(const std::string& filename, const std::vector& funcs, const std::vector& tooltips, diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 27237800d4..c5d3de576c 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -50,9 +50,9 @@ // this library includes #include "llfloater.h" -LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction"); -LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams"); -LLFastTimer::DeclareTimer FTM_WIDGET_SETUP("Widget Setup"); +LLFastTimerUtil::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction"); +LLFastTimerUtil::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams"); +LLFastTimerUtil::DeclareTimer FTM_WIDGET_SETUP("Widget Setup"); //----------------------------------------------------------------------------- @@ -105,7 +105,7 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa } } -static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); +static LLFastTimerUtil::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); //static void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node) @@ -147,7 +147,7 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid } -static LLFastTimer::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing"); +static LLFastTimerUtil::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing"); //----------------------------------------------------------------------------- // getLayeredXMLNode() //----------------------------------------------------------------------------- @@ -175,7 +175,7 @@ bool LLUICtrlFactory::getLocalizedXMLNode(const std::string &xui_filename, LLXML } } -static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); +static LLFastTimerUtil::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); //----------------------------------------------------------------------------- // buildFloater() @@ -247,7 +247,7 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) return 0; } -static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels"); +static LLFastTimerUtil::DeclareTimer FTM_BUILD_PANELS("Build Panels"); //----------------------------------------------------------------------------- // buildPanel() @@ -313,7 +313,7 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, L //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static LLFastTimer::DeclareTimer FTM_CREATE_FROM_XML("Create child widget"); +static LLFastTimerUtil::DeclareTimer FTM_CREATE_FROM_XML("Create child widget"); LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t& registry, LLXMLNodePtr output_node) { diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index b1fa6add67..80e82b784c 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -104,9 +104,9 @@ class LLDefaultWidgetRegistry //: public LLRegistrySingleton //{}; -extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP; -extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; -extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; +extern LLFastTimerUtil::DeclareTimer FTM_WIDGET_SETUP; +extern LLFastTimerUtil::DeclareTimer FTM_WIDGET_CONSTRUCTION; +extern LLFastTimerUtil::DeclareTimer FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file #ifndef LLUICTRLFACTORY_CPP diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index f7a53e87de..e15dc9eb85 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -35,7 +35,7 @@ #include "llsd.h" #include "lltrans.h" -LLFastTimer::DeclareTimer FTM_UI_STRING("UI String"); +LLFastTimerUtil::DeclareTimer FTM_UI_STRING("UI String"); LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index f1b08c380b..9da25b0308 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1707,7 +1707,7 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return child; } -static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); +static LLFastTimerUtil::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { -- cgit v1.2.3 From daa4965fe053dbd1af1f9665b29a4a10ac31cfea Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 11 Jan 2010 12:05:13 -0800 Subject: renamed LLFastTimerUtil to LLFastTimer --- indra/llui/llfloater.cpp | 2 +- indra/llui/llkeywords.cpp | 2 +- indra/llui/lllayoutstack.cpp | 2 +- indra/llui/llpanel.cpp | 8 ++++---- indra/llui/lltextbase.cpp | 4 ++-- indra/llui/lltexteditor.cpp | 2 +- indra/llui/lluictrlfactory.cpp | 16 ++++++++-------- indra/llui/lluictrlfactory.h | 6 +++--- indra/llui/lluistring.cpp | 2 +- indra/llui/llview.cpp | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 406e672efd..845203b420 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2692,7 +2692,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p) } } -LLFastTimerUtil::DeclareTimer POST_BUILD("Floater Post Build"); +LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build"); bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index a1ef9ff340..ede32084d0 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -231,7 +231,7 @@ LLColor3 LLKeywords::readColor( const std::string& s ) return LLColor3( r, g, b ); } -LLFastTimerUtil::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring"); +LLFastTimer::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring"); // Walk through a string, applying the rules specified by the keyword token list and // create a list of color segments. diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 825cafb80d..1aaba88c49 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -437,7 +437,7 @@ bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_widt return NULL != panel; } -static LLFastTimerUtil::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); +static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { LLFastTimer ft(FTM_UPDATE_LAYOUT); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 24f6a89da1..db32882438 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -369,7 +369,7 @@ void LLPanel::setBorderVisible(BOOL b) } } -LLFastTimerUtil::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction"); +LLFastTimer::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction"); LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_node) { @@ -476,9 +476,9 @@ void LLPanel::initFromParams(const LLPanel::Params& p) mBgAlphaImage = p.bg_alpha_image(); } -static LLFastTimerUtil::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); -static LLFastTimerUtil::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); -static LLFastTimerUtil::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild"); +static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); +static LLFastTimer::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); +static LLFastTimer::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild"); BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 400e627d84..5ebf49c488 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1065,7 +1065,7 @@ S32 LLTextBase::getLeftOffset(S32 width) } -static LLFastTimerUtil::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); +static LLFastTimer::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow(S32 start_index) { LLFastTimer ft(FTM_TEXT_REFLOW); @@ -1377,7 +1377,7 @@ void LLTextBase::removeDocumentChild(LLView* view) } -static LLFastTimerUtil::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); +static LLFastTimer::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); void LLTextBase::updateSegments() { LLFastTimer ft(FTM_UPDATE_TEXT_SEGMENTS); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index a4c2770e20..e8fc9475a5 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2498,7 +2498,7 @@ BOOL LLTextEditor::tryToRevertToPristineState() } -static LLFastTimerUtil::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); +static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); void LLTextEditor::loadKeywords(const std::string& filename, const std::vector& funcs, const std::vector& tooltips, diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index c5d3de576c..27237800d4 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -50,9 +50,9 @@ // this library includes #include "llfloater.h" -LLFastTimerUtil::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction"); -LLFastTimerUtil::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams"); -LLFastTimerUtil::DeclareTimer FTM_WIDGET_SETUP("Widget Setup"); +LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction"); +LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams"); +LLFastTimer::DeclareTimer FTM_WIDGET_SETUP("Widget Setup"); //----------------------------------------------------------------------------- @@ -105,7 +105,7 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa } } -static LLFastTimerUtil::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); +static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); //static void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node) @@ -147,7 +147,7 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid } -static LLFastTimerUtil::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing"); +static LLFastTimer::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing"); //----------------------------------------------------------------------------- // getLayeredXMLNode() //----------------------------------------------------------------------------- @@ -175,7 +175,7 @@ bool LLUICtrlFactory::getLocalizedXMLNode(const std::string &xui_filename, LLXML } } -static LLFastTimerUtil::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); +static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); //----------------------------------------------------------------------------- // buildFloater() @@ -247,7 +247,7 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) return 0; } -static LLFastTimerUtil::DeclareTimer FTM_BUILD_PANELS("Build Panels"); +static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels"); //----------------------------------------------------------------------------- // buildPanel() @@ -313,7 +313,7 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, L //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static LLFastTimerUtil::DeclareTimer FTM_CREATE_FROM_XML("Create child widget"); +static LLFastTimer::DeclareTimer FTM_CREATE_FROM_XML("Create child widget"); LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t& registry, LLXMLNodePtr output_node) { diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 80e82b784c..b1fa6add67 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -104,9 +104,9 @@ class LLDefaultWidgetRegistry //: public LLRegistrySingleton //{}; -extern LLFastTimerUtil::DeclareTimer FTM_WIDGET_SETUP; -extern LLFastTimerUtil::DeclareTimer FTM_WIDGET_CONSTRUCTION; -extern LLFastTimerUtil::DeclareTimer FTM_INIT_FROM_PARAMS; +extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP; +extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; +extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file #ifndef LLUICTRLFACTORY_CPP diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index e15dc9eb85..f7a53e87de 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -35,7 +35,7 @@ #include "llsd.h" #include "lltrans.h" -LLFastTimerUtil::DeclareTimer FTM_UI_STRING("UI String"); +LLFastTimer::DeclareTimer FTM_UI_STRING("UI String"); LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9da25b0308..f1b08c380b 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1707,7 +1707,7 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return child; } -static LLFastTimerUtil::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); +static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { -- cgit v1.2.3 From 3e5f5a205034cde29ef80a9230d8cd4867e6dec5 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 11 Jan 2010 14:41:37 -0800 Subject: EXT-3444 Volume control slider appears in an odd location reviewed by Leyla --- indra/llui/llfloater.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 845203b420..a35d279500 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -878,9 +878,11 @@ void LLFloater::setSnappedTo(const LLView* snap_view) else { //RN: assume it's a floater as it must be a sibling to our parent floater - LLFloater* floaterp = (LLFloater*)snap_view; - - setSnapTarget(floaterp->getHandle()); + const LLFloater* floaterp = dynamic_cast(snap_view); + if (floaterp) + { + setSnapTarget(floaterp->getHandle()); + } } } -- cgit v1.2.3 From 0f11042d25e0d9f26fd5921637e2a27209204d56 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 11 Jan 2010 17:35:17 -0800 Subject: EXT-4095 - [crashhunters] Crash on shutdown in LLTextBase destructor reviewed by James --- indra/llui/lltexteditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index e8fc9475a5..f2c3879a6c 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -308,7 +308,8 @@ LLTextEditor::~LLTextEditor() // Scrollbar is deleted by LLView std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); - delete mContextMenu; + // context menu is owned by menu holder, not us + //delete mContextMenu; } //////////////////////////////////////////////////////////// -- cgit v1.2.3 From f3bd6481a554ade34b133b2ae805838e27598639 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 13 Jan 2010 17:57:03 +0000 Subject: EXT-4197: Search in sub-panels for help IDs too. In order to support unique help IDs for the Landmark and Place Profile panels off the Places sidetray, we need to also search within any embedded (and visible) sub-panels. --- indra/llui/llpanel.cpp | 38 ++++++++++++++++++++++++++++++++++++++ indra/llui/llpanel.h | 3 +++ indra/llui/lluictrl.cpp | 8 ++++++++ 3 files changed, 49 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 143f19eea6..7f23fe2671 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -898,6 +898,44 @@ LLPanel *LLPanel::childGetVisibleTabWithHelp() return ::childGetVisibleTabWithHelp(this); } +static LLPanel *childGetVisiblePanelWithHelp(LLView *parent) +{ + LLView *child; + + // look through immediate children first for an active panel with help + for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) + { + // do we have a panel with a help topic? + LLPanel *panel = dynamic_cast(child); + if (panel && panel->getVisible() && !panel->getHelpTopic().empty()) + { + return panel; + } + } + + // then try a bit harder and recurse through all children + for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) + { + if (child->getVisible()) + { + LLPanel* panel = ::childGetVisiblePanelWithHelp(child); + if (panel) + { + return panel; + } + } + } + + // couldn't find any active panels with a help topic string + return NULL; +} + +LLPanel *LLPanel::childGetVisiblePanelWithHelp() +{ + // find a visible tab with a help topic (to determine help context) + return ::childGetVisiblePanelWithHelp(this); +} + void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ) { LLLineEditor* child = findChild(id); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index d0986a06d3..6de83fe3a7 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -214,7 +214,10 @@ public: // LLTabContainer void childShowTab(const std::string& id, const std::string& tabname, bool visible = true); LLPanel *childGetVisibleTab(const std::string& id) const; + + // Find a child with a nonempty Help topic LLPanel *childGetVisibleTabWithHelp(); + LLPanel *childGetVisiblePanelWithHelp(); // LLTextBox/LLTextEditor/LLLineEditor void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 6044908ca7..f016c0af89 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -876,6 +876,14 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) return true; // success (tab) } + // does the panel have a sub-panel with a help topic? + LLPanel *subpanel = panel->childGetVisiblePanelWithHelp(); + if (subpanel) + { + help_topic_out = subpanel->getHelpTopic(); + return true; // success (subpanel) + } + // otherwise, does the panel have a help topic itself? if (!panel->getHelpTopic().empty()) { -- cgit v1.2.3