summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-05-12 18:26:02 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-05-12 19:01:44 +0300
commit6e2e9d5904b3cc89deb755f3552d915104065aa0 (patch)
treed0008c0285ba4242fb8c28af11afb83f720f0567 /indra/llui
parent17e18aa9bfa095e8b41c1c0e45c5757101a3f710 (diff)
SL-19649 Adjust other classes for new deleteAllChildren mechanics
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lllayoutstack.cpp19
-rw-r--r--indra/llui/lllayoutstack.h1
-rw-r--r--indra/llui/llmenugl.cpp7
-rw-r--r--indra/llui/llmenugl.h1
4 files changed, 25 insertions, 3 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 8a011b4890..08ce31ffc5 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -284,6 +284,17 @@ void LLLayoutStack::draw()
}
}
+void LLLayoutStack::deleteAllChildren()
+{
+ mPanels.clear();
+ LLView::deleteAllChildren();
+
+ // Not really needed since nothing is left to
+ // display, but for the sake of consistency
+ updateFractionalSizes();
+ mNeedsLayout = true;
+}
+
void LLLayoutStack::removeChild(LLView* view)
{
LLLayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast<LLPanel*>(view));
@@ -291,12 +302,14 @@ void LLLayoutStack::removeChild(LLView* view)
if (embedded_panelp)
{
mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp));
- delete embedded_panelp;
+ LLView::removeChild(view);
updateFractionalSizes();
mNeedsLayout = true;
}
-
- LLView::removeChild(view);
+ else
+ {
+ LLView::removeChild(view);
+ }
}
BOOL LLLayoutStack::postBuild()
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 9a53a7f787..02685281ef 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -69,6 +69,7 @@ public:
virtual ~LLLayoutStack();
/*virtual*/ void draw();
+ /*virtual*/ void deleteAllChildren();
/*virtual*/ void removeChild(LLView*);
/*virtual*/ BOOL postBuild();
/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 35f2930800..1666ff8c98 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1891,6 +1891,13 @@ bool LLMenuGL::addContextChild(LLView* view, S32 tab_group)
return false;
}
+
+void LLMenuGL::deleteAllChildren()
+{
+ mItems.clear();
+ LLUICtrl::deleteAllChildren();
+}
+
void LLMenuGL::removeChild( LLView* ctrl)
{
// previously a dynamic_cast with if statement to check validity
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 47a46510b3..87e3f18ebc 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -449,6 +449,7 @@ public:
/*virtual*/ void drawBackground(LLMenuItemGL* itemp, F32 alpha);
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
+ /*virtual*/ void deleteAllChildren();
/*virtual*/ void removeChild( LLView* ctrl);
/*virtual*/ BOOL postBuild();