From 6118ea49aee18a95ac124bbac695b3bb1b152c1d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sat, 18 Oct 2014 16:04:49 +0200 Subject: i#74153 RTF import: fix track changes vs superscript char prop Since 9dbf817fe5c5253fba0831aefa17575ae0ba3af1 (handle scope of w:pPrChange and w:rPrChange properly (bnc#821804), 2014-10-01), this caused an assertion failure -> crash. Change-Id: I680edf58854d0c9be6e77c44c1e6beb1e0442a49 --- writerfilter/qa/cppunittests/rtftok/data/pass/i74153.rtf | 8 ++++++++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 writerfilter/qa/cppunittests/rtftok/data/pass/i74153.rtf (limited to 'writerfilter') diff --git a/writerfilter/qa/cppunittests/rtftok/data/pass/i74153.rtf b/writerfilter/qa/cppunittests/rtftok/data/pass/i74153.rtf new file mode 100644 index 000000000000..7e81865adb5f --- /dev/null +++ b/writerfilter/qa/cppunittests/rtftok/data/pass/i74153.rtf @@ -0,0 +1,8 @@ +{\rtf1 +{\*\revtbl +{Unknown;} +{TAMUS HSC Mac User;} +} +{\revised\super\revauth1\revdttm-1501115711 hello} +\par +} diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index c7a54721baf0..70dae1f6075e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -5671,8 +5671,13 @@ int RTFDocumentImpl::popState() RTFSprms aTCSprms; RTFValue::Pointer_t pValue(new RTFValue(0)); aTCSprms.set(NS_ooxml::LN_endtrackchange, pValue); - writerfilter::Reference::Pointer_t const pProperties(new RTFReferenceProperties(RTFSprms(), aTCSprms)); - Mapper().props(pProperties); + if (!m_aStates.top().pCurrentBuffer) + { + writerfilter::Reference::Pointer_t const pProperties(new RTFReferenceProperties(RTFSprms(), aTCSprms)); + Mapper().props(pProperties); + } + else + m_aStates.top().pCurrentBuffer->push_back(Buf_t(BUFFER_PROPS, RTFValue::Pointer_t(new RTFValue(RTFSprms(), aTCSprms)))); } // This is the end of the doc, see if we need to close the last section. -- cgit