OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include "core/include/fpdfapi/fpdf_module.h" | 9 #include "core/include/fpdfapi/fpdf_module.h" |
10 #include "core/include/fpdfapi/fpdf_page.h" | 10 #include "core/include/fpdfapi/fpdf_page.h" |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 int32_t iMid = (iStart + iEnd) / 2; | 465 int32_t iMid = (iStart + iEnd) / 2; |
466 const FX_LANG2CS& charset = gs_FXLang2CharsetTable[iMid]; | 466 const FX_LANG2CS& charset = gs_FXLang2CharsetTable[iMid]; |
467 if (uCode == charset.uLang) { | 467 if (uCode == charset.uLang) { |
468 return charset.uCharset; | 468 return charset.uCharset; |
469 } | 469 } |
470 if (uCode < charset.uLang) { | 470 if (uCode < charset.uLang) { |
471 iEnd = iMid - 1; | 471 iEnd = iMid - 1; |
472 } else { | 472 } else { |
473 iStart = iMid + 1; | 473 iStart = iMid + 1; |
474 } | 474 } |
475 }; | 475 } |
476 return 0; | 476 return 0; |
477 } | 477 } |
478 static FX_WORD FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength) { | 478 static FX_WORD FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength) { |
479 FXSYS_assert(pLang); | 479 FXSYS_assert(pLang); |
480 if (iLength < 0) { | 480 if (iLength < 0) { |
481 iLength = FXSYS_strlen(pLang); | 481 iLength = FXSYS_strlen(pLang); |
482 } | 482 } |
483 uint32_t uHash = FX_GetLangHashCode(pLang); | 483 uint32_t uHash = FX_GetLangHashCode(pLang); |
484 return FX_GetCsFromLangCode(uHash); | 484 return FX_GetCsFromLangCode(uHash); |
485 } | 485 } |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, | 1141 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, |
1142 const CFX_ByteStringC& name) { | 1142 const CFX_ByteStringC& name) { |
1143 if (pPageDict->KeyExist(name)) { | 1143 if (pPageDict->KeyExist(name)) { |
1144 return; | 1144 return; |
1145 } | 1145 } |
1146 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); | 1146 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); |
1147 if (pObj) { | 1147 if (pObj) { |
1148 pPageDict->SetAt(name, pObj->Clone()); | 1148 pPageDict->SetAt(name, pObj->Clone()); |
1149 } | 1149 } |
1150 } | 1150 } |
OLD | NEW |