summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_cmapparser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-04 14:52:34 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-05 17:04:27 +0000
commit41bf73a2c389d8fa811cabb1867b8b6a5585d5eb (patch)
treed70bf3a2155cd9ed28cc6bbb7e033517248a848c /core/fpdfapi/font/cpdf_cmapparser.cpp
parent38d0449a02f4d16dd513c08c558e57891ec252dd (diff)
downloadpdfium-41bf73a2c389d8fa811cabb1867b8b6a5585d5eb.tar.xz
Remove CPDF_CMapParser friends
This CL removes the friends from CPDF_CMapParser. The two needed methods have been moved from private statics to public methods on the class. Change-Id: Ida76aa8748435e089874d9ef9c6545527b175561 Reviewed-on: https://pdfium-review.googlesource.com/15454 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cpdf_cmapparser.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_cmapparser.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/core/fpdfapi/font/cpdf_cmapparser.cpp b/core/fpdfapi/font/cpdf_cmapparser.cpp
index 4c74761ec9..fbd6daf851 100644
--- a/core/fpdfapi/font/cpdf_cmapparser.cpp
+++ b/core/fpdfapi/font/cpdf_cmapparser.cpp
@@ -70,7 +70,7 @@ void CPDF_CMapParser::ParseWord(const ByteStringView& word) {
m_CodeSeq = 0;
} else if (word == "usecmap") {
} else if (m_Status == 1 || m_Status == 2) {
- m_CodePoints[m_CodeSeq] = CMap_GetCode(word);
+ m_CodePoints[m_CodeSeq] = GetCode(word);
m_CodeSeq++;
uint32_t StartCode, EndCode;
uint16_t StartCID;
@@ -106,7 +106,7 @@ void CPDF_CMapParser::ParseWord(const ByteStringView& word) {
} else if (m_Status == 5) {
m_Status = 0;
} else if (m_Status == 6) {
- m_pCMap->SetVertical(CMap_GetCode(word) != 0);
+ m_pCMap->SetVertical(GetCode(word) != 0);
m_Status = 0;
} else if (m_Status == 7) {
if (word == "endcodespacerange") {
@@ -126,7 +126,7 @@ void CPDF_CMapParser::ParseWord(const ByteStringView& word) {
}
if (m_CodeSeq % 2) {
CPDF_CMap::CodeRange range;
- if (CMap_GetCodeRange(range, m_LastWord.AsStringView(), word))
+ if (GetCodeRange(range, m_LastWord.AsStringView(), word))
m_CodeRanges.push_back(range);
}
m_CodeSeq++;
@@ -135,10 +135,10 @@ void CPDF_CMapParser::ParseWord(const ByteStringView& word) {
m_LastWord = word;
}
-// Static.
-uint32_t CPDF_CMapParser::CMap_GetCode(const ByteStringView& word) {
+uint32_t CPDF_CMapParser::GetCode(const ByteStringView& word) const {
if (word.IsEmpty())
return 0;
+
pdfium::base::CheckedNumeric<uint32_t> num = 0;
if (word[0] == '<') {
for (size_t i = 1; i < word.GetLength() && std::isxdigit(word[i]); ++i) {
@@ -157,10 +157,9 @@ uint32_t CPDF_CMapParser::CMap_GetCode(const ByteStringView& word) {
return num.ValueOrDie();
}
-// Static.
-bool CPDF_CMapParser::CMap_GetCodeRange(CPDF_CMap::CodeRange& range,
- const ByteStringView& first,
- const ByteStringView& second) {
+bool CPDF_CMapParser::GetCodeRange(CPDF_CMap::CodeRange& range,
+ const ByteStringView& first,
+ const ByteStringView& second) const {
if (first.GetLength() == 0 || first[0] != '<')
return false;