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 "../../../include/fpdfapi/fpdf_page.h" | 7 #include "../../../include/fpdfapi/fpdf_page.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../fpdf_page/pageint.h" | 9 #include "../fpdf_page/pageint.h" |
10 #include <limits.h> | 10 #include <limits.h> |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 }; | 514 }; |
515 static FX_WORD FX_GetCsFromLangCode(uint32_t uCode) | 515 static FX_WORD FX_GetCsFromLangCode(uint32_t uCode) |
516 { | 516 { |
517 int32_t iStart = 0; | 517 int32_t iStart = 0; |
518 int32_t iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1; | 518 int32_t iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1; |
519 while (iStart <= iEnd) { | 519 while (iStart <= iEnd) { |
520 int32_t iMid = (iStart + iEnd) / 2; | 520 int32_t iMid = (iStart + iEnd) / 2; |
521 const FX_LANG2CS &charset = gs_FXLang2CharsetTable[iMid]; | 521 const FX_LANG2CS &charset = gs_FXLang2CharsetTable[iMid]; |
522 if (uCode == charset.uLang) { | 522 if (uCode == charset.uLang) { |
523 return charset.uCharset; | 523 return charset.uCharset; |
524 } else if (uCode < charset.uLang) { | 524 } |
| 525 if (uCode < charset.uLang) { |
525 iEnd = iMid - 1; | 526 iEnd = iMid - 1; |
526 } else { | 527 } else { |
527 iStart = iMid + 1; | 528 iStart = iMid + 1; |
528 } | 529 } |
529 }; | 530 }; |
530 return 0; | 531 return 0; |
531 } | 532 } |
532 static FX_WORD FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength) | 533 static FX_WORD FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength) |
533 { | 534 { |
534 FXSYS_assert(pLang); | 535 FXSYS_assert(pLang); |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, const CFX_ByteStringC& nam
e) | 1173 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, const CFX_ByteStringC& nam
e) |
1173 { | 1174 { |
1174 if (pPageDict->KeyExist(name)) { | 1175 if (pPageDict->KeyExist(name)) { |
1175 return; | 1176 return; |
1176 } | 1177 } |
1177 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); | 1178 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); |
1178 if (pObj) { | 1179 if (pObj) { |
1179 pPageDict->SetAt(name, pObj->Clone()); | 1180 pPageDict->SetAt(name, pObj->Clone()); |
1180 } | 1181 } |
1181 } | 1182 } |
OLD | NEW |