Kaydet (Commit) e0769daf authored tarafından Jan Holesovsky's avatar Jan Holesovsky

lok svg export: Default to exporting all slides, use the interactive SVG.

The slides to export can be tweaked via a "PagePos" parameter.

Change-Id: I66f19521bd8f699710eefafb29f54036d7e604c3
üst 2cb17258
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <com/sun/star/util/MeasureUnit.hpp> #include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/xml/sax/Writer.hpp>
#include <comphelper/lok.hxx>
#include <rtl/bootstrap.hxx> #include <rtl/bootstrap.hxx>
#include <svtools/miscopt.hxx> #include <svtools/miscopt.hxx>
#include <svx/unopage.hxx> #include <svx/unopage.hxx>
...@@ -700,7 +701,7 @@ bool SVGFilter::implExportDocument() ...@@ -700,7 +701,7 @@ bool SVGFilter::implExportDocument()
SvtMiscOptions aMiscOptions; SvtMiscOptions aMiscOptions;
const bool bExperimentalMode = aMiscOptions.IsExperimentalMode(); const bool bExperimentalMode = aMiscOptions.IsExperimentalMode();
mbSinglePage = (nLastPage == 0) || !bExperimentalMode; mbSinglePage = ((nLastPage == 0) || !bExperimentalMode) && !comphelper::LibreOfficeKit::isActive();
mnVisiblePage = -1; mnVisiblePage = -1;
const Reference< XPropertySet > xDefaultPagePropertySet( mxDefaultPage, UNO_QUERY ); const Reference< XPropertySet > xDefaultPagePropertySet( mxDefaultPage, UNO_QUERY );
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <cstdio> #include <cstdio>
#include <comphelper/lok.hxx>
#include <comphelper/servicedecl.hxx> #include <comphelper/servicedecl.hxx>
#include <uno/environment.h> #include <uno/environment.h>
#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XDrawPage.hpp>
...@@ -107,22 +108,31 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto ...@@ -107,22 +108,31 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
{ {
// #i124608# detect selection // #i124608# detect selection
bool bSelectionOnly = false; bool bSelectionOnly = false;
bool bGotSelection(false); bool bGotSelection = false;
// #i124608# extract Single selection wanted from dialog return values // when using LibreOfficeKit, default to exporting everything (-1)
for ( sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++ ) bool bPageProvided = comphelper::LibreOfficeKit::isActive();
sal_Int32 nPageToExport = -1;
for (sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++)
{ {
if ( rDescriptor[nInd].Name == "SelectionOnly" ) if (rDescriptor[nInd].Name == "SelectionOnly")
{ {
// #i124608# extract single selection wanted from dialog return values
rDescriptor[nInd].Value >>= bSelectionOnly; rDescriptor[nInd].Value >>= bSelectionOnly;
} }
else if (rDescriptor[nInd].Name == "PagePos")
{
rDescriptor[nInd].Value >>= nPageToExport;
bPageProvided = true;
}
} }
uno::Reference<frame::XDesktop2> xDesktop(frame::Desktop::create(mxContext)); uno::Reference<frame::XDesktop2> xDesktop(frame::Desktop::create(mxContext));
uno::Reference<frame::XFrame> xFrame(xDesktop->getCurrentFrame(), uno::UNO_QUERY_THROW); uno::Reference<frame::XFrame> xFrame(xDesktop->getCurrentFrame(), uno::UNO_QUERY_THROW);
uno::Reference<frame::XController > xController(xFrame->getController(), uno::UNO_QUERY_THROW); uno::Reference<frame::XController > xController(xFrame->getController(), uno::UNO_QUERY_THROW);
if( !mSelectedPages.hasElements() ) if (!bPageProvided)
{ {
uno::Reference<drawing::XDrawView> xDrawView(xController, uno::UNO_QUERY_THROW); uno::Reference<drawing::XDrawView> xDrawView(xController, uno::UNO_QUERY_THROW);
uno::Reference<drawing::framework::XControllerManager> xManager(xController, uno::UNO_QUERY_THROW); uno::Reference<drawing::framework::XControllerManager> xManager(xController, uno::UNO_QUERY_THROW);
...@@ -186,18 +196,6 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto ...@@ -186,18 +196,6 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
*/ */
if( !mSelectedPages.hasElements() ) if( !mSelectedPages.hasElements() )
{ {
sal_Int32 nLength = rDescriptor.getLength();
const PropertyValue* pValue = rDescriptor.getConstArray();
sal_Int32 nPageToExport = -1;
for ( sal_Int32 i = 0 ; i < nLength; ++i)
{
if ( pValue[ i ].Name == "PagePos" )
{
pValue[ i ].Value >>= nPageToExport;
}
}
uno::Reference< drawing::XMasterPagesSupplier > xMasterPagesSupplier( mxSrcDoc, uno::UNO_QUERY ); uno::Reference< drawing::XMasterPagesSupplier > xMasterPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( mxSrcDoc, uno::UNO_QUERY ); uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment