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

New commits:
commit 05cc87ce45fad402445c8d748817e386e56148af
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue May 10 09:34:58 2016 +0100

    rtf: m_aStates can be empty in the inner condition
    
    Change-Id: Id262a3019a693f236630b798579f360c9462d12e

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 33d46ec..527195f 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);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to