summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-10 09:34:58 +0100
committerAndras Timar <andras.timar@collabora.com>2016-06-29 11:04:40 +0200
commita4a43adb0ced8f20b85e47e7dd69e111bd21efe1 (patch)
tree9bf5d34317f2e5433ad18edd0508d67400f4950f
parentd9294de84cbcba383cc4f585d510f72a53bafefb (diff)
rtf: m_aStates can be empty in the inner condition
Change-Id: Id262a3019a693f236630b798579f360c9462d12e (cherry picked from commit 05cc87ce45fad402445c8d748817e386e56148af)
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5cdc8e9690dc..cc1cdfba7a75 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -455,11 +455,15 @@ writerfilter::Reference<Properties>::Pointer_t RTFDocumentImpl::getProperties(RT
// cloneAndDeduplicate() wants to know about only a single "style", so
// let's merge paragraph and character style properties here.
- int nCharStyle = m_aStates.top().nCurrentCharacterStyleIndex;
- RTFReferenceTable::Entries_t::iterator itChar = m_aStyleTableEntries.find(nCharStyle);
+ RTFReferenceTable::Entries_t::iterator itChar = m_aStyleTableEntries.end();
+ if (!m_aStates.empty())
+ {
+ int nCharStyle = m_aStates.top().nCurrentCharacterStyleIndex;
+ itChar = m_aStyleTableEntries.find(nCharStyle);
+ }
+
RTFSprms aStyleSprms;
RTFSprms aStyleAttributes;
-
// Ensure the paragraph style is a flat list.
lcl_copyFlatten(rProps, aStyleAttributes, aStyleSprms);