From 115268087dea599d4248213b1085d07275c0a007 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 12 Dec 2018 21:28:38 +0000 Subject: Resolves: tdf#120481 gradient subpage 12 pixels too short MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Caolán McNamara --- cui/source/tabpages/tparea.cxx | 11 ++++++----- include/sfx2/tabdlg.hxx | 6 ------ 2 files changed, 6 insertions(+), 11 deletions(-) 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 -- cgit