[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Nov 17 16:43:37 UTC 2018


 vcl/source/window/builder.cxx |   52 ++++++++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 24 deletions(-)

New commits:
commit 22f4a98bae32dedb0b1c24e9b86876041532168c
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: Sat Nov 17 17:43:15 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/63439
    Tested-by: Jenkins
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    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 efa62401f876..f45d2cd2aff5 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1395,30 +1395,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