summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-15 16:35:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-15 21:55:08 +0100
commit1d988778095ecbe84f1a1002511377d0708b3443 (patch)
tree962aea426ba828441765f859c018e5c4747c0a76 /vcl/source/window
parenta78bac697f9398de7b9480eacf0e9fafce1ca58d (diff)
Resolves: tdf#121432 don't insert an extra page when parent is tabcontrol
but the new child is a toplevel widget Change-Id: Ib794e076e2626485b9d9231daf914db6dd9b5e2f Reviewed-on: https://gerrit.libreoffice.org/63431 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/builder.cxx52
1 files changed, 28 insertions, 24 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 5f14f9cc0dc5..95a1fb996cd4 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1546,30 +1546,34 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
if (pParent && pParent->GetType() == WindowType::TABCONTROL)
{
- //We have to add a page
-
- //make default pageid == position
- TabControl *pTabControl = static_cast<TabControl*>(pParent);
- sal_uInt16 nNewPageCount = pTabControl->GetPageCount()+1;
- sal_uInt16 nNewPageId = nNewPageCount;
- pTabControl->InsertPage(nNewPageId, OUString());
- pTabControl->SetCurPageId(nNewPageId);
- SAL_WARN_IF(bIsPlaceHolder, "vcl.layout", "we should have no placeholders for tabpages");
- if (!bIsPlaceHolder)
- {
- VclPtrInstance<TabPage> pPage(pTabControl);
- pPage->Show();
-
- //Make up a name for it
- OString sTabPageId = get_by_window(pParent) +
- OString("-page") +
- OString::number(nNewPageCount);
- m_aChildren.emplace_back(sTabPageId, pPage, false);
- pPage->SetHelpId(m_sHelpRoot + sTabPageId);
-
- pParent = pPage;
-
- pTabControl->SetTabPage(nNewPageId, pPage);
+ bool bTopLevel(name == "GtkDialog" || name == "GtkMessageDialog" ||
+ name == "GtkWindow" || name == "GtkPopover");
+ if (!bTopLevel)
+ {
+ //We have to add a page
+ //make default pageid == position
+ TabControl *pTabControl = static_cast<TabControl*>(pParent);
+ sal_uInt16 nNewPageCount = pTabControl->GetPageCount()+1;
+ sal_uInt16 nNewPageId = nNewPageCount;
+ pTabControl->InsertPage(nNewPageId, OUString());
+ pTabControl->SetCurPageId(nNewPageId);
+ SAL_WARN_IF(bIsPlaceHolder, "vcl.layout", "we should have no placeholders for tabpages");
+ if (!bIsPlaceHolder)
+ {
+ VclPtrInstance<TabPage> pPage(pTabControl);
+ pPage->Show();
+
+ //Make up a name for it
+ OString sTabPageId = get_by_window(pParent) +
+ OString("-page") +
+ OString::number(nNewPageCount);
+ m_aChildren.emplace_back(sTabPageId, pPage, false);
+ pPage->SetHelpId(m_sHelpRoot + sTabPageId);
+
+ pParent = pPage;
+
+ pTabControl->SetTabPage(nNewPageId, pPage);
+ }
}
}