diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-04 09:38:02 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2019-03-10 01:22:20 +0100 |
commit | 62af6c4f28ef1346170c81557a1845616be33336 (patch) | |
tree | 4b2ee7602d234ea55573d276a26553587bb1992a /filter | |
parent | 214e6ed5286566e689a4ef13a9115e2ad38fff57 (diff) |
Check svg URLs before exporting
Change-Id: I3b86b6b82318b0d201c3d7db516664520eb47bed
Reviewed-on: https://gerrit.libreoffice.org/68668
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit 34ec46571701d639d9bc542b2d19f87a21a83648)
Reviewed-on: https://gerrit.libreoffice.org/68732
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/svg/svgexport.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index bce3e2612b18..bfee60ca26e1 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -45,6 +45,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <i18nlangtag/lang.h> #include <svl/zforlist.hxx> +#include <tools/urlobj.hxx> #include <unotools/ucbstreamhelper.hxx> #include <xmloff/unointerfacetouniqueidentifiermapper.hxx> #include <xmloff/nmspmap.hxx> @@ -1813,13 +1814,18 @@ bool SVGFilter::implExportShape( const Reference< css::drawing::XShape >& rxShap if( !aBookmark.isEmpty() ) { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xlink:href", aBookmark); - SvXMLElementExport alinkA( *mpSVGExport, XML_NAMESPACE_NONE, "a", true, true ); - mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf, - 0xffffffff, - pElementId, - &rxShape, - pEmbeddedBitmapsMtf ); + INetURLObject aINetURLObject(aBookmark); + if (!aINetURLObject.HasError() + && aINetURLObject.GetProtocol() != INetProtocol::Javascript) + { + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xlink:href", aBookmark); + SvXMLElementExport alinkA( *mpSVGExport, XML_NAMESPACE_NONE, "a", true, true ); + mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf, + 0xffffffff, + pElementId, + &rxShape, + pEmbeddedBitmapsMtf ); + } } else { |