[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 15 20:55:33 UTC 2018
vcl/source/window/builder.cxx | 52 ++++++++++++++++++++++--------------------
1 file changed, 28 insertions(+), 24 deletions(-)
New commits:
commit 1d988778095ecbe84f1a1002511377d0708b3443
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Nov 15 16:35:31 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 15 21:55:08 2018 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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);
+ }
}
}
More information about the Libreoffice-commits
mailing list