summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-01-17 17:26:15 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-27 11:40:10 +0100
commite90f3cc7a73abf99a27d0f3149f187d7d0a130dc (patch)
tree28f58f99482abf56318ad892b5736ea6ae4d4ad1 /sc
parent9e2e2e660c11d6bcd3714d8f4b2e46757cfb1ab1 (diff)
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@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/69814 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/unonames.hxx2
-rw-r--r--sc/source/ui/unoobj/docuno.cxx13
2 files changed, 14 insertions, 1 deletions
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 6e104542f7dc..f1ff2e5dfdb6 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -639,6 +639,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 05ad2d5e186c..d23c3f081636 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1806,7 +1806,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;
@@ -1819,8 +1819,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 )