| 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/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
| 8 #include "../../include/fpdfdoc/fpdf_vt.h" | 8 #include "../../include/fpdfdoc/fpdf_vt.h" |
| 9 #include "pdf_vt.h" | 9 #include "pdf_vt.h" |
| 10 #include "../../include/fpdfdoc/fpdf_ap.h" | 10 #include "../../include/fpdfdoc/fpdf_ap.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 if (CPDF_Dictionary* pParentDict = pAnnotDict->GetDict("Parent")) { | 31 if (CPDF_Dictionary* pParentDict = pAnnotDict->GetDict("Parent")) { |
| 32 if (pParentDict->KeyExist("AS")) { | 32 if (pParentDict->KeyExist("AS")) { |
| 33 pAnnotDict->SetAtString("AS", pParentDict->GetString("AS")); | 33 pAnnotDict->SetAtString("AS", pParentDict->GetString("AS")); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 return FALSE; | 39 return FALSE; |
| 40 } | 40 } |
| 41 |
| 41 class CPVT_FontMap : public IPVT_FontMap { | 42 class CPVT_FontMap : public IPVT_FontMap { |
| 42 public: | 43 public: |
| 43 CPVT_FontMap(CPDF_Document* pDoc, | 44 CPVT_FontMap(CPDF_Document* pDoc, |
| 44 CPDF_Dictionary* pResDict, | 45 CPDF_Dictionary* pResDict, |
| 45 CPDF_Font* pDefFont, | 46 CPDF_Font* pDefFont, |
| 46 const CFX_ByteString& sDefFontAlias); | 47 const CFX_ByteString& sDefFontAlias); |
| 47 virtual ~CPVT_FontMap(); | 48 ~CPVT_FontMap() override; |
| 48 CPDF_Font* GetPDFFont(int32_t nFontIndex); | 49 |
| 49 CFX_ByteString GetPDFFontAlias(int32_t nFontIndex); | 50 // IPVT_FontMap |
| 51 CPDF_Font* GetPDFFont(int32_t nFontIndex) override; |
| 52 CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) override; |
| 53 |
| 50 static void GetAnnotSysPDFFont(CPDF_Document* pDoc, | 54 static void GetAnnotSysPDFFont(CPDF_Document* pDoc, |
| 51 CPDF_Dictionary* pResDict, | 55 CPDF_Dictionary* pResDict, |
| 52 CPDF_Font*& pSysFont, | 56 CPDF_Font*& pSysFont, |
| 53 CFX_ByteString& sSysFontAlias); | 57 CFX_ByteString& sSysFontAlias); |
| 54 | 58 |
| 55 private: | 59 private: |
| 56 CPDF_Document* m_pDocument; | 60 CPDF_Document* m_pDocument; |
| 57 CPDF_Dictionary* m_pResDict; | 61 CPDF_Dictionary* m_pResDict; |
| 58 CPDF_Font* m_pDefFont; | 62 CPDF_Font* m_pDefFont; |
| 59 CFX_ByteString m_sDefFontAlias; | 63 CFX_ByteString m_sDefFontAlias; |
| 60 CPDF_Font* m_pSysFont; | 64 CPDF_Font* m_pSysFont; |
| 61 CFX_ByteString m_sSysFontAlias; | 65 CFX_ByteString m_sSysFontAlias; |
| 62 }; | 66 }; |
| 67 |
| 63 CPVT_FontMap::CPVT_FontMap(CPDF_Document* pDoc, | 68 CPVT_FontMap::CPVT_FontMap(CPDF_Document* pDoc, |
| 64 CPDF_Dictionary* pResDict, | 69 CPDF_Dictionary* pResDict, |
| 65 CPDF_Font* pDefFont, | 70 CPDF_Font* pDefFont, |
| 66 const CFX_ByteString& sDefFontAlias) | 71 const CFX_ByteString& sDefFontAlias) |
| 67 : m_pDocument(pDoc), | 72 : m_pDocument(pDoc), |
| 68 m_pResDict(pResDict), | 73 m_pResDict(pResDict), |
| 69 m_pDefFont(pDefFont), | 74 m_pDefFont(pDefFont), |
| 70 m_sDefFontAlias(sDefFontAlias), | 75 m_sDefFontAlias(sDefFontAlias), |
| 71 m_pSysFont(NULL), | 76 m_pSysFont(NULL), |
| 72 m_sSysFontAlias() {} | 77 m_sSysFontAlias() {} |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 << "\n"; | 926 << "\n"; |
| 922 break; | 927 break; |
| 923 case CT_CMYK: | 928 case CT_CMYK: |
| 924 sColorStream << color.fColor1 << " " << color.fColor2 << " " | 929 sColorStream << color.fColor1 << " " << color.fColor2 << " " |
| 925 << color.fColor3 << " " << color.fColor4 << " " | 930 << color.fColor3 << " " << color.fColor4 << " " |
| 926 << (bFillOrStroke ? "k" : "K") << "\n"; | 931 << (bFillOrStroke ? "k" : "K") << "\n"; |
| 927 break; | 932 break; |
| 928 } | 933 } |
| 929 return sColorStream.GetByteString(); | 934 return sColorStream.GetByteString(); |
| 930 } | 935 } |
| OLD | NEW |