diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-04-11 14:42:45 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-04-11 14:42:45 +0200 |
commit | 50d1fe49e22f1a04fa3f32e70e5a58fe56dd7e9f (patch) | |
tree | 82782cee85ef861256cd4555f7a52583b525c6ff /src/lib/CDRStylesCollector.cpp | |
parent | 188956efa91e06b2196c2444ab4936b39405a33b (diff) |
Refactor the character descriptions a bit
Diffstat (limited to 'src/lib/CDRStylesCollector.cpp')
-rw-r--r-- | src/lib/CDRStylesCollector.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/CDRStylesCollector.cpp b/src/lib/CDRStylesCollector.cpp index 8c05227..7365ebb 100644 --- a/src/lib/CDRStylesCollector.cpp +++ b/src/lib/CDRStylesCollector.cpp @@ -252,12 +252,12 @@ void libcdr::CDRStylesCollector::collectFont(unsigned fontId, unsigned short enc } void libcdr::CDRStylesCollector::collectText(unsigned textId, unsigned styleId, const std::vector<unsigned char> &data, - const std::vector<uint64_t> &charDescriptions, const std::map<unsigned, CDRCharacterStyle> &styleOverrides) + const std::vector<unsigned char> &charDescriptions, const std::map<unsigned, CDRCharacterStyle> &styleOverrides) { if (data.empty() || charDescriptions.empty()) return; - uint32_t tmpCharDescription = 0; + unsigned char tmpCharDescription = 0; unsigned i = 0; unsigned j = 0; std::vector<unsigned char> tmpTextData; @@ -268,7 +268,7 @@ void libcdr::CDRStylesCollector::collectText(unsigned textId, unsigned styleId, for (i=0, j=0; i<charDescriptions.size() && j<data.size(); ++i) { tmpCharStyle = defaultCharStyle; - std::map<unsigned, CDRCharacterStyle>::const_iterator iter = styleOverrides.find((tmpCharDescription >> 16) & 0xff); + std::map<unsigned, CDRCharacterStyle>::const_iterator iter = styleOverrides.find(tmpCharDescription & 0xfe); if (iter != styleOverrides.end()) tmpCharStyle.overrideCharacterStyle(iter->second); if (!tmpCharStyle.m_charSet) @@ -277,7 +277,7 @@ void libcdr::CDRStylesCollector::collectText(unsigned textId, unsigned styleId, if (iterFont != m_ps.m_fonts.end()) tmpCharStyle.m_charSet = iterFont->second.m_encoding; } - if ((uint32_t)(charDescriptions[i] & 0xffffff) != tmpCharDescription) + if (charDescriptions[i] != tmpCharDescription) { WPXString text; if (!tmpTextData.empty()) @@ -289,7 +289,7 @@ void libcdr::CDRStylesCollector::collectText(unsigned textId, unsigned styleId, } line.append(CDRText(text, tmpCharStyle)); tmpTextData.clear(); - tmpCharDescription = (uint32_t)(charDescriptions[i] & 0xffffff); + tmpCharDescription = charDescriptions[i]; } tmpTextData.push_back(data[j++]); |