summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-18 16:04:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-18 16:15:29 +0200
commit6118ea49aee18a95ac124bbac695b3bb1b152c1d (patch)
tree4d799a2a09b5ea99d48a5abeea3207d103cdec8b
parente556657e36f407770e7cb5e1b3e9b76a1eaa85b3 (diff)
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
-rw-r--r--writerfilter/qa/cppunittests/rtftok/data/pass/i74153.rtf8
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
2 files changed, 15 insertions, 2 deletions
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<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(RTFSprms(), aTCSprms));
- Mapper().props(pProperties);
+ if (!m_aStates.top().pCurrentBuffer)
+ {
+ writerfilter::Reference<Properties>::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.