summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-09-19 19:59:19 +0200
committerEike Rathke <erack@redhat.com>2017-09-19 20:00:17 +0200
commit0d3dd9cf787a1a7329e70dd42ef0e172e6c18a59 (patch)
tree2b2f4af0c7607c04477c342022d6c686ace1c93e /svtools
parent76b116e5076010f49e177d9d4dc0a39f23bc3d26 (diff)
DocumentToGraphicRenderer: current page is 1 if selection
Change-Id: I0d26cd4da6f39c27b06df53596f9f405c5b0771f Reviewed-on: https://gerrit.libreoffice.org/42491 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter/DocumentToGraphicRenderer.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index 8051febbb763..f262ff5c0161 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -109,15 +109,9 @@ Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 nCurrentPage)
awt::Size aSize;
- /* TODO: the whole absolute "current page" number concept is useless when
- * it comes to selections, rework that. */
sal_Int32 nPages = mxRenderable->getRendererCount( selection, renderProperties );
- if (nPages >= nCurrentPage || (mbSelectionOnly && nPages > 0))
+ if (nPages >= nCurrentPage)
{
- if (nPages < nCurrentPage)
- // In case of mbSelectionOnly hit.
- nCurrentPage = 1;
-
Sequence< beans::PropertyValue > aResult = mxRenderable->getRenderer(nCurrentPage - 1, selection, renderProperties );
for( sal_Int32 nProperty = 0, nPropertyCount = aResult.getLength(); nProperty < nPropertyCount; ++nProperty )
{
@@ -191,6 +185,9 @@ Graphic DocumentToGraphicRenderer::renderToGraphic(
sal_Int32 DocumentToGraphicRenderer::getCurrentPage()
{
+ if (hasSelection())
+ return 1;
+
return getCurrentPageWriter();
}