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

Side by Side Diff: core/src/fpdfdoc/doc_utils.cpp

Issue 1751753002: Remove implicit conversions and some cleanup (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 9 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
« no previous file with comments | « core/src/fpdfdoc/doc_formfield.cpp ('k') | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "core/include/fpdfdoc/fpdf_doc.h" 9 #include "core/include/fpdfdoc/fpdf_doc.h"
10 #include "core/src/fpdfdoc/doc_utils.h" 10 #include "core/src/fpdfdoc/doc_utils.h"
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 CPDF_Dictionary* pDR = pFormDict->GetDictBy("DR"); 608 CPDF_Dictionary* pDR = pFormDict->GetDictBy("DR");
609 if (!pDR) { 609 if (!pDR) {
610 return; 610 return;
611 } 611 }
612 CPDF_Dictionary* pFonts = pDR->GetDictBy("Font"); 612 CPDF_Dictionary* pFonts = pDR->GetDictBy("Font");
613 if (!pFonts) { 613 if (!pFonts) {
614 return; 614 return;
615 } 615 }
616 pFonts->RemoveAt(csNameTag); 616 pFonts->RemoveAt(csNameTag);
617 } 617 }
618
618 CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, 619 CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict,
619 CPDF_Document* pDocument) { 620 CPDF_Document* pDocument) {
620 if (!pFormDict) { 621 if (!pFormDict) {
621 return NULL; 622 return NULL;
622 } 623 }
623 CPDF_DefaultAppearance cDA = pFormDict->GetStringBy("DA"); 624 CPDF_DefaultAppearance cDA(pFormDict->GetStringBy("DA"));
624 CFX_ByteString csFontNameTag; 625 CFX_ByteString csFontNameTag;
625 FX_FLOAT fFontSize; 626 FX_FLOAT fFontSize;
626 cDA.GetFont(csFontNameTag, fFontSize); 627 cDA.GetFont(csFontNameTag, fFontSize);
627 return GetInterFormFont(pFormDict, pDocument, csFontNameTag); 628 return GetInterFormFont(pFormDict, pDocument, csFontNameTag);
628 } 629 }
630
629 CPDF_IconFit::ScaleMethod CPDF_IconFit::GetScaleMethod() { 631 CPDF_IconFit::ScaleMethod CPDF_IconFit::GetScaleMethod() {
630 if (!m_pDict) { 632 if (!m_pDict) {
631 return Always; 633 return Always;
632 } 634 }
633 CFX_ByteString csSW = m_pDict->GetStringBy("SW", "A"); 635 CFX_ByteString csSW = m_pDict->GetStringBy("SW", "A");
634 if (csSW == "B") { 636 if (csSW == "B") {
635 return Bigger; 637 return Bigger;
636 } 638 }
637 if (csSW == "S") { 639 if (csSW == "S") {
638 return Smaller; 640 return Smaller;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 CPDF_Object* pAttr = pFieldDict->GetElementValue(name); 695 CPDF_Object* pAttr = pFieldDict->GetElementValue(name);
694 if (pAttr) { 696 if (pAttr) {
695 return pAttr; 697 return pAttr;
696 } 698 }
697 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent"); 699 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent");
698 if (!pParent) { 700 if (!pParent) {
699 return NULL; 701 return NULL;
700 } 702 }
701 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); 703 return FPDF_GetFieldAttr(pParent, name, nLevel + 1);
702 } 704 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_formfield.cpp ('k') | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698