[Libreoffice-commits] .: sw/source

Lubos Lunak llunak at kemper.freedesktop.org
Thu Aug 11 08:20:58 PDT 2011


 sw/source/filter/ww8/docxattributeoutput.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit a48d2d28ed69a076ac5705c62165c6bf8049e813
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Thu Aug 11 17:16:30 2011 +0200

    avoid crash when writting comments

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index da091ee..c66bb9d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3333,7 +3333,11 @@ void DocxAttributeOutput::WritePostitFields()
         m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, XML_id ), idstr.getStr(),
             FSNS( XML_w, XML_author ), rtl::OUStringToOString( f->GetPar1(), RTL_TEXTENCODING_UTF8 ).getStr(),
             FSNS( XML_w, XML_date ), impl_DateTimeToOString(f->GetDateTime()).getStr(), FSEND );
-        GetExport().WriteOutliner( *f->GetTextObject(), TXT_ATN );
+        // Check for the text object existing, it seems that it can be NULL when saving a newly created
+        // comment without giving focus back to the main document. As GetTxt() is empty in that case as well,
+        // that is probably a bug in the Writer core.
+        if( f->GetTextObject() != NULL )
+            GetExport().WriteOutliner( *f->GetTextObject(), TXT_ATN );
         m_pSerializer->endElementNS( XML_w, XML_comment );
     }
 }


More information about the Libreoffice-commits mailing list