summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-03-06 14:40:55 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-03-07 20:27:30 +0100
commit40efd2177027645b93b57016b75943dcca779139 (patch)
tree04349b723b2cdbd1a6d271104dd2fdd83ccfe1cd /vcl
parent8a9eda59e45c73d051eb1e0106ee4d663fec9ba6 (diff)
after inserting a widget into a toolbar make the toolbar the parent again
Change-Id: I2e814215225e2617d63dd6eccfc2a48f056b1f9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90163 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/builder.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 7d7b87208dda..f44dabce534c 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2776,7 +2776,10 @@ VclPtr<vcl::Window> VclBuilder::insertObject(vcl::Window *pParent, const OString
rAtk.clear();
if (!pCurrentChild)
- pCurrentChild = m_aChildren.empty() ? pParent : m_aChildren.back().m_pWindow.get();
+ {
+ bool bToolbarParent = (pParent && pParent->GetType() == WindowType::TOOLBOX);
+ pCurrentChild = (m_aChildren.empty() || bToolbarParent) ? pParent : m_aChildren.back().m_pWindow.get();
+ }
return pCurrentChild;
}