| 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 "doc_utils.h" | 8 #include "doc_utils.h" |
| 9 | 9 |
| 10 static const int FPDFDOC_UTILS_MAXRECURSION = 32; | 10 static const int FPDFDOC_UTILS_MAXRECURSION = 32; |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 return NULL; | 648 return NULL; |
| 649 } | 649 } |
| 650 CPDF_DefaultAppearance cDA = pFormDict->GetString("DA"); | 650 CPDF_DefaultAppearance cDA = pFormDict->GetString("DA"); |
| 651 CFX_ByteString csFontNameTag; | 651 CFX_ByteString csFontNameTag; |
| 652 FX_FLOAT fFontSize; | 652 FX_FLOAT fFontSize; |
| 653 cDA.GetFont(csFontNameTag, fFontSize); | 653 cDA.GetFont(csFontNameTag, fFontSize); |
| 654 return GetInterFormFont(pFormDict, pDocument, csFontNameTag); | 654 return GetInterFormFont(pFormDict, pDocument, csFontNameTag); |
| 655 } | 655 } |
| 656 CPDF_IconFit::ScaleMethod CPDF_IconFit::GetScaleMethod() | 656 CPDF_IconFit::ScaleMethod CPDF_IconFit::GetScaleMethod() |
| 657 { | 657 { |
| 658 if (m_pDict == NULL) { | 658 if (!m_pDict) { |
| 659 return Always; | 659 return Always; |
| 660 } | 660 } |
| 661 CFX_ByteString csSW = m_pDict->GetString("SW", "A"); | 661 CFX_ByteString csSW = m_pDict->GetString("SW", "A"); |
| 662 if (csSW == "B") { | 662 if (csSW == "B") { |
| 663 return Bigger; | 663 return Bigger; |
| 664 } else if (csSW == "S") { | 664 } |
| 665 if (csSW == "S") { |
| 665 return Smaller; | 666 return Smaller; |
| 666 } else if (csSW == "N") { | 667 } |
| 668 if (csSW == "N") { |
| 667 return Never; | 669 return Never; |
| 668 } | 670 } |
| 669 return Always; | 671 return Always; |
| 670 } | 672 } |
| 671 FX_BOOL CPDF_IconFit::IsProportionalScale() | 673 FX_BOOL CPDF_IconFit::IsProportionalScale() |
| 672 { | 674 { |
| 673 if (m_pDict == NULL) { | 675 if (m_pDict == NULL) { |
| 674 return TRUE; | 676 return TRUE; |
| 675 } | 677 } |
| 676 return m_pDict->GetString("S", "P") != "A"; | 678 return m_pDict->GetString("S", "P") != "A"; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 CPDF_Object* pAttr = pFieldDict->GetElementValue(name); | 723 CPDF_Object* pAttr = pFieldDict->GetElementValue(name); |
| 722 if (pAttr) { | 724 if (pAttr) { |
| 723 return pAttr; | 725 return pAttr; |
| 724 } | 726 } |
| 725 CPDF_Dictionary* pParent = pFieldDict->GetDict("Parent"); | 727 CPDF_Dictionary* pParent = pFieldDict->GetDict("Parent"); |
| 726 if (pParent == NULL) { | 728 if (pParent == NULL) { |
| 727 return NULL; | 729 return NULL; |
| 728 } | 730 } |
| 729 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); | 731 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); |
| 730 } | 732 } |
| OLD | NEW |