summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-08-18 16:48:43 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-08-23 00:51:29 +0200
commitff045b937c9f8a4786bb3e82cdcffa6588aa3a8f (patch)
treeaf7b3ce377fb3b3bbb6a5a6c68ec0a414797a3cf /xmloff
parent13449131ba1b041875e4d84af008196aacf574e0 (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> (cherry picked from commit da006fbe2d4c5891933390d72f6e6026b28d39fc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120697 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 7f0ce41a1d74..f5f3cfac29cd 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1401,6 +1401,7 @@ void XMLTextFrameContext::EndElement()
(pMultiContext.is()) ? pMultiContext.get() : m_xImplContext.get();
XMLTextFrameContext_Impl *pImpl = const_cast<XMLTextFrameContext_Impl*>(dynamic_cast< const XMLTextFrameContext_Impl*>( pContext ));
assert(!pMultiContext.is() || pImpl);
+
if( pImpl )
{
pImpl->CreateIfNotThere();
@@ -1431,6 +1432,18 @@ void XMLTextFrameContext::EndElement()
GetImport().GetTextImport()->StoreLastImportedFrameName(pImpl->GetOrigName());
}
+ else
+ {
+ // 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()));
+ }
+ }
}
SvXMLImportContextRef XMLTextFrameContext::CreateChildContext(