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

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

Issue 1410343003: [Merge to XFA] Revert "Revert "Add type cast definitions for CPDF_Dictionary."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebase to origin/xfa Created 5 years, 2 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_pageobj.h" 9 #include "../../../include/fpdfapi/fpdf_pageobj.h"
10 #include "../../../include/fpdfapi/fpdf_resource.h" 10 #include "../../../include/fpdfapi/fpdf_resource.h"
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 } 738 }
739 return; 739 return;
740 } 740 }
741 CFX_ByteString bsEncoding = pEncoding->GetString(); 741 CFX_ByteString bsEncoding = pEncoding->GetString();
742 if (bsEncoding.Compare(FX_BSTRC("MacExpertEncoding")) == 0) { 742 if (bsEncoding.Compare(FX_BSTRC("MacExpertEncoding")) == 0) {
743 bsEncoding = FX_BSTRC("WinAnsiEncoding"); 743 bsEncoding = FX_BSTRC("WinAnsiEncoding");
744 } 744 }
745 GetPredefinedEncoding(iBaseEncoding, bsEncoding); 745 GetPredefinedEncoding(iBaseEncoding, bsEncoding);
746 return; 746 return;
747 } 747 }
748 if (pEncoding->GetType() != PDFOBJ_DICTIONARY) { 748
749 CPDF_Dictionary* pDict = pEncoding->AsDictionary();
750 if (!pDict)
749 return; 751 return;
750 } 752
751 CPDF_Dictionary* pDict = (CPDF_Dictionary*)pEncoding;
752 if (iBaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL && 753 if (iBaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL &&
753 iBaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS) { 754 iBaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS) {
754 CFX_ByteString bsEncoding = pDict->GetString(FX_BSTRC("BaseEncoding")); 755 CFX_ByteString bsEncoding = pDict->GetString(FX_BSTRC("BaseEncoding"));
755 if (bsEncoding.Compare(FX_BSTRC("MacExpertEncoding")) == 0 && bTrueType) { 756 if (bsEncoding.Compare(FX_BSTRC("MacExpertEncoding")) == 0 && bTrueType) {
756 bsEncoding = FX_BSTRC("WinAnsiEncoding"); 757 bsEncoding = FX_BSTRC("WinAnsiEncoding");
757 } 758 }
758 GetPredefinedEncoding(iBaseEncoding, bsEncoding); 759 GetPredefinedEncoding(iBaseEncoding, bsEncoding);
759 } 760 }
760 if ((!bEmbedded || bTrueType) && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) { 761 if ((!bEmbedded || bTrueType) && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) {
761 iBaseEncoding = PDFFONT_ENCODING_STANDARD; 762 iBaseEncoding = PDFFONT_ENCODING_STANDARD;
(...skipping 12 matching lines...) Expand all
774 if (pElement->GetType() == PDFOBJ_NAME) { 775 if (pElement->GetType() == PDFOBJ_NAME) {
775 if (cur_code < 256) { 776 if (cur_code < 256) {
776 pCharNames[cur_code] = ((CPDF_Name*)pElement)->GetString(); 777 pCharNames[cur_code] = ((CPDF_Name*)pElement)->GetString();
777 } 778 }
778 cur_code++; 779 cur_code++;
779 } else { 780 } else {
780 cur_code = pElement->GetInteger(); 781 cur_code = pElement->GetInteger();
781 } 782 }
782 } 783 }
783 } 784 }
785
784 FX_BOOL CPDF_Font::IsStandardFont() const { 786 FX_BOOL CPDF_Font::IsStandardFont() const {
785 if (m_FontType != PDFFONT_TYPE1) { 787 if (m_FontType != PDFFONT_TYPE1) {
786 return FALSE; 788 return FALSE;
787 } 789 }
788 if (m_pFontFile != NULL) { 790 if (m_pFontFile != NULL) {
789 return FALSE; 791 return FALSE;
790 } 792 }
791 if (((CPDF_Type1Font*)this)->GetBase14Font() < 0) { 793 if (((CPDF_Type1Font*)this)->GetBase14Font() < 0) {
792 return FALSE; 794 return FALSE;
793 } 795 }
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1781 CPDF_Type3Char::CPDF_Type3Char() { 1783 CPDF_Type3Char::CPDF_Type3Char() {
1782 m_pForm = NULL; 1784 m_pForm = NULL;
1783 m_pBitmap = NULL; 1785 m_pBitmap = NULL;
1784 m_bPageRequired = FALSE; 1786 m_bPageRequired = FALSE;
1785 m_bColored = FALSE; 1787 m_bColored = FALSE;
1786 } 1788 }
1787 CPDF_Type3Char::~CPDF_Type3Char() { 1789 CPDF_Type3Char::~CPDF_Type3Char() {
1788 delete m_pForm; 1790 delete m_pForm;
1789 delete m_pBitmap; 1791 delete m_pBitmap;
1790 } 1792 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698