diff options
author | Moritz Kuett <moritz.kuett@web.de> | 2013-03-23 23:30:34 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2013-03-25 00:02:35 +0000 |
commit | c724ad3de3c053cd482cd107a4ade4065980acb9 (patch) | |
tree | 0cfd8135cb8daeae6b9320b167814d2acb65b7e9 /filter | |
parent | 88042d437df72c9c36a39ca668c2f8f459a0d04a (diff) |
fdo#47576: Hyperlinks work for SVG Exports
For different objects (images, shapes...) hyperlinks are exported by Draw/Impress.
An <a> Tag is wrapped around the object, if the object has a Property "Bookmark" which is not empty.
Change-Id: I3e034effe6c4a5025c27bd6408fd162bf5cf4859
Reviewed-on: https://gerrit.libreoffice.org/2957
Reviewed-by: Thorsten Behrens <tbehrens@suse.com>
Tested-by: Thorsten Behrens <tbehrens@suse.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/svg/svgexport.cxx | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index fdf12a736dae..4b952c48c6b4 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1785,12 +1785,32 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) } { + OUString aBookmark; + Reference<XPropertySetInfo> xShapePropSetInfo = xShapePropSet->getPropertySetInfo(); + if(xShapePropSetInfo->hasPropertyByName("Bookmark")) + { + xShapePropSet->getPropertyValue( "Bookmark" ) >>= aBookmark; + } + SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); - mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf, - 0xffffffff, - pElementId, - &rxShape, - pEmbeddedBitmapsMtf ); + if( !aBookmark.isEmpty() ) + { + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xlink:href", aBookmark); + SvXMLElementExport alinkA( *mpSVGExport, XML_NAMESPACE_NONE, "a", sal_True, sal_True ); + mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf, + 0xffffffff, + pElementId, + &rxShape, + pEmbeddedBitmapsMtf ); + } + else + { + mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf, + 0xffffffff, + pElementId, + &rxShape, + pEmbeddedBitmapsMtf ); + } } } |