writerfilter/source/rtftok/rtfdocumentimpl.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 6e167436b5d06a91ccdfa70c5fcc0f09a3db7b7b
Author: Caolán McNamara <[email protected]>
Date:   Tue May 10 09:34:58 2016 +0100

    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 <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 4576ed1..2e1e350 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);
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to