diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-08 16:58:40 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-03-27 21:40:13 +0100 |
commit | d132d2206926c8b25a11384844d5afe446901826 (patch) | |
tree | 2424b941d209ea079c159547640da375561b4fb3 /sfx2 | |
parent | 91b9632395a191264b13b2d51fc6510ac9a1134c (diff) |
Add method DocumentToGraphicRenderer::getPageCount()
And use that in sfx2 Redaction code to be independent of
the document/module type
Change-Id: Ic206f7a10a27d8d44566df34a10d009a34adf0a5
Reviewed-on: https://gerrit.libreoffice.org/65971
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/69813
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/objserv.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 43538cf7665c..6c5819cd3f78 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -532,22 +532,12 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) if(!xModel.is()) return; - uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier( - xModel->getCurrentController(), uno::UNO_QUERY); - if(!xTextViewCursorSupplier.is()) - return; - - uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), - uno::UNO_QUERY); - if(!xCursor.is()) - return; - - xCursor->jumpToLastPage(); - sal_Int16 nPages = xCursor->getPage(); - uno::Reference< lang::XComponent > xSourceDoc( xModel ); + DocumentToGraphicRenderer aRenderer(xSourceDoc, /*bSelectionOnly=*/false); + sal_Int32 nPages = aRenderer.getPageCount(); + std::vector< GDIMetaFile > aMetaFiles; for (sal_Int32 nPage = 1; nPage <= nPages; ++nPage) |