| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 10 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 } | 596 } |
| 597 CPDF_Dictionary* pFonts = pDR->GetDictBy("Font"); | 597 CPDF_Dictionary* pFonts = pDR->GetDictBy("Font"); |
| 598 if (!pFonts) { | 598 if (!pFonts) { |
| 599 pFonts = new CPDF_Dictionary; | 599 pFonts = new CPDF_Dictionary; |
| 600 pDR->SetAt("Font", pFonts); | 600 pDR->SetAt("Font", pFonts); |
| 601 } | 601 } |
| 602 if (csNameTag.IsEmpty()) { | 602 if (csNameTag.IsEmpty()) { |
| 603 csNameTag = pFont->GetBaseFont(); | 603 csNameTag = pFont->GetBaseFont(); |
| 604 } | 604 } |
| 605 csNameTag.Remove(' '); | 605 csNameTag.Remove(' '); |
| 606 csNameTag = | 606 csNameTag = CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, |
| 607 CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, csNameTag); | 607 csNameTag.c_str()); |
| 608 pFonts->SetAtReference(csNameTag.AsStringC(), pDocument, | 608 pFonts->SetAtReference(csNameTag.AsStringC(), pDocument, |
| 609 pFont->GetFontDict()); | 609 pFont->GetFontDict()); |
| 610 } | 610 } |
| 611 CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, | 611 CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, |
| 612 CPDF_Document* pDocument, | 612 CPDF_Document* pDocument, |
| 613 uint8_t charSet, | 613 uint8_t charSet, |
| 614 CFX_ByteString& csNameTag) { | 614 CFX_ByteString& csNameTag) { |
| 615 if (!pFormDict) { | 615 if (!pFormDict) { |
| 616 InitInterFormDict(pFormDict, pDocument); | 616 InitInterFormDict(pFormDict, pDocument); |
| 617 } | 617 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 CPDF_Object* pAttr = pFieldDict->GetDirectObjectBy(name); | 746 CPDF_Object* pAttr = pFieldDict->GetDirectObjectBy(name); |
| 747 if (pAttr) { | 747 if (pAttr) { |
| 748 return pAttr; | 748 return pAttr; |
| 749 } | 749 } |
| 750 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent"); | 750 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent"); |
| 751 if (!pParent) { | 751 if (!pParent) { |
| 752 return NULL; | 752 return NULL; |
| 753 } | 753 } |
| 754 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); | 754 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); |
| 755 } | 755 } |
| OLD | NEW |