writerfilter/source/rtftok/rtfdocumentimpl.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 4112bb446659d7b60b17202e3f1e40ad1ea3d6a6
Author: Caolán McNamara <[email protected]>
Date:   Sat May 5 15:56:03 2012 +0100

    Resolves: fdo#47347 overwrite incorrect font table entry with the correct 
one
    
    Change-Id: I563cf50b6eb029276115b9b02951d36b1ec0d39c
    (cherry picked from commit a96e7428b74504cf9ca9e02b21a5647a3aa55e56)
    
    Signed-off-by: Miklos Vajna <[email protected]>

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 23df13f..d65b642 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -919,7 +919,15 @@ void RTFDocumentImpl::text(OUString& rString)
                                 writerfilter::Reference<Properties>::Pointer_t 
const pProp(
                                         new 
RTFReferenceProperties(m_aStates.top().aTableAttributes, 
m_aStates.top().aTableSprms)
                                         );
-                                
m_aFontTableEntries.insert(make_pair(m_nCurrentFontIndex, pProp));
+
+                                //See fdo#47347 initial invalid font entry 
properties are inserted first,
+                                //so when we attempt to insert the correct 
ones, there's already an
+                                //entry in the map for them, so the new ones 
aren't inserted.
+                                RTFReferenceTable::Entries_t::iterator lb = 
m_aFontTableEntries.lower_bound(m_nCurrentFontIndex);
+                                if (lb != m_aFontTableEntries.end() && 
!(m_aFontTableEntries.key_comp()(m_nCurrentFontIndex, lb->first)))
+                                    lb->second = pProp;
+                                else
+                                    m_aFontTableEntries.insert(lb, 
make_pair(m_nCurrentFontIndex, pProp));
                             }
                             break;
                         case DESTINATION_STYLESHEET:
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to