[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sw/source

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 13 10:59:45 UTC 2019


 sw/source/filter/ww8/docxsdrexport.cxx |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 0bebe41b5387ee28519cb2f1f62b68a23b2abd9b
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Aug 13 10:29:40 2019 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Aug 13 12:59:09 2019 +0200

    bccu#4204: Writer: Saving this damaged file as DOCX crashes
    
    Change-Id: I526864d6a425220d342bcf0b5a195f420cbf1563
    Reviewed-on: https://gerrit.libreoffice.org/77381
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

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;


More information about the Libreoffice-commits mailing list