diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-08-13 14:27:05 +0200 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2019-08-19 07:32:15 +0200 |
commit | c50033a000d85f967bd5300dea0f9fec3411e501 (patch) | |
tree | 24bfa22b327c81351e6f9bd8604f77082afa3af3 | |
parent | 5445f7ffd09e891b220dabb19cd013bcf591fc08 (diff) |
Writer: Saving a damaged file as DOCX crashes
Reviewed-on: https://gerrit.libreoffice.org/77412
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit de8415ff5a730465258cd5f0ab7c0d989ba5518d)
Reviewed-on: https://gerrit.libreoffice.org/77444
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
(cherry picked from commit 0f7eb072fdc2d5b4ee1690597dafc475a611f007)
Change-Id: I42de376c69d0b1caa0a03622506d1bf6385ca57e
Reviewed-on: https://gerrit.libreoffice.org/77670
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 50a1500c31b9..45c1d35f579b 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1371,14 +1371,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; |