summaryrefslogtreecommitdiff
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-08-17 16:49:21 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-08-18 11:42:54 +0200
commit7bd26828933a682b7bca86e4fb26f4cf99fa33e0 (patch)
treee13d853a5f6a30f48517a07896bd826fb967136c /xmloff/source/text
parent392f19c957b55de1ce834cb465f51f27c2c7cf60 (diff)
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.mehrbrodt@allotropia.de>
Diffstat (limited to 'xmloff/source/text')
-rw-r--r--xmloff/source/text/XMLTextFrameHyperlinkContext.cxx36
1 files changed, 21 insertions, 15 deletions
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)