Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2562)

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp

Issue 1776713004: Move CPDF_NumberTree to fpdfdoc. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: One more const. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fpdfapi/fpdf_parser.h ('k') | core/src/fpdfdoc/doc_basic.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index a08cf7d466645750dea9c34eb1f97c21478e32f8..3bf3f584328df3e570f744c84919f7033fe69cc1 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -220,44 +220,3 @@ CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj) {
}
return buf;
}
-
-static CPDF_Object* SearchNumberNode(CPDF_Dictionary* pNode, int num) {
- CPDF_Array* pLimits = pNode->GetArrayBy("Limits");
- if (pLimits &&
- (num < pLimits->GetIntegerAt(0) || num > pLimits->GetIntegerAt(1))) {
- return NULL;
- }
- CPDF_Array* pNumbers = pNode->GetArrayBy("Nums");
- if (pNumbers) {
- FX_DWORD dwCount = pNumbers->GetCount() / 2;
- for (FX_DWORD i = 0; i < dwCount; i++) {
- int index = pNumbers->GetIntegerAt(i * 2);
- if (num == index) {
- return pNumbers->GetElementValue(i * 2 + 1);
- }
- if (index > num) {
- break;
- }
- }
- return NULL;
- }
- CPDF_Array* pKids = pNode->GetArrayBy("Kids");
- if (!pKids) {
- return NULL;
- }
- for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
- CPDF_Dictionary* pKid = pKids->GetDictAt(i);
- if (!pKid) {
- continue;
- }
- CPDF_Object* pFound = SearchNumberNode(pKid, num);
- if (pFound) {
- return pFound;
- }
- }
- return NULL;
-}
-
-CPDF_Object* CPDF_NumberTree::LookupValue(int num) {
- return SearchNumberNode(m_pRoot, num);
-}
« no previous file with comments | « core/include/fpdfapi/fpdf_parser.h ('k') | core/src/fpdfdoc/doc_basic.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698