diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-10 09:34:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-10 11:17:31 +0000 |
commit | 6e167436b5d06a91ccdfa70c5fcc0f09a3db7b7b (patch) | |
tree | 0cbefaa350ffa4e72950f4a4bca354cb2c292496 | |
parent | a263a497722ddda21b47423dbde0c473020a8c55 (diff) |
rtf: m_aStates can be empty in the inner condition
Change-Id: Id262a3019a693f236630b798579f360c9462d12e
(cherry picked from commit 05cc87ce45fad402445c8d748817e386e56148af)
Reviewed-on: https://gerrit.libreoffice.org/24830
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 4576ed11fab7..2e1e350fde94 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -453,11 +453,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); |