[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/inc sc/source

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 17 15:32:36 UTC 2019


 sc/inc/unonames.hxx            |    2 ++
 sc/source/ui/unoobj/docuno.cxx |   13 ++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 1cbbc4159032eb71304f3b8705cd64f111653a8e
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Thu Jan 17 17:26:15 2019 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Mon Jun 17 17:31:53 2019 +0200

    Add aCalcPageSize and aCalcPagePos properties to ScModelObj::getRenderer
    
    So that we can adjust page offset when outputting to GDIMetaFiles
    
    Change-Id: I1c28440a1ff62a879b6341748a6d3092f2bfda96
    Reviewed-on: https://gerrit.libreoffice.org/66526
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit ec4a282657d84e9e745b68fa8299c8ecc4c7ea7a)
    Reviewed-on: https://gerrit.libreoffice.org/74171
    Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
    Tested-by: Muhammet Kara <muhammet.kara at collabora.com>

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index d90c4a510a3a..79f2189e1835 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -646,6 +646,8 @@
 #define SC_UNONAME_RENDERDEV        "RenderDevice"
 #define SC_UNONAME_SOURCERANGE      "SourceRange"
 #define SC_UNONAME_INC_NP_AREA      "PageIncludesNonprintableArea"
+#define SC_UNONAME_CALCPAGESIZE     "CalcPageContentSize"
+#define SC_UNONAME_CALCPAGEPOS      "CalcPagePos"
 
 // CellValueBinding
 #define SC_UNONAME_BOUNDCELL        "BoundCell"
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 6f60c4895741..56b01d0d95d0 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1868,7 +1868,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
         aPageSize.Height = TwipsToHMM( aTwips.Height());
     }
 
-    long nPropCount = bWasCellRange ? 3 : 2;
+    long nPropCount = bWasCellRange ? 5 : 4;
     uno::Sequence<beans::PropertyValue> aSequence(nPropCount);
     beans::PropertyValue* pArray = aSequence.getArray();
     pArray[0].Name = SC_UNONAME_PAGESIZE;
@@ -1881,8 +1881,19 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
         table::CellRangeAddress aRangeAddress( nTab,
                         aCellRange.aStart.Col(), aCellRange.aStart.Row(),
                         aCellRange.aEnd.Col(), aCellRange.aEnd.Row() );
+        tools::Rectangle aMMRect( pDocShell->GetDocument().GetMMRect(
+                    aCellRange.aStart.Col(), aCellRange.aStart.Row(),
+                    aCellRange.aEnd.Col(), aCellRange.aEnd.Row(), aCellRange.aStart.Tab()));
+
+        awt::Size aCalcPageSize ( aMMRect.GetSize().Width(),  aMMRect.GetSize().Height() );
+        awt::Point aCalcPagePos( aMMRect.getX(), aMMRect.getY() );
+
         pArray[2].Name = SC_UNONAME_SOURCERANGE;
         pArray[2].Value <<= aRangeAddress;
+        pArray[3].Name = SC_UNONAME_CALCPAGESIZE;
+        pArray[3].Value <<= aCalcPageSize;
+        pArray[4].Name = SC_UNONAME_CALCPAGEPOS;
+        pArray[4].Value <<= aCalcPagePos;
     }
 
     if( ! pPrinterOptions )


More information about the Libreoffice-commits mailing list