From da006fbe2d4c5891933390d72f6e6026b28d39fc Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 18 Aug 2021 16:48:43 +0200 Subject: 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 --- xmloff/source/text/XMLTextFrameContext.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xmloff') 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(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 = GetShape(); + if (xShape.is() && m_pHyperlink) + { + Reference xProps(xShape, UNO_QUERY); + if (xProps.is()) + xProps->setPropertyValue("Hyperlink", Any(m_pHyperlink->GetHRef())); + } + if( !pImpl ) return; -- cgit