svtools/source/filter/DocumentToGraphicRenderer.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 9c90cf14cc200778e3689371e62fa4c19466f75c
Author: Eike Rathke <er...@redhat.com>
Date:   Tue Sep 19 18:36:27 2017 +0200

    Writer export to PNG|JPG dialog preparation, current page number nonsense
    
    ... if selection, workaround to get SvFilterOptionsDialog displayed.
    
    Change-Id: I7ebf2bfa8054555db2365078a02effd88ce5836f
    Reviewed-on: https://gerrit.libreoffice.org/42486
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Eike Rathke <er...@redhat.com>

diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx 
b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index e5885f618df2..c5e390700189 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -101,9 +101,15 @@ Size 
DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 aCurrentPage)
 
     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 >= aCurrentPage)
+    if (nPages >= aCurrentPage || (mbSelectionOnly && nPages > 0))
     {
+        if (nPages < aCurrentPage)
+            // In case of mbSelectionOnly hit.
+            aCurrentPage = 1;
+
         Sequence< beans::PropertyValue > aResult = 
mxRenderable->getRenderer(aCurrentPage - 1, selection, renderProperties );
         for( sal_Int32 nProperty = 0, nPropertyCount = aResult.getLength(); 
nProperty < nPropertyCount; ++nProperty )
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to