[Libreoffice-commits] core.git: svtools/source

Eike Rathke erack at redhat.com
Tue Sep 19 18:00:44 UTC 2017


 svtools/source/filter/DocumentToGraphicRenderer.cxx |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 0d3dd9cf787a1a7329e70dd42ef0e172e6c18a59
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Sep 19 19:59:19 2017 +0200

    DocumentToGraphicRenderer: current page is 1 if selection
    
    Change-Id: I0d26cd4da6f39c27b06df53596f9f405c5b0771f
    Reviewed-on: https://gerrit.libreoffice.org/42491
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

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();
 }
 


More information about the Libreoffice-commits mailing list