[Libreoffice-commits] core.git: 2 commits - filter/source
Jan Holesovsky
kendy at collabora.com
Fri Oct 16 08:06:14 PDT 2015
filter/source/svg/svgexport.cxx | 3 -
filter/source/svg/svgfilter.cxx | 91 ++++++++++++++++++----------------------
2 files changed, 45 insertions(+), 49 deletions(-)
New commits:
commit e0769daf7b4335024733fa43b26cd0ef0b03108f
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri Oct 16 17:02:13 2015 +0200
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
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index f087fa64..04939e7 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
+#include <comphelper/lok.hxx>
#include <rtl/bootstrap.hxx>
#include <svtools/miscopt.hxx>
#include <svx/unopage.hxx>
@@ -700,7 +701,7 @@ bool SVGFilter::implExportDocument()
SvtMiscOptions aMiscOptions;
const bool bExperimentalMode = aMiscOptions.IsExperimentalMode();
- mbSinglePage = (nLastPage == 0) || !bExperimentalMode;
+ mbSinglePage = ((nLastPage == 0) || !bExperimentalMode) && !comphelper::LibreOfficeKit::isActive();
mnVisiblePage = -1;
const Reference< XPropertySet > xDefaultPagePropertySet( mxDefaultPage, UNO_QUERY );
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index bf6483f..f11399e 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -20,6 +20,7 @@
#include <cstdio>
+#include <comphelper/lok.hxx>
#include <comphelper/servicedecl.hxx>
#include <uno/environment.h>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -107,22 +108,31 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
{
// #i124608# detect selection
bool bSelectionOnly = false;
- bool bGotSelection(false);
+ bool bGotSelection = false;
- // #i124608# extract Single selection wanted from dialog return values
- for ( sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++ )
+ // when using LibreOfficeKit, default to exporting everything (-1)
+ 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;
}
+ else if (rDescriptor[nInd].Name == "PagePos")
+ {
+ rDescriptor[nInd].Value >>= nPageToExport;
+ bPageProvided = true;
+ }
}
uno::Reference<frame::XDesktop2> xDesktop(frame::Desktop::create(mxContext));
uno::Reference<frame::XFrame> xFrame(xDesktop->getCurrentFrame(), 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::framework::XControllerManager> xManager(xController, uno::UNO_QUERY_THROW);
@@ -186,18 +196,6 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
*/
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::XDrawPagesSupplier > xDrawPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
commit 2cb172582a034dccc40be16f73b369e772c97ecb
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri Oct 16 16:21:48 2015 +0200
svg export: Some whitespace cleanup, fix typos.
Change-Id: I0de8b5229a83d2ed1ccecbd5608c94881b9baad3
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index e1e2a1e..bf6483f 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -105,7 +105,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
#ifndef DISABLE_EXPORT
else if( mxSrcDoc.is() )
{
- // #i124608# detext selection
+ // #i124608# detect selection
bool bSelectionOnly = false;
bool bGotSelection(false);
@@ -118,18 +118,14 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
}
}
- uno::Reference< frame::XDesktop2 > xDesktop(frame::Desktop::create(mxContext));
- 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::XDesktop2> xDesktop(frame::Desktop::create(mxContext));
+ uno::Reference<frame::XFrame> xFrame(xDesktop->getCurrentFrame(), uno::UNO_QUERY_THROW);
+ uno::Reference<frame::XController > xController(xFrame->getController(), uno::UNO_QUERY_THROW);
if( !mSelectedPages.hasElements() )
{
- uno::Reference<drawing::XDrawView > xDrawView(xController,
- uno::UNO_QUERY_THROW);
- uno::Reference<drawing::framework::XControllerManager> xManager(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::XConfigurationController> xConfigController(xManager->getConfigurationController());
// which view configuration are we in?
@@ -179,7 +175,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
if( !mSelectedPages.hasElements() )
{
- // apparently failed to glean selection - fallback to current page
+ // apparently failed to clean selection - fallback to current page
mSelectedPages.realloc( 1 );
mSelectedPages[0] = xDrawView->getCurrentPage();
}
@@ -257,30 +253,31 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
// may be useful; it may have happened by error)
bRet = false;
}
- else {
- /*
- * We get all master page that are targeted by at least one draw page.
- * The master page are put in an unordered set.
- */
- ObjectSet aMasterPageTargetSet;
- for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
+ else
{
- uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( mSelectedPages[i], uno::UNO_QUERY );
- if( xMasterPageTarget.is() )
+ /*
+ * We get all master page that are targeted by at least one draw page.
+ * The master page are put in an unordered set.
+ */
+ ObjectSet aMasterPageTargetSet;
+ for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
+ {
+ uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( mSelectedPages[i], uno::UNO_QUERY );
+ if( xMasterPageTarget.is() )
+ {
+ aMasterPageTargetSet.insert( xMasterPageTarget->getMasterPage() );
+ }
+ }
+ // Later we move them to a uno::Sequence so we can get them by index
+ mMasterPageTargets.realloc( aMasterPageTargetSet.size() );
+ ObjectSet::const_iterator aElem = aMasterPageTargetSet.begin();
+ for( sal_Int32 i = 0; aElem != aMasterPageTargetSet.end(); ++aElem, ++i)
{
- aMasterPageTargetSet.insert( xMasterPageTarget->getMasterPage() );
+ uno::Reference< drawing::XDrawPage > xMasterPage( *aElem, uno::UNO_QUERY );
+ mMasterPageTargets[i] = xMasterPage;
}
- }
- // Later we move them to a uno::Sequence so we can get them by index
- mMasterPageTargets.realloc( aMasterPageTargetSet.size() );
- ObjectSet::const_iterator aElem = aMasterPageTargetSet.begin();
- for( sal_Int32 i = 0; aElem != aMasterPageTargetSet.end(); ++aElem, ++i)
- {
- uno::Reference< drawing::XDrawPage > xMasterPage( *aElem, uno::UNO_QUERY );
- mMasterPageTargets[i] = xMasterPage;
- }
- bRet = implExport( rDescriptor );
+ bRet = implExport( rDescriptor );
}
}
#endif
More information about the Libreoffice-commits
mailing list