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

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

Issue 1751753002: Remove implicit conversions and some cleanup (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
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 "core/include/fpdfdoc/fpdf_doc.h" 7 #include "core/include/fpdfdoc/fpdf_doc.h"
8 #include "core/src/fpdfdoc/doc_utils.h" 8 #include "core/src/fpdfdoc/doc_utils.h"
9 9
10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField* pField) { 10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField* pField) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 case RichText: 228 case RichText:
229 case File: 229 case File:
230 return FIELDTYPE_TEXTFIELD; 230 return FIELDTYPE_TEXTFIELD;
231 case Sign: 231 case Sign:
232 return FIELDTYPE_SIGNATURE; 232 return FIELDTYPE_SIGNATURE;
233 default: 233 default:
234 break; 234 break;
235 } 235 }
236 return FIELDTYPE_UNKNOWN; 236 return FIELDTYPE_UNKNOWN;
237 } 237 }
238
238 CPDF_AAction CPDF_FormField::GetAdditionalAction() { 239 CPDF_AAction CPDF_FormField::GetAdditionalAction() {
239 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "AA"); 240 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "AA");
240 if (!pObj) { 241 CPDF_Dictionary* dict = pObj ? pObj->GetDict() : nullptr;
241 return NULL; 242 return CPDF_AAction(dict);
Tom Sepez 2016/03/01 17:53:35 Nit: local |dict| only used once, so combine with
Wei Li 2016/03/01 21:46:53 Done.
242 }
243 return pObj->GetDict();
244 } 243 }
244
245 CFX_WideString CPDF_FormField::GetAlternateName() { 245 CFX_WideString CPDF_FormField::GetAlternateName() {
246 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TU"); 246 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TU");
247 if (!pObj) { 247 if (!pObj) {
248 return L""; 248 return L"";
249 } 249 }
250 return pObj->GetUnicodeText(); 250 return pObj->GetUnicodeText();
251 } 251 }
252 CFX_WideString CPDF_FormField::GetMappingName() { 252 CFX_WideString CPDF_FormField::GetMappingName() {
253 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TM"); 253 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TM");
254 if (!pObj) { 254 if (!pObj) {
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 pFontDict = m_pForm->m_pFormDict->GetDictBy("DR") 1083 pFontDict = m_pForm->m_pFormDict->GetDictBy("DR")
1084 ->GetDictBy("Font") 1084 ->GetDictBy("Font")
1085 ->GetDictBy(font_name); 1085 ->GetDictBy(font_name);
1086 1086
1087 if (!pFontDict) { 1087 if (!pFontDict) {
1088 return; 1088 return;
1089 } 1089 }
1090 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); 1090 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict);
1091 m_FontSize = FX_atof(syntax.GetWord()); 1091 m_FontSize = FX_atof(syntax.GetWord());
1092 } 1092 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698