summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-08-13 10:29:40 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-08-13 12:58:19 +0200
commit026d2fb2b79837ee8d31efd90cbe3b735445f956 (patch)
treee314022aa476b199a5d8f5f9bbc05fd61aa43f28 /sw
parent4c3894604b547786384175c2b2f7a22446da508f (diff)
bccu#4204: Writer: Saving this damaged file as DOCX crashes
Change-Id: I526864d6a425220d342bcf0b5a195f420cbf1563 Reviewed-on: https://gerrit.libreoffice.org/77382 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 69c0e5f3e578..6ff1bdb54b8c 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1365,14 +1365,17 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho
// We need to init padding to 0, if it's not set.
// In LO the default is 0 and so ins attributes are not set when padding is 0
// but in MSO the default is 254 / 127, so we need to set 0 padding explicitly
- if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_lIns))
- m_pImpl->m_pBodyPrAttrList->add(XML_lIns, OString::number(0));
- if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_tIns))
- m_pImpl->m_pBodyPrAttrList->add(XML_tIns, OString::number(0));
- if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_rIns))
- m_pImpl->m_pBodyPrAttrList->add(XML_rIns, OString::number(0));
- if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_bIns))
- m_pImpl->m_pBodyPrAttrList->add(XML_bIns, OString::number(0));
+ if(m_pImpl->m_pBodyPrAttrList)
+ {
+ if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_lIns))
+ m_pImpl->m_pBodyPrAttrList->add(XML_lIns, OString::number(0));
+ if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_tIns))
+ m_pImpl->m_pBodyPrAttrList->add(XML_tIns, OString::number(0));
+ if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_rIns))
+ m_pImpl->m_pBodyPrAttrList->add(XML_rIns, OString::number(0));
+ if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_bIns))
+ m_pImpl->m_pBodyPrAttrList->add(XML_bIns, OString::number(0));
+ }
sax_fastparser::XFastAttributeListRef xBodyPrAttrList(m_pImpl->m_pBodyPrAttrList);
m_pImpl->m_pBodyPrAttrList = nullptr;