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

Side by Side Diff: core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp

Issue 1298393003: Extern in .cpp file is a code smell, part 2. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rename, remove dead fn. Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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_module.h" 7 #include "../../../include/fpdfapi/fpdf_module.h"
8 #include "../../../include/fpdfapi/fpdf_page.h" 8 #include "../../../include/fpdfapi/fpdf_page.h"
9 #include "../../../include/fpdfapi/fpdf_resource.h" 9 #include "../../../include/fpdfapi/fpdf_resource.h"
10 #include "../../../include/fxge/fx_freetype.h" 10 #include "../../../include/fxge/fx_freetype.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 {0x81, 0xfe}}, 423 {0x81, 0xfe}},
424 {"KSCpc-EUC", 424 {"KSCpc-EUC",
425 CIDSET_KOREA1, 425 CIDSET_KOREA1,
426 CIDCODING_KOREA, 426 CIDCODING_KOREA,
427 CPDF_CMap::MixedTwoBytes, 427 CPDF_CMap::MixedTwoBytes,
428 1, 428 1,
429 {0xa1, 0xfd}}, 429 {0xa1, 0xfd}},
430 {"UniKS-UCS2", CIDSET_KOREA1, CIDCODING_UCS2, CPDF_CMap::TwoBytes}, 430 {"UniKS-UCS2", CIDSET_KOREA1, CIDCODING_UCS2, CPDF_CMap::TwoBytes},
431 {"UniKS-UTF16", CIDSET_KOREA1, CIDCODING_UTF16, CPDF_CMap::TwoBytes}, 431 {"UniKS-UTF16", CIDSET_KOREA1, CIDCODING_UTF16, CPDF_CMap::TwoBytes},
432 {NULL, 0, 0}}; 432 {NULL, 0, 0}};
433 extern void FPDFAPI_FindEmbeddedCMap(const char* name, 433
434 int charset,
435 int coding,
436 const FXCMAP_CMap*& pMap);
437 extern FX_WORD FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap,
438 FX_DWORD charcode);
439 FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, 434 FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr,
440 const FX_CHAR* pName, 435 const FX_CHAR* pName,
441 FX_BOOL bPromptCJK) { 436 FX_BOOL bPromptCJK) {
442 m_PredefinedCMap = pName; 437 m_PredefinedCMap = pName;
443 if (m_PredefinedCMap == FX_BSTRC("Identity-H") || 438 if (m_PredefinedCMap == FX_BSTRC("Identity-H") ||
444 m_PredefinedCMap == FX_BSTRC("Identity-V")) { 439 m_PredefinedCMap == FX_BSTRC("Identity-V")) {
445 m_Coding = CIDCODING_CID; 440 m_Coding = CIDCODING_CID;
446 m_bVertical = pName[9] == 'V'; 441 m_bVertical = pName[9] == 'V';
447 m_bLoaded = TRUE; 442 m_bLoaded = TRUE;
448 return TRUE; 443 return TRUE;
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 if (m_pCMap == NULL) { 802 if (m_pCMap == NULL) {
808 return (FX_WORD)charcode; 803 return (FX_WORD)charcode;
809 } 804 }
810 return m_pCMap->CIDFromCharCode(charcode); 805 return m_pCMap->CIDFromCharCode(charcode);
811 } 806 }
812 FX_BOOL CPDF_CIDFont::IsVertWriting() const { 807 FX_BOOL CPDF_CIDFont::IsVertWriting() const {
813 return m_pCMap ? m_pCMap->IsVertWriting() : FALSE; 808 return m_pCMap ? m_pCMap->IsVertWriting() : FALSE;
814 } 809 }
815 810
816 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ 811 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
817 extern FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, FX_WORD cid);
818 static FX_DWORD _EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap, 812 static FX_DWORD _EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap,
819 int charset, 813 int charset,
820 FX_WCHAR unicode) { 814 FX_WCHAR unicode) {
821 if (charset <= 0 || charset > 4) { 815 if (charset <= 0 || charset > 4) {
822 return 0; 816 return 0;
823 } 817 }
824 CPDF_FontGlobals* pFontGlobals = 818 CPDF_FontGlobals* pFontGlobals =
825 CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals(); 819 CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
826 const FX_WORD* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap; 820 const FX_WORD* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
827 if (pCodes == NULL) { 821 if (pCodes == NULL) {
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 if (middlecode > CID) { 1625 if (middlecode > CID) {
1632 end = middle - 1; 1626 end = middle - 1;
1633 } else if (middlecode < CID) { 1627 } else if (middlecode < CID) {
1634 begin = middle + 1; 1628 begin = middle + 1;
1635 } else { 1629 } else {
1636 return &Japan1_VertCIDs[middle].a; 1630 return &Japan1_VertCIDs[middle].a;
1637 } 1631 }
1638 } 1632 }
1639 return NULL; 1633 return NULL;
1640 } 1634 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698