diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-03-29 12:18:12 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-04-09 11:12:58 +0200 |
commit | 67b54d45e9db0535d326b9331722f0199189ee30 (patch) | |
tree | 76d1eceaaae2d6b751f25ea2f327bb17acee35ca /sfx2 | |
parent | 59e9e31e1640edf6b6b6c50088f5eb7e83d4cf3c (diff) |
Handle different page sizes for redaction
Change-Id: I7136717936668fbb1d87b5d9491430c13c5e73fd
Reviewed-on: https://gerrit.libreoffice.org/69909
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
(cherry picked from commit 9683627f01d988be7958ee9a0311e20633598971)
Reviewed-on: https://gerrit.libreoffice.org/69913
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/SfxRedactionHelper.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx b/sfx2/source/doc/SfxRedactionHelper.cxx index cb333d0ccc3d..023a51f6e582 100644 --- a/sfx2/source/doc/SfxRedactionHelper.cxx +++ b/sfx2/source/doc/SfxRedactionHelper.cxx @@ -122,9 +122,17 @@ void SfxRedactionHelper::addPagesToDraw(uno::Reference<XComponent>& xComponent, GDIMetaFile rGDIMetaFile = aMetaFiles[nPage]; Graphic aGraphic(rGDIMetaFile); + sal_Int32 nPageHeight(rGDIMetaFile.GetPrefSize().Height()); + sal_Int32 nPageWidth(rGDIMetaFile.GetPrefSize().Width()); + uno::Reference<graphic::XGraphic> xGraph = aGraphic.GetXGraphic(); uno::Reference<drawing::XDrawPage> xPage = xDrawPages->insertNewByIndex(nPage); + // Set page size + uno::Reference<beans::XPropertySet> xPageProperySet(xPage, uno::UNO_QUERY); + xPageProperySet->setPropertyValue("Height", css::uno::makeAny(nPageHeight)); + xPageProperySet->setPropertyValue("Width", css::uno::makeAny(nPageWidth)); + // Create and insert the shape uno::Reference<drawing::XShape> xShape( xFactory->createInstance("com.sun.star.drawing.GraphicObjectShape"), uno::UNO_QUERY); |