summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-12-14 22:06:35 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-12-15 00:20:21 +0100
commit870d30c62bb5f579dfa4e6fb2e32dd796159f3b3 (patch)
tree73cd5304c6292dbe3074ecbd7d822f3946766402 /filter
parentRelated: tdf#118705 Fix Column/Bar Chart data label placement (diff)
downloadcore-870d30c62bb5f579dfa4e6fb2e32dd796159f3b3.tar.gz
core-870d30c62bb5f579dfa4e6fb2e32dd796159f3b3.zip
lok: Implement SVG export for Calc (SelectionOnly mode)
Change-Id: Ic305e5305890fd1efa3a3130e5216f9c672870e5 Reviewed-on: https://gerrit.libreoffice.org/65175 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/Configuration_filter.mk2
-rw-r--r--filter/source/config/fragments/filters/calc_svg_Export.xcu30
-rw-r--r--filter/source/svg/svgexport.cxx20
-rw-r--r--filter/source/svg/svgfilter.cxx18
-rw-r--r--filter/source/svg/svgfilter.hxx18
5 files changed, 60 insertions, 28 deletions
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
index b56e0ae39bc8..97023325c94e 100644
--- a/filter/Configuration_filter.mk
+++ b/filter/Configuration_filter.mk
@@ -802,11 +802,13 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writergraphics
# fcfg_calcgraphics
$(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calcgraphics_types.xcu,filter/source/config/fragments/types,\
png_Portable_Network_Graphic \
+ svg_Scalable_Vector_Graphics \
))
$(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calcgraphics_filters.xcu,filter/source/config/fragments/filters,\
calc_jpg_Export \
calc_png_Export \
+ calc_svg_Export \
))
# fcfg_internalgraphics
diff --git a/filter/source/config/fragments/filters/calc_svg_Export.xcu b/filter/source/config/fragments/filters/calc_svg_Export.xcu
new file mode 100644
index 000000000000..703ce82e9778
--- /dev/null
+++ b/filter/source/config/fragments/filters/calc_svg_Export.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="calc_svg_Export" oor:op="replace">
+ <prop oor:name="Flags"><value>EXPORT ALIEN 3RDPARTYFILTER INTERNAL NOTINFILEDIALOG</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Draw.SVGFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">SVG - Scalable Vector Graphics</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>svg_Scalable_Vector_Graphics</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.sheet.SpreadsheetDocument</value></prop>
+ </node>
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 729fd2e29c2c..2dd294fba105 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -531,13 +531,13 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
}
}
- if(mbWriterFilter)
- return implExportWriter(xOStm);
+ if(mbWriterOrCalcFilter)
+ return implExportWriterOrCalc(xOStm);
- return implExportImpressDraw(xOStm);
+ return implExportImpressOrDraw(xOStm);
}
-bool SVGFilter::implExportImpressDraw( const Reference< XOutputStream >& rxOStm)
+bool SVGFilter::implExportImpressOrDraw( const Reference< XOutputStream >& rxOStm)
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ) ;
bool bRet = false;
@@ -629,7 +629,7 @@ bool SVGFilter::implExportImpressDraw( const Reference< XOutputStream >& rxOStm)
}
-bool SVGFilter::implExportWriter( const Reference< XOutputStream >& rxOStm )
+bool SVGFilter::implExportWriterOrCalc( const Reference< XOutputStream >& rxOStm )
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ) ;
bool bRet = false;
@@ -773,10 +773,10 @@ bool SVGFilter::implExportDocument()
}
}
- if(mbWriterFilter)
- implExportDocumentHeaderWriter(nDocX, nDocY, nDocWidth, nDocHeight);
+ if(mbWriterOrCalcFilter)
+ implExportDocumentHeaderWriterOrCalc(nDocX, nDocY, nDocWidth, nDocHeight);
else
- implExportDocumentHeaderImpressDraw(nDocX, nDocY, nDocWidth, nDocHeight);
+ implExportDocumentHeaderImpressOrDraw(nDocX, nDocY, nDocWidth, nDocHeight);
if( implLookForFirstVisiblePage() ) // OK! We found at least one visible page.
@@ -835,7 +835,7 @@ bool SVGFilter::implExportDocument()
return bRet;
}
-void SVGFilter::implExportDocumentHeaderImpressDraw(sal_Int32 nDocX, sal_Int32 nDocY,
+void SVGFilter::implExportDocumentHeaderImpressOrDraw(sal_Int32 nDocX, sal_Int32 nDocY,
sal_Int32 nDocWidth, sal_Int32 nDocHeight)
{
const Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
@@ -928,7 +928,7 @@ void SVGFilter::implExportDocumentHeaderImpressDraw(sal_Int32 nDocX, sal_Int32 n
}
}
-void SVGFilter::implExportDocumentHeaderWriter(sal_Int32 nDocX, sal_Int32 nDocY,
+void SVGFilter::implExportDocumentHeaderWriterOrCalc(sal_Int32 nDocX, sal_Int32 nDocY,
sal_Int32 nDocWidth, sal_Int32 nDocHeight)
{
OUString aAttr;
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 539891c8b5ae..3f3b0d2b8e00 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -88,7 +88,7 @@ SVGFilter::SVGFilter( const Reference< XComponentContext >& rxCtx ) :
mbExportShapeSelection(false),
maFilterData(),
mxDefaultPage(),
- mbWriterFilter(false),
+ mbWriterOrCalcFilter(false),
mpDefaultSdrPage( nullptr ),
mpSdrModel( nullptr ),
mbPresentation( false ),
@@ -107,10 +107,10 @@ SVGFilter::~SVGFilter()
sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescriptor )
{
- mbWriterFilter = false;
+ mbWriterOrCalcFilter = false;
if(mxDstDoc.is()) // Import works for Impress / draw only
- return filterImpressDraw(rDescriptor);
+ return filterImpressOrDraw(rDescriptor);
if(mxSrcDoc.is())
{
@@ -120,20 +120,20 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
{
OUString sFilterName;
rDescriptor[nInd].Value >>= sFilterName;
- if(sFilterName == "writer_svg_Export")
+ if(sFilterName != "impress_svg_Export")
{
- mbWriterFilter = true;
- return filterWriter(rDescriptor);
+ mbWriterOrCalcFilter = true;
+ return filterWriterOrCalc(rDescriptor);
}
break;
}
}
- return filterImpressDraw(rDescriptor);
+ return filterImpressOrDraw(rDescriptor);
}
return false;
}
-bool SVGFilter::filterImpressDraw( const Sequence< PropertyValue >& rDescriptor )
+bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescriptor )
{
SolarMutexGuard aGuard;
vcl::Window* pFocusWindow(Application::GetFocusWindow());
@@ -536,7 +536,7 @@ bool SVGFilter::filterImpressDraw( const Sequence< PropertyValue >& rDescriptor
return bRet;
}
-bool SVGFilter::filterWriter( const Sequence< PropertyValue >& rDescriptor )
+bool SVGFilter::filterWriterOrCalc( const Sequence< PropertyValue >& rDescriptor )
{
bool bSelectionOnly = false;
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 5a70c3c63679..baaea0519537 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -211,7 +211,7 @@ private:
Reference< css::drawing::XDrawPage > mxDefaultPage;
std::vector< Reference< css::drawing::XDrawPage > > mSelectedPages;
- bool mbWriterFilter;
+ bool mbWriterOrCalcFilter;
/// Impress / draw only members
@@ -233,8 +233,8 @@ private:
/// @throws css::uno::RuntimeException
bool implExport( const Sequence< PropertyValue >& rDescriptor );
- bool implExportImpressDraw( const Reference< XOutputStream >& rxOStm );
- bool implExportWriter( const Reference< XOutputStream >& rxOStm );
+ bool implExportImpressOrDraw( const Reference< XOutputStream >& rxOStm );
+ bool implExportWriterOrCalc( const Reference< XOutputStream >& rxOStm );
static Reference< XWriter > implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm );
void implGetPagePropSet( const Reference< css::drawing::XDrawPage > & rxPage );
@@ -246,10 +246,10 @@ private:
void implGenerateScript();
bool implExportDocument();
- void implExportDocumentHeaderImpressDraw(sal_Int32 nDocX, sal_Int32 nDocY,
- sal_Int32 nDocWidth, sal_Int32 nDocHeight);
- void implExportDocumentHeaderWriter(sal_Int32 nDocX, sal_Int32 nDocY,
- sal_Int32 nDocWidth, sal_Int32 nDocHeight);
+ void implExportDocumentHeaderImpressOrDraw(sal_Int32 nDocX, sal_Int32 nDocY,
+ sal_Int32 nDocWidth, sal_Int32 nDocHeight);
+ void implExportDocumentHeaderWriterOrCalc(sal_Int32 nDocX, sal_Int32 nDocY,
+ sal_Int32 nDocWidth, sal_Int32 nDocHeight);
void implExportAnimations();
bool implExportMasterPages( const std::vector< Reference< css::drawing::XDrawPage > >& rxPages,
@@ -281,8 +281,8 @@ private:
const Reference< XPropertySetInfo > & rxPropSetInfo );
DECL_LINK( CalcFieldHdl, EditFieldInfo*, void );
- bool filterImpressDraw( const Sequence< PropertyValue >& rDescriptor );
- bool filterWriter( const Sequence< PropertyValue >& rDescriptor );
+ bool filterImpressOrDraw( const Sequence< PropertyValue >& rDescriptor );
+ bool filterWriterOrCalc( const Sequence< PropertyValue >& rDescriptor );
protected: