[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/source

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 19 05:32:57 UTC 2019


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

New commits:
commit c50033a000d85f967bd5300dea0f9fec3411e501
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Aug 13 14:27:05 2019 +0200
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Mon Aug 19 07:32:15 2019 +0200

    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 at collabora.com>
    (cherry picked from commit de8415ff5a730465258cd5f0ab7c0d989ba5518d)
    Reviewed-on: https://gerrit.libreoffice.org/77444
    Reviewed-by: Xisco Faulí <xiscofauli at 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 at libreoffice.org>

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;


More information about the Libreoffice-commits mailing list