xmloff/source/draw/shapeexport.cxx | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-)
New commits: commit 903f7dd825caca1af15d985658043ec055c4eb45 Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Thu Jul 15 11:50:57 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Jul 19 12:55:41 2021 +0200 Make obvious that this is in a try/catch block Change-Id: I1118ef026730481eeef127b570bfd59de4434455 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119163 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index d9d4116a2c55..105281b46d0c 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -583,29 +583,32 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape // export hyperlinks with <a><shape/></a>. Currently only in draw since draw // does not support document events - if( xSet.is() && (GetExport().GetModelType() == SvtModuleOptions::EFactory::DRAW) ) try + if( xSet.is() && (GetExport().GetModelType() == SvtModuleOptions::EFactory::DRAW) ) { - presentation::ClickAction eAction = presentation::ClickAction_NONE; - xSet->getPropertyValue("OnClick") >>= eAction; - - if( (eAction == presentation::ClickAction_DOCUMENT) || - (eAction == presentation::ClickAction_BOOKMARK) ) + try { - OUString sURL; - xSet->getPropertyValue(gsBookmark) >>= sURL; + presentation::ClickAction eAction = presentation::ClickAction_NONE; + xSet->getPropertyValue("OnClick") >>= eAction; - if( !sURL.isEmpty() ) + if( (eAction == presentation::ClickAction_DOCUMENT) || + (eAction == presentation::ClickAction_BOOKMARK) ) { - mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sURL ); - mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); - mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); - pHyperlinkElement.reset( new SvXMLElementExport(mrExport, XML_NAMESPACE_DRAW, XML_A, true, true) ); + OUString sURL; + xSet->getPropertyValue(gsBookmark) >>= sURL; + + if( !sURL.isEmpty() ) + { + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sURL ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); + pHyperlinkElement.reset( new SvXMLElementExport(mrExport, XML_NAMESPACE_DRAW, XML_A, true, true) ); + } } } - } - catch(const uno::Exception&) - { - TOOLS_WARN_EXCEPTION("xmloff", "XMLShapeExport::exportShape(): exception during hyperlink export"); + catch(const uno::Exception&) + { + TOOLS_WARN_EXCEPTION("xmloff", "XMLShapeExport::exportShape(): exception during hyperlink export"); + } } if( xSet.is() ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits