summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfdocumentimpl.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-10 09:34:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-10 09:35:24 +0100
commit05cc87ce45fad402445c8d748817e386e56148af (patch)
tree43ea154e26ef1200ebab80e508633d46cffb7762 /writerfilter/source/rtftok/rtfdocumentimpl.cxx
parent1f7a31a461bb3a6fcd277ab57875405875568f8b (diff)
rtf: m_aStates can be empty in the inner condition
Change-Id: Id262a3019a693f236630b798579f360c9462d12e
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-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 33d46ece5c09..527195f38bbe 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -456,11 +456,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);