diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-18 14:07:56 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-19 08:21:09 +0100 |
commit | 189f4d3b3ee5807e1140b6c417a3b2687dfdd2a3 (patch) | |
tree | 427e41a98175e4d210de9a81ea298fc304ecf158 /include/svtools | |
parent | 16fffbe869785dffeda9ae0d9f7c18a6559a2093 (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>
Diffstat (limited to 'include/svtools')
-rw-r--r-- | include/svtools/DocumentToGraphicRenderer.hxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/svtools/DocumentToGraphicRenderer.hxx b/include/svtools/DocumentToGraphicRenderer.hxx index 4ce5cb4d41fa..49a3ab0b347e 100644 --- a/include/svtools/DocumentToGraphicRenderer.hxx +++ b/include/svtools/DocumentToGraphicRenderer.hxx @@ -46,12 +46,19 @@ 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; css::uno::Reference<css::awt::XToolkit> mxToolkit; css::uno::Any maSelection; - bool mbIsWriter; + DocType meDocType; std::vector<OUString> maChapterNames; bool hasSelection() const; @@ -77,7 +84,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, bool bExtOutDevData); @@ -92,6 +100,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 |