xmloff/source/text/XMLTextFrameHyperlinkContext.cxx |   36 +++++++++++---------
 1 file changed, 21 insertions(+), 15 deletions(-)

New commits:
commit 7bd26828933a682b7bca86e4fb26f4cf99fa33e0
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Tue Aug 17 16:49:21 2021 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Wed Aug 18 11:42:54 2021 +0200

    tdf#143736 Fix loading hyperlink from various shapes
    
    Change-Id: I86de90ee605fab8f11e7c01892fbbff6acf790a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120609
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx 
b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
index f3bf9c66665e..7a1146ac8125 100644
--- a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
+++ b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
@@ -101,22 +101,28 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLTextFrameHyperlinkC
     SvXMLImportContext *pContext = nullptr;
     XMLTextFrameContext *pTextFrameContext = nullptr;
 
-    if( nElement == XML_ELEMENT(DRAW, XML_FRAME) )
+    switch (nElement)
     {
-        pTextFrameContext = new XMLTextFrameContext( GetImport(),
-                                                xAttrList,
-                                                eDefaultAnchorType );
-        pTextFrameContext->SetHyperlink( sHRef, sName, sTargetFrameName, bMap 
);
-        pContext = pTextFrameContext;
-        xFrameContext = pContext;
-    }
-    if (nElement == XML_ELEMENT(DRAW, XML_CUSTOM_SHAPE))
-    {
-        Reference<XShapes> xShapes;
-        SvXMLShapeContext* pShapeContext
-            = XMLShapeImportHelper::CreateGroupChildContext(GetImport(), 
nElement, xAttrList, xShapes);
-        pShapeContext->setHyperlink(sHRef);
-        pContext = pShapeContext;
+        case XML_ELEMENT(DRAW, XML_FRAME):
+        {
+            pTextFrameContext = new XMLTextFrameContext(GetImport(), 
xAttrList, eDefaultAnchorType);
+            pTextFrameContext->SetHyperlink(sHRef, sName, sTargetFrameName, 
bMap);
+            pContext = pTextFrameContext;
+            xFrameContext = pContext;
+        }
+        break;
+        case XML_ELEMENT(DRAW, XML_CUSTOM_SHAPE):
+        case XML_ELEMENT(DRAW, XML_PATH):
+        case XML_ELEMENT(DRAW, XML_ELLIPSE):
+        case XML_ELEMENT(DRAW, XML_LINE):
+        {
+            Reference<XShapes> xShapes;
+            SvXMLShapeContext* pShapeContext = 
XMLShapeImportHelper::CreateGroupChildContext(
+                GetImport(), nElement, xAttrList, xShapes);
+            pShapeContext->setHyperlink(sHRef);
+            pContext = pShapeContext;
+        }
+        break;
     }
 
     if (!pContext)

Reply via email to