[Libreoffice-commits] core.git: cui/source include/sfx2

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 08:52:41 UTC 2018


 cui/source/tabpages/tparea.cxx |   11 ++++++-----
 include/sfx2/tabdlg.hxx        |    6 ------
 2 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit 115268087dea599d4248213b1085d07275c0a007
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 12 21:28:38 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Dec 13 09:52:15 2018 +0100

    Resolves: tdf#120481 gradient subpage 12 pixels too short
    
    because the max preferred-size of the subpages is taken and
    applied as the size-request of the container parent.
    
    But the container parent as a 6px border, so the subpages end
    up hosted in a parent which allocates them 12px less than they hoped
    for.
    
    As they are instantiated in the parent to measure them, measure their
    parent instead and that calculates in the parent's border to end up
    with what they wanted
    
    Change-Id: Ib270b90f9c2fed7f8bd042cc66d0d10ad3c6f183
    Reviewed-on: https://gerrit.libreoffice.org/65058
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 33e4137b470e..a6d1f429296e 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -125,15 +125,16 @@ SvxAreaTabPage::SvxAreaTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs
 
     // Calculate optimal size of all pages..
     m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(aFillTab, &m_rXFSet));
-    m_aColorSize = m_pFillTabPage->get_container_size();
+    m_aColorSize = m_xFillTab->get_preferred_size();
     m_pFillTabPage.disposeAndReset(SvxGradientTabPage::Create(aFillTab, &m_rXFSet));
-    Size aGradientSize = m_pFillTabPage->get_container_size();
+    Size aGradientSize = m_xFillTab->get_preferred_size();
+    fprintf(stderr, "aGradientSize %ld\n", aGradientSize.Height());
     m_pFillTabPage.disposeAndReset(SvxBitmapTabPage::Create(aFillTab, &m_rXFSet));
-    Size aBitmapSize = m_pFillTabPage->get_container_size();
+    Size aBitmapSize = m_xFillTab->get_preferred_size();
     m_pFillTabPage.disposeAndReset(SvxHatchTabPage::Create(aFillTab, &m_rXFSet));
-    Size aHatchSize = m_pFillTabPage->get_container_size();
+    Size aHatchSize = m_xFillTab->get_preferred_size();
     m_pFillTabPage.disposeAndReset(SvxPatternTabPage::Create(aFillTab, &m_rXFSet));
-    Size aPatternSize = m_pFillTabPage->get_container_size();
+    Size aPatternSize = m_xFillTab->get_preferred_size();
     m_pFillTabPage.disposeAndClear();
 
     Size aSize(m_aColorSize);
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 6b40c8098ae4..10af733f7314 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -378,12 +378,6 @@ public:
 
     //TODO rename to GetFrameWeld when SfxTabPage doesn't inherit from anything
     weld::Window*   GetDialogFrameWeld() const;
-
-    //TODO rename to get_preferred_size when SfxTabPage doesn't inherit from anything
-    Size get_container_size() const
-    {
-        return m_xContainer->get_preferred_size();
-    }
 };
 
 #endif


More information about the Libreoffice-commits mailing list