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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 24 11:29:19 UTC 2019


 cui/source/tabpages/tpbitmap.cxx    |    2 +-
 cui/source/tabpages/tpgradnt.cxx    |    2 +-
 cui/source/tabpages/tphatch.cxx     |    2 +-
 cui/source/tabpages/tppattern.cxx   |    2 +-
 include/sfx2/dialoghelper.hxx       |    2 +-
 sfx2/source/dialog/dialoghelper.cxx |    4 ++--
 6 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit bfb7c7be5781246febcffd5fdafd1d74d9dd7bce
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 24 10:00:01 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Sep 24 13:28:13 2019 +0200

    getDrawPreviewOptimalSize can take an OutputDevice arg
    
    Change-Id: Ifb36166b153858ca7e32974e9b297e583b66c256
    Reviewed-on: https://gerrit.libreoffice.org/79444
    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/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 3357c5ba8a14..39f6a391e3e9 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -119,7 +119,7 @@ SvxBitmapTabPage::SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInA
         m_xBtnImport->hide();
 
     // Calculate size of display boxes
-    Size aSize = getDrawPreviewOptimalSize(this);
+    Size aSize = getDrawPreviewOptimalSize(m_aCtlBitmapPreview.GetDrawingArea()->get_ref_device());
     m_xBitmapLB->set_size_request(aSize.Width(), aSize.Height());
     m_xCtlBitmapPreview->set_size_request(aSize.Width(), aSize.Height());
 
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 6274913ac078..fee60f812be5 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -68,7 +68,7 @@ SvxGradientTabPage::SvxGradientTabPage(TabPageParent pParent, const SfxItemSet&
     , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "previewctl", m_aCtlPreview))
     , m_xGradientLBWin(new weld::CustomWeld(*m_xBuilder, "gradientpresetlist", *m_xGradientLB))
 {
-    Size aSize = getDrawPreviewOptimalSize(this);
+    Size aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device());
     m_xGradientLB->set_size_request(aSize.Width(), aSize.Height());
     m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height());
     // this page needs ExchangeSupport
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 6d99d73817e8..dc152538a9e7 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -63,7 +63,7 @@ SvxHatchTabPage::SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAtt
     , m_xHatchLBWin(new weld::CustomWeld(*m_xBuilder, "hatchpresetlist", *m_xHatchLB))
     , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "previewctl", m_aCtlPreview))
 {
-    Size aSize = getDrawPreviewOptimalSize(this);
+    Size aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device());
     m_xHatchLBWin->set_size_request(aSize.Width(), aSize.Height());
     m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height());
 
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index c2358a0fa546..7c1d713dc1b7 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -87,7 +87,7 @@ SvxPatternTabPage::SvxPatternTabPage(TabPageParent pParent, const SfxItemSet& rI
     , m_xPatternLBWin(new weld::CustomWeld(*m_xBuilder, "patternpresetlist", *m_xPatternLB))
 {
     // size of the bitmap display
-    Size aSize = getDrawPreviewOptimalSize(this);
+    Size aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device());
     m_xPatternLB->set_size_request(aSize.Width(), aSize.Height());
     m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height());
 
diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx
index f9c5df9012f4..c18545a75c49 100644
--- a/include/sfx2/dialoghelper.hxx
+++ b/include/sfx2/dialoghelper.hxx
@@ -26,7 +26,7 @@ class OutputDevice;
 
 Size SFX2_DLLPUBLIC getParagraphPreviewOptimalSize(const OutputDevice& rReference);
 
-Size SFX2_DLLPUBLIC getDrawPreviewOptimalSize(const vcl::Window *pReference);
+Size SFX2_DLLPUBLIC getDrawPreviewOptimalSize(const OutputDevice& rReference);
 
 Size SFX2_DLLPUBLIC getPreviewStripSize(const OutputDevice& rReference);
 
diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx
index 0af9600960ea..4c7d63e23e0e 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -20,9 +20,9 @@ Size getParagraphPreviewOptimalSize(const OutputDevice& rReference)
     return rReference.LogicToPixel(Size(68 , 112), MapMode(MapUnit::MapAppFont));
 }
 
-Size getDrawPreviewOptimalSize(const vcl::Window *pReference)
+Size getDrawPreviewOptimalSize(const OutputDevice& rReference)
 {
-    return pReference->LogicToPixel(Size(88, 42), MapMode(MapUnit::MapAppFont));
+    return rReference.LogicToPixel(Size(88, 42), MapMode(MapUnit::MapAppFont));
 }
 
 Size getPreviewStripSize(const OutputDevice& rReference)


More information about the Libreoffice-commits mailing list