diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-07-27 12:19:49 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-07-29 17:32:40 +0200 |
commit | 301a29e34dea3749bc6da5cfe046e6dc0398603b (patch) | |
tree | d7e2680ea9daea1e570d2d401ace29bb35c89002 /writerfilter | |
parent | 830a675b5459fd8061e560792e50507573bb17da (diff) |
Alter font/style tables earlier
Now that those tables belong to the document, no need to delay the
addition of entries.
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index ab6d274f0..2ffdcab64 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2289,9 +2289,6 @@ int RTFDocumentImpl::popState() { //OSL_TRACE("%s before pop: m_nGroup %d, dest state: %d", OSL_THIS_FUNC, m_nGroup, m_aStates.top().nDestinationState); - RTFReferenceTable::Entry_t aEntry; - bool bFontEntryEnd = false; - bool bStyleEntryEnd = false; RTFSprms_t aSprms; RTFSprms_t aAttributes; bool bListEntryEnd = false; @@ -2326,24 +2323,20 @@ int RTFDocumentImpl::popState() RTFValue::Pointer_t pValue(new RTFValue(m_aDestinationText.makeStringAndClear())); m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_XSZFFN, pValue)); - bFontEntryEnd = true; writerfilter::Reference<Properties>::Pointer_t const pProp( new RTFReferenceProperties(m_aStates.top().aTableAttributes, m_aStates.top().aTableSprms) ); - aEntry.first = m_nCurrentFontIndex; - aEntry.second = pProp; + m_aFontTableEntries.insert(make_pair(m_nCurrentFontIndex, pProp)); } else if (m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY) { RTFValue::Pointer_t pValue(new RTFValue(m_aDestinationText.makeStringAndClear())); m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_XSTZNAME1, pValue)); - bStyleEntryEnd = true; writerfilter::Reference<Properties>::Pointer_t const pProp( new RTFReferenceProperties(mergeAttributes(), mergeSprms()) ); - aEntry.first = m_nCurrentStyleIndex; - aEntry.second = pProp; + m_aStyleTableEntries.insert(make_pair(m_nCurrentStyleIndex, pProp)); } else if (m_aStates.top().nDestinationState == DESTINATION_LISTENTRY) { @@ -2646,12 +2639,8 @@ int RTFDocumentImpl::popState() m_nGroup--; - if (bFontEntryEnd) - m_aFontTableEntries.insert(make_pair(aEntry.first, aEntry.second)); - else if (bStyleEntryEnd) - m_aStyleTableEntries.insert(make_pair(aEntry.first, aEntry.second)); // list table - else if (bListEntryEnd) + if (bListEntryEnd) { RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); m_aListTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Numbering_abstractNum, pValue)); |