summaryrefslogtreecommitdiff
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:59:09 +0200
commit0bebe41b5387ee28519cb2f1f62b68a23b2abd9b (patch)
tree73bea5ff6110ab6623da501f26263a2f4dcd20c9
parentfd09ed3d7424a1cb579758769efe465d272ae77d (diff)
bccu#4204: Writer: Saving this damaged file as DOCX crashescoas-0.3.0
Change-Id: I526864d6a425220d342bcf0b5a195f420cbf1563 Reviewed-on: https://gerrit.libreoffice.org/77381 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-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 459811f0a56b..782e8e4b0760 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1596,14 +1596,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 explicitely
- 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;