summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2011-08-26 17:57:29 +0200
committerThorsten Behrens <tbehrens@novell.com>2011-08-26 18:25:21 +0200
commitdcb783a8546b760f0807a73b52966c8f3d1428d3 (patch)
tree87145597cdb3b6458ba18bb14bd88022b7b4512b
parentee7239396401fff5115058259d686676074e8d22 (diff)
Cleanup, and made svg animation export experimental
Added the PagePos parameter back (to export single slide via API), some whitespace cleanup, and made the ecma script / animation engine only active via the experimental flag.
-rw-r--r--filter/source/svg/svgexport.cxx11
-rw-r--r--filter/source/svg/svgfilter.cxx28
-rw-r--r--filter/source/svg/svgscript.hxx1
3 files changed, 32 insertions, 8 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 0bddfb3e3057..c68f292eb926 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -40,6 +40,7 @@
#include "svgscript.hxx"
#include "impsvgdialog.hxx"
+#include <svtools/miscopt.hxx>
#include <svtools/FilterConfigItem.hxx>
#include <svx/unopage.hxx>
#include <svx/unoshape.hxx>
@@ -743,7 +744,10 @@ sal_Bool SVGFilter::implExportDocument()
sal_Bool bRet = sal_False;
sal_Int32 nLastPage = mSelectedPages.getLength() - 1;
- mbSinglePage = (nLastPage == 0);
+ SvtMiscOptions aMiscOptions;
+ const bool bExperimentalMode = aMiscOptions.IsExperimentalMode();
+
+ mbSinglePage = (nLastPage == 0) || !bExperimentalMode;
mnVisiblePage = -1;
mnVisibleMasterPage = -1;
@@ -837,7 +841,8 @@ sal_Bool SVGFilter::implExportDocument()
if( !mbSinglePage )
{
implGenerateMetaData();
- implExportAnimations();
+ if( bExperimentalMode )
+ implExportAnimations();
}
else
{
@@ -1322,7 +1327,7 @@ sal_Bool SVGFilter::implExportPages( const SVGFilter::XDrawPageSequence & rxPage
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sPageId );
OUString sPageName = implGetInterfaceName( rxPages[i] );
- if( sPageName.getLength() )
+ if( sPageName.getLength() && !mbSinglePage )
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrName, sPageName );
{
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 4baaa80d43cb..236e933f1d3a 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -163,10 +163,22 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
}
/*
- * Export all slides
+ * Export all slides, or requested "PagePos"
*/
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.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PagePos" ) ) )
+ {
+ pValue[ i ].Value >>= nPageToExport;
+ }
+ }
+
uno::Reference< drawing::XMasterPagesSupplier > xMasterPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
@@ -179,12 +191,20 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
{
sal_Int32 nDPCount = xDrawPages->getCount();
- mSelectedPages.realloc( nDPCount );
+ mSelectedPages.realloc( nPageToExport != -1 ? 1 : nDPCount );
sal_Int32 i;
for( i = 0; i < nDPCount; ++i )
{
- uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY );
- mSelectedPages[i] = xDrawPage;
+ if( nPageToExport != -1 && nPageToExport == i )
+ {
+ uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY );
+ mSelectedPages[0] = xDrawPage;
+ }
+ else
+ {
+ uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY );
+ mSelectedPages[i] = xDrawPage;
+ }
}
}
}
diff --git a/filter/source/svg/svgscript.hxx b/filter/source/svg/svgscript.hxx
index 7cbed89c297d..6164489162a6 100644
--- a/filter/source/svg/svgscript.hxx
+++ b/filter/source/svg/svgscript.hxx
@@ -1,4 +1,3 @@
-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*