diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-18 14:07:56 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-03-27 21:41:10 +0100 |
commit | ad32e6a65bfbcf439470e16c3442a499a9f6b40a (patch) | |
tree | d067773e21e0bbbb3cde332ca9eedd19610e3614 /include | |
parent | d132d2206926c8b25a11384844d5afe446901826 (diff) |
Redaction: Adjust offset for multiple Calc pages
* Add an enum and some methods to DocumentToGraphicRenderer
to differentiate between the doc/module types:
isWriter(), isCalc(), isImpress()
* Put some checks for module/doc type
* The result seems ok for a Calc document of multiple sheets
with hundreds of pages
Change-Id: Idf3e1966d4239df30a48a947a95c9085c25ee1bb
Reviewed-on: https://gerrit.libreoffice.org/66605
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/69815
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/DocumentToGraphicRenderer.hxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/svtools/DocumentToGraphicRenderer.hxx b/include/svtools/DocumentToGraphicRenderer.hxx index b44a7015d0df..96ea882f3917 100644 --- a/include/svtools/DocumentToGraphicRenderer.hxx +++ b/include/svtools/DocumentToGraphicRenderer.hxx @@ -44,6 +44,13 @@ class SVT_DLLPUBLIC DocumentToGraphicRenderer { const css::uno::Reference<css::lang::XComponent>& mxDocument; + enum DocType { + WRITER, + CALC, + IMPRESS, + UNKNOWN + }; + css::uno::Reference<css::frame::XModel> mxModel; css::uno::Reference<css::frame::XController> mxController; css::uno::Reference<css::view::XRenderable> mxRenderable; @@ -51,6 +58,7 @@ class SVT_DLLPUBLIC DocumentToGraphicRenderer css::uno::Any maSelection; bool mbSelectionOnly; bool mbIsWriter; + DocType meDocType; bool hasSelection() const; @@ -70,7 +78,8 @@ public: Size getDocumentSizeInPixels( sal_Int32 nCurrentPage ); - Size getDocumentSizeIn100mm(sal_Int32 nCurrentPage, Point* pDocumentPosition = nullptr); + Size getDocumentSizeIn100mm(sal_Int32 nCurrentPage, Point* pDocumentPosition = nullptr, + Point* pCalcPagePosition = nullptr, Size *pCalcPageSize = nullptr); Graphic renderToGraphic( sal_Int32 nCurrentPage, Size aDocumentSizePixel, Size aTargetSizePixel, Color aPageColor); @@ -85,6 +94,10 @@ public: css::uno::Reference< css::drawing::XShapes > & rxShapes, css::uno::Reference< css::drawing::XShape > & rxShape, const css::uno::Reference< css::frame::XController > & rxController ); + + bool isWriter() const; + bool isCalc() const; + bool isImpress() const; }; #endif |