summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-08-11 17:16:30 +0200
committerLuboš Luňák <l.lunak@suse.cz>2011-08-11 17:20:49 +0200
commita48d2d28ed69a076ac5705c62165c6bf8049e813 (patch)
treec28a0d0b8b2fb0827c2e397f003d22de73fed00a /sw
parentf511fee19b9147253dc1c0873018429f3c0a1c91 (diff)
avoid crash when writting comments
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index da091ee7ed7d..c66bb9df749b 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 );
}
}