[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - svx/source

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 9 09:07:03 UTC 2019


 svx/source/sdr/contact/viewcontactofsdrpathobj.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit f51fbaf45c6239bbf210e25dd61563f48d63fa93
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Thu Sep 5 19:09:09 2019 +0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Mon Sep 9 11:06:20 2019 +0200

    tdf#126184 Use max paper dimensions to calculate clip region
    
    Assuming at least A4 for the page size isn't enough if
    e.g. A2 or larger is used, so too much was clipped in that case.
    
    Therefore, use the the maximum paper width/height instead, which
    is 6 m by default. This is still far from the 19 km that caused
    tdf#63955 and I cannot reproduce tdf#63955 with that new limit.
    
    A big thanks to Regina Henschel for the great analysis in
    tdf#126184!
    
    (Side note: Comments 18 and 19 in tdf#63955 suggest to do the whole
     clipping elsewhere, so if anybody wants to take a look at this...)
    
    Change-Id: Iccacad621675df6c7b4477182d7332c4a3d67139
    Reviewed-on: https://gerrit.libreoffice.org/78690
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 1dccd6814f1fe7a06f3168d01d18d347269cd3c1)
    Reviewed-on: https://gerrit.libreoffice.org/78760
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
    Tested-by: Michael Weghorn <m.weghorn at posteo.de>
    (cherry picked from commit 28c6ddf65593dab16657a0907e38bf409b73f3c3)
    Reviewed-on: https://gerrit.libreoffice.org/78772

diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 0f09700181bc..5b6df38d6771 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -19,6 +19,7 @@
 
 
 #include <sdr/contact/viewcontactofsdrpathobj.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
 #include <svx/svdopath.hxx>
 #include <svx/svdpage.hxx>
 #include <svx/sdr/primitive2d/sdrattributecreator.hxx>
@@ -105,11 +106,14 @@ namespace sdr
                 //would not over flow into a tiny clip region
                 if (nPageWidth < SAL_MAX_INT32/2 && nPageHeight < SAL_MAX_INT32/2)
                 {
-                    //But, see tdf#97276 and tdf#98366. Don't clip too much if the
+                    //But, see tdf#97276, tdf#126184 and tdf#98366. Don't clip too much if the
                     //underlying page dimension is unknown or a paste document
                     //where the page sizes use the odd default of 10x10
-                    nPageWidth = std::max<sal_Int32>(21000, nPageWidth);
-                    nPageHeight = std::max<sal_Int32>(29700, nPageHeight);
+                    const SvtOptionsDrawinglayer aDrawinglayerOpt;
+                    const sal_Int32 nMaxPaperWidth = aDrawinglayerOpt.GetMaximumPaperWidth() * 1000;
+                    const sal_Int32 nMaxPaperHeight = aDrawinglayerOpt.GetMaximumPaperHeight() * 1000;
+                    nPageWidth = std::max<sal_Int32>(nPageWidth, nMaxPaperWidth);
+                    nPageHeight = std::max<sal_Int32>(nPageHeight, nMaxPaperHeight);
                     basegfx::B2DRange aClipRange(-nPageWidth, -nPageHeight,
                                                  nPageWidth*2, nPageHeight*2);
 


More information about the Libreoffice-commits mailing list