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

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