diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-05 15:56:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-05 15:57:31 +0100 |
commit | a96e7428b74504cf9ca9e02b21a5647a3aa55e56 (patch) | |
tree | f41f847765084220e650657859607ff311c3ee8a /writerfilter | |
parent | Related: fdo#47347 m_aFontEncodings is a map so returns 0 on unknown fontindex (diff) | |
download | core-a96e7428b74504cf9ca9e02b21a5647a3aa55e56.tar.gz core-a96e7428b74504cf9ca9e02b21a5647a3aa55e56.zip |
Resolves: fdo#47347 overwrite incorrect font table entry with the correct one
Change-Id: I563cf50b6eb029276115b9b02951d36b1ec0d39c
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index da167874af32..fa59904ec44e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -885,7 +885,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: |