diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-08 16:58:40 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-08 21:07:22 +0100 |
commit | af3e421fdb32f172d40ba4641f24f1356fcb55ce (patch) | |
tree | 1be8392c1c5e487953cef0ae7a8f43705be50035 /sfx2 | |
parent | 93d3ef817af1e07ff8b6ea2e6636358c1762a62a (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>
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 fed50045b256..9fb13a899b1b 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -538,22 +538,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) |