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/65059
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 33e4137..a6d1f42 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 0bf8662..d739a88 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -391,12 +391,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