Blame SOURCES/0217-lok-svg-export-Default-to-exporting-all-slides-use-t.patch

f325b2
From 60f544a37be5431e603c22da10d827537afcc90d Mon Sep 17 00:00:00 2001
f325b2
From: Jan Holesovsky <kendy@collabora.com>
f325b2
Date: Fri, 16 Oct 2015 17:02:13 +0200
f325b2
Subject: [PATCH 217/398] lok svg export: Default to exporting all slides, use
f325b2
 the interactive SVG.
f325b2
f325b2
The slides to export can be tweaked via a "PagePos" parameter.
f325b2
f325b2
Change-Id: I66f19521bd8f699710eefafb29f54036d7e604c3
f325b2
(cherry picked from commit e0769daf7b4335024733fa43b26cd0ef0b03108f)
f325b2
---
f325b2
 filter/source/svg/svgexport.cxx |  3 ++-
f325b2
 filter/source/svg/svgfilter.cxx | 32 +++++++++++++++-----------------
f325b2
 2 files changed, 17 insertions(+), 18 deletions(-)
f325b2
f325b2
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
f325b2
index 5201e9730467..03d25389f27b 100644
f325b2
--- a/filter/source/svg/svgexport.cxx
f325b2
+++ b/filter/source/svg/svgexport.cxx
f325b2
@@ -29,6 +29,7 @@
f325b2
 #include <com/sun/star/util/MeasureUnit.hpp>
f325b2
 #include <com/sun/star/xml/sax/Writer.hpp>
f325b2
 
f325b2
+#include <comphelper/lok.hxx>
f325b2
 #include <rtl/bootstrap.hxx>
f325b2
 #include <svtools/miscopt.hxx>
f325b2
 #include <svx/unopage.hxx>
f325b2
@@ -716,7 +717,7 @@ bool SVGFilter::implExportDocument()
f325b2
     SvtMiscOptions aMiscOptions;
f325b2
     const bool bExperimentalMode = aMiscOptions.IsExperimentalMode();
f325b2
 
f325b2
-    mbSinglePage = (nLastPage == 0) || !bExperimentalMode;
f325b2
+    mbSinglePage = ((nLastPage == 0) || !bExperimentalMode) && !comphelper::LibreOfficeKit::isActive();
f325b2
     mnVisiblePage = -1;
f325b2
 
f325b2
     const Reference< XPropertySet >             xDefaultPagePropertySet( mxDefaultPage, UNO_QUERY );
f325b2
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
f325b2
index e44c37d9136f..0f268c221fa7 100644
f325b2
--- a/filter/source/svg/svgfilter.cxx
f325b2
+++ b/filter/source/svg/svgfilter.cxx
f325b2
@@ -20,6 +20,7 @@
f325b2
 
f325b2
 #include <cstdio>
f325b2
 
f325b2
+#include <comphelper/lok.hxx>
f325b2
 #include <comphelper/servicedecl.hxx>
f325b2
 #include <uno/environment.h>
f325b2
 #include <com/sun/star/drawing/XDrawPage.hpp>
f325b2
@@ -105,15 +106,24 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
f325b2
     {
f325b2
         // #i124608# detext selection
f325b2
         bool bSelectionOnly = false;
f325b2
-        bool bGotSelection(false);
f325b2
+        bool bGotSelection = false;
f325b2
 
f325b2
-        // #i124608# extract Single selection wanted from dialog return values
f325b2
-        for ( sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++ )
f325b2
+        // when using LibreOfficeKit, default to exporting everything (-1)
f325b2
+        bool bPageProvided = comphelper::LibreOfficeKit::isActive();
f325b2
+        sal_Int32 nPageToExport = -1;
f325b2
+
f325b2
+        for (sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++)
f325b2
         {
f325b2
-            if ( rDescriptor[nInd].Name == "SelectionOnly" )
f325b2
+            if (rDescriptor[nInd].Name == "SelectionOnly")
f325b2
             {
f325b2
+                // #i124608# extract single selection wanted from dialog return values
f325b2
                 rDescriptor[nInd].Value >>= bSelectionOnly;
f325b2
             }
f325b2
+            else if (rDescriptor[nInd].Name == "PagePos")
f325b2
+            {
f325b2
+                rDescriptor[nInd].Value >>= nPageToExport;
f325b2
+                bPageProvided = true;
f325b2
+            }
f325b2
         }
f325b2
 
f325b2
         uno::Reference< frame::XDesktop2 >                           xDesktop(frame::Desktop::create(mxContext));
f325b2
@@ -122,7 +132,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
f325b2
         uno::Reference<frame::XController >                          xController(xFrame->getController(),
f325b2
                                                                                      uno::UNO_QUERY_THROW);
f325b2
 
f325b2
-        if( !mSelectedPages.hasElements() )
f325b2
+        if (!bPageProvided)
f325b2
         {
f325b2
             uno::Reference<drawing::XDrawView >                          xDrawView(xController,
f325b2
                                                                                    uno::UNO_QUERY_THROW);
f325b2
@@ -188,18 +198,6 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
f325b2
          */
f325b2
         if( !mSelectedPages.hasElements() )
f325b2
         {
f325b2
-            sal_Int32            nLength = rDescriptor.getLength();
f325b2
-            const PropertyValue* pValue = rDescriptor.getConstArray();
f325b2
-            sal_Int32            nPageToExport = -1;
f325b2
-
f325b2
-            for ( sal_Int32 i = 0 ; i < nLength; ++i)
f325b2
-            {
f325b2
-                if ( pValue[ i ].Name == "PagePos" )
f325b2
-                {
f325b2
-                    pValue[ i ].Value >>= nPageToExport;
f325b2
-                }
f325b2
-            }
f325b2
-
f325b2
             uno::Reference< drawing::XMasterPagesSupplier > xMasterPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
f325b2
             uno::Reference< drawing::XDrawPagesSupplier >   xDrawPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
f325b2
 
f325b2
-- 
f325b2
2.12.0
f325b2