[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Fri Jan 13 21:12:14 UTC 2017


 cui/source/tabpages/tparea.cxx |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

New commits:
commit 9157ae95d4861c545b01e1d9df67932c86a3c640
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Jan 13 13:55:01 2017 +0100

    tdf#105259 calculate sizes of all area tab pages on construction
    
    When we open dialog that contains the area tab, we need to
    calculate the size of area tab pages (that are triggered by
    clicking on a button) and set the page area to the appropriate
    combined size. Otherwise we don't account for the needed space
    correctly and some page will be squished or have overlapping
    controls.
    
    This change creates all pages at dialog construction, gets
    all the optimal sizes and sets the size of the page container box
    to the combined (minimal) size.
    
    Change-Id: Ie04a121810b96973f6e4502a52af675b2baacf25
    Reviewed-on: https://gerrit.libreoffice.org/33040
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit e6d7d737522124350a17a3cfdee055f03200a274)
    Reviewed-on: https://gerrit.libreoffice.org/33048
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Heiko Tietze <tietze.heiko at googlemail.com>

diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 9972ca5..f2a054d 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -66,6 +66,19 @@ const sal_uInt16 SvxAreaTabPage::pAreaRanges[] =
     0
 };
 
+namespace
+{
+
+void lclExtendSize(Size& rSize, const Size& rInputSize)
+{
+    if (rSize.Width() < rInputSize.Width())
+        rSize.Width() = rInputSize.Width();
+    if (rSize.Height() < rInputSize.Height())
+        rSize.Height() = rInputSize.Height();
+}
+
+} // end anonymous namespace
+
 /*************************************************************************
 |*
 |*  Dialog to modify fill-attributes
@@ -125,6 +138,22 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
     m_pBtnPattern->SetClickHdl(aLink);
 
     SetExchangeSupport();
+
+    // Calculate optimal size of all pages..
+    m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(m_pFillTab, &m_rXFSet));
+    Size aSize = m_pFillTabPage->GetOptimalSize();
+    m_pFillTabPage.disposeAndReset(SvxGradientTabPage::Create(m_pFillTab, &m_rXFSet));
+    lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+    m_pFillTabPage.disposeAndReset(SvxBitmapTabPage::Create(m_pFillTab, &m_rXFSet));
+    lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+    m_pFillTabPage.disposeAndReset(SvxHatchTabPage::Create(m_pFillTab, &m_rXFSet));
+    lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+    m_pFillTabPage.disposeAndReset(SvxPatternTabPage::Create(m_pFillTab, &m_rXFSet));
+    lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+    m_pFillTabPage.disposeAndClear();
+
+    m_pFillTab->set_width_request(aSize.Width());
+    m_pFillTab->set_height_request(aSize.Height());
 }
 
 SvxAreaTabPage::~SvxAreaTabPage()


More information about the Libreoffice-commits mailing list