diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-26 01:17:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-26 01:18:28 +0200 |
commit | 805aa2151e476a5e8e60806c7321ba7288f91813 (patch) | |
tree | b48d05a9c80e8d99bf135a92c8e9a38f0d69ce63 | |
parent | f78a6ae8020ae8de3881ce16ba787a5578e9f0e4 (diff) |
Related: fdo#39337 It turns out dmapper ignores the position of an entry
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 11 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 0fef1e893bf0..658a3d28b7fc 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -266,6 +266,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x m_aDefaultState(), m_bSkipUnknown(false), m_aFontEncodings(), + m_aFontIndexes(), m_aColorTable(), m_bFirstRun(true), m_bFirstRow(true), @@ -1988,10 +1989,14 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) { case RTF_F: if (m_aStates.top().nDestinationState == DESTINATION_FONTTABLE || m_aStates.top().nDestinationState == DESTINATION_FONTENTRY) - m_nCurrentFontIndex = nParam; + { + m_aFontIndexes.push_back(nParam); + m_nCurrentFontIndex = std::find(m_aFontIndexes.begin(), m_aFontIndexes.end(), nParam) - m_aFontIndexes.begin(); + } else { - m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CRgFtc0, pIntValue)); + RTFValue::Pointer_t pValue(new RTFValue(std::find(m_aFontIndexes.begin(), m_aFontIndexes.end(), nParam) - m_aFontIndexes.begin())); + m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CRgFtc0, pValue)); m_aStates.top().nCurrentEncoding = getEncodingTable(nParam); } break; @@ -2422,7 +2427,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) OUString aName; switch (nKeyword) { - case RTF_NOFPAGES: aName = OUString(RTL_CONSTASCII_USTRINGPARAM("PageCount")); break; + case RTF_NOFPAGES: aName = OUString(RTL_CONSTASCII_USTRINGPARAM("PageCount")); nParam = 99; break; case RTF_NOFWORDS: aName = OUString(RTL_CONSTASCII_USTRINGPARAM("WordCount")); break; case RTF_NOFCHARS: aName = OUString(RTL_CONSTASCII_USTRINGPARAM("CharacterCount")); break; case RTF_NOFCHARSWS: aName = OUString(RTL_CONSTASCII_USTRINGPARAM("NonWhitespaceCharacterCount")); break; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index aee3f79d6717..d5a65ef2629e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -362,6 +362,8 @@ namespace writerfilter { bool m_bSkipUnknown; /// Font index <-> encoding map, *not* part of the parser state std::map<int, rtl_TextEncoding> m_aFontEncodings; + /// Maps the non-continious font indexes to the continous dmapper indexes. + std::vector<int> m_aFontIndexes; /// Color index <-> RGB color value map std::vector<sal_uInt32> m_aColorTable; bool m_bFirstRun; |