diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-27 18:13:46 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-27 18:13:46 +0000 |
commit | 9f0bba48c208722c8d05eaa5382254f3183c65b7 (patch) | |
tree | f23b40992874db72cf25b43943fe02cbd64e0c81 | |
parent | f473672fd6305fe97c749bde3b92e3c9c90e88d0 (diff) | |
download | pdfium-9f0bba48c208722c8d05eaa5382254f3183c65b7.tar.xz |
Remove use of CollectionSize from CPDF_CMapParser
Bug: pdfium:774
Change-Id: Ie24d0741f8c8d7988166aeb4b9ce87491993d30c
Reviewed-on: https://pdfium-review.googlesource.com/19390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r-- | core/fpdfapi/font/cpdf_cmapparser.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfapi/font/cpdf_cmapparser.cpp b/core/fpdfapi/font/cpdf_cmapparser.cpp index fbd6daf851..a88448c5bd 100644 --- a/core/fpdfapi/font/cpdf_cmapparser.cpp +++ b/core/fpdfapi/font/cpdf_cmapparser.cpp @@ -17,7 +17,6 @@ #include "core/fxcrt/fx_extension.h" #include "core/fxge/fx_freetype.h" #include "third_party/base/logging.h" -#include "third_party/base/stl_util.h" namespace { @@ -110,14 +109,14 @@ void CPDF_CMapParser::ParseWord(const ByteStringView& word) { m_Status = 0; } else if (m_Status == 7) { if (word == "endcodespacerange") { - uint32_t nSegs = pdfium::CollectionSize<uint32_t>(m_CodeRanges); - if (nSegs > 1) { - m_pCMap->SetCodingScheme(CPDF_CMap::MixedFourBytes); - m_pCMap->SetMixedFourByteLeadingRanges(m_CodeRanges); - } else if (nSegs == 1) { + size_t nSegs = m_CodeRanges.size(); + if (nSegs == 1) { m_pCMap->SetCodingScheme((m_CodeRanges[0].m_CharSize == 2) ? CPDF_CMap::TwoBytes : CPDF_CMap::OneByte); + } else if (nSegs > 1) { + m_pCMap->SetCodingScheme(CPDF_CMap::MixedFourBytes); + m_pCMap->SetMixedFourByteLeadingRanges(m_CodeRanges); } m_Status = 0; } else { |