summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRegényi Balázs <regenyi.balazs@nisz.hu>2020-12-21 09:35:47 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-12-21 21:58:39 +0100
commitb5a02acda8396c108e21e72fc830cc41a0bc890c (patch)
tree0dbabe012e978a4f9c21ffeb2a938b20ee9a00cb
parentb7af960c023bd8b5f1e0d53efa8b4802f77cc3c4 (diff)
tdf#138986 Fix DOC export of LinkDisplayName
The LinkedDisplayName could be empty what caused an assert. tdf#138986 regression from commit: bda05ba17362222b74727872579b65b3fa14e3d8 (tdf#41466 DOCX import: fix VML v:shape/v:textbox) Change-Id: I166a7e4c1defc201d0563a961b28ecb6c6be500c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108077 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f80dcee922428fa564b4779b1f81ad087db937ae) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108008
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index fc75ac5ff02a..77cdab41e879 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -149,6 +149,22 @@ static ww::eField lcl_getFieldId(const IFieldmark*const pFieldmark)
return ww::eUNKNOWN;
}
+static OUString
+lcl_getLinkChainName(const uno::Reference<beans::XPropertySet>& rPropertySet,
+ const uno::Reference<beans::XPropertySetInfo>& rPropertySetInfo)
+{
+ OUString sLinkChainName;
+ if (rPropertySetInfo->hasPropertyByName("LinkDisplayName"))
+ {
+ rPropertySet->getPropertyValue("LinkDisplayName") >>= sLinkChainName;
+ if (!sLinkChainName.isEmpty())
+ return sLinkChainName;
+ }
+ if (rPropertySetInfo->hasPropertyByName("ChainName"))
+ rPropertySet->getPropertyValue("ChainName") >>= sLinkChainName;
+ return sLinkChainName;
+}
+
MSWordAttrIter::MSWordAttrIter( MSWordExportBase& rExport )
: pOld( rExport.m_pChpIter ), m_rExport( rExport )
{
@@ -637,7 +653,6 @@ bool SwWW8AttrIter::HasFlysAt(sal_Int32 nSwPos) const
FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos)
{
// collection point to first gather info about all of the potentially linked textboxes: to be analyzed later.
- OUString sLinkChainName;
ww8::FrameIter linkedTextboxesIter = maFlyIter;
while ( linkedTextboxesIter != maFlyFrames.end() )
{
@@ -654,10 +669,7 @@ FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos)
{
MSWordExportBase::LinkedTextboxInfo aLinkedTextboxInfo;
- if( xPropertySetInfo->hasPropertyByName("LinkDisplayName") )
- xPropertySet->getPropertyValue("LinkDisplayName") >>= sLinkChainName;
- else if( xPropertySetInfo->hasPropertyByName("ChainName") )
- xPropertySet->getPropertyValue("ChainName") >>= sLinkChainName;
+ const OUString sLinkChainName = lcl_getLinkChainName(xPropertySet, xPropertySetInfo);
if( xPropertySetInfo->hasPropertyByName("ChainNextName") )
xPropertySet->getPropertyValue("ChainNextName") >>= aLinkedTextboxInfo.sNextChain;