Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2957

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/57/2957/1

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
---
M filter/source/svg/svgexport.cxx
1 file changed, 25 insertions(+), 5 deletions(-)



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 @@
                     }
 
                     {
+                        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 );
+                        }
                     }
                 }
 

-- 
To view, visit https://gerrit.libreoffice.org/2957
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e034effe6c4a5025c27bd6408fd162bf5cf4859
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Moritz Kütt <moritz.kuett@web.de>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.