summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-08-18 16:48:43 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-08-19 07:27:36 +0200
commitda006fbe2d4c5891933390d72f6e6026b28d39fc (patch)
tree1c60471fbf8628270c9d84e3e63edd90ab696f30 /xmloff
parent420e834007ca654db9803030726edb32c3ba5710 (diff)
tdf#143736 Fix loading hyperlink from textbox
Change-Id: I56f5aec153d9544a6c345e0cbb5857cf5d0074b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120673 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index a4f8cb636ca1..fbe537dd424b 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1375,6 +1375,17 @@ void XMLTextFrameContext::endFastElement(sal_Int32 )
(pMultiContext.is()) ? pMultiContext.get() : m_xImplContext.get();
XMLTextFrameContext_Impl *pImpl = const_cast<XMLTextFrameContext_Impl*>(dynamic_cast< const XMLTextFrameContext_Impl*>( pContext ));
assert(!pMultiContext.is() || pImpl);
+
+ // When we are dealing with a textbox, pImpl will be null;
+ // we need to set the hyperlink to the shape instead
+ Reference<XShape> xShape = GetShape();
+ if (xShape.is() && m_pHyperlink)
+ {
+ Reference<XPropertySet> xProps(xShape, UNO_QUERY);
+ if (xProps.is())
+ xProps->setPropertyValue("Hyperlink", Any(m_pHyperlink->GetHRef()));
+ }
+
if( !pImpl )
return;