[Libreoffice-commits] core.git: filter/source
Moritz Kuett
moritz.kuett at web.de
Sun Mar 24 17:02:55 PDT 2013
filter/source/svg/svgexport.cxx | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
New commits:
commit c724ad3de3c053cd482cd107a4ade4065980acb9
Author: Moritz Kuett <moritz.kuett at web.de>
Date: Sat Mar 23 23:30:34 2013 +0100
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 at suse.com>
Tested-by: Thorsten Behrens <tbehrens at suse.com>
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index fdf12a7..4b952c4 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 );
+ }
}
}
More information about the Libreoffice-commits
mailing list