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

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

Issue 1632143002: War on #defines, part 1. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add const. Created 4 years, 11 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/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/src/fpdftext/fpdf_text.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 "core/include/fpdfdoc/fpdf_doc.h" 7 #include "core/include/fpdfdoc/fpdf_doc.h"
8 #include "doc_utils.h" 8 #include "doc_utils.h"
9 9
10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField* pField) { 10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField* pField) {
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 293 }
294 if (!pValue && m_Type != Text) { 294 if (!pValue && m_Type != Text) {
295 pValue = FPDF_GetFieldAttr(m_pDict, "DV"); 295 pValue = FPDF_GetFieldAttr(m_pDict, "DV");
296 } 296 }
297 } 297 }
298 if (!pValue) { 298 if (!pValue) {
299 return CFX_WideString(); 299 return CFX_WideString();
300 } 300 }
301 } 301 }
302 switch (pValue->GetType()) { 302 switch (pValue->GetType()) {
303 case PDFOBJ_STRING: 303 case CPDF_Object::STRING:
304 case PDFOBJ_STREAM: 304 case CPDF_Object::STREAM:
305 return pValue->GetUnicodeText(); 305 return pValue->GetUnicodeText();
306 case PDFOBJ_ARRAY: 306 case CPDF_Object::ARRAY:
307 pValue = pValue->AsArray()->GetElementValue(0); 307 pValue = pValue->AsArray()->GetElementValue(0);
308 if (pValue) 308 if (pValue)
309 return pValue->GetUnicodeText(); 309 return pValue->GetUnicodeText();
310 break; 310 break;
311 default:
312 break;
311 } 313 }
312 return CFX_WideString(); 314 return CFX_WideString();
313 } 315 }
314 CFX_WideString CPDF_FormField::GetValue() { 316 CFX_WideString CPDF_FormField::GetValue() {
315 return GetValue(FALSE); 317 return GetValue(FALSE);
316 } 318 }
317 CFX_WideString CPDF_FormField::GetDefaultValue() { 319 CFX_WideString CPDF_FormField::GetDefaultValue() {
318 return GetValue(TRUE); 320 return GetValue(TRUE);
319 } 321 }
320 FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, 322 FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value,
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")) 1019 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font"))
1018 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict( 1020 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(
1019 font_name); 1021 font_name);
1020 1022
1021 if (!pFontDict) { 1023 if (!pFontDict) {
1022 return; 1024 return;
1023 } 1025 }
1024 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); 1026 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict);
1025 m_FontSize = FX_atof(syntax.GetWord()); 1027 m_FontSize = FX_atof(syntax.GetWord());
1026 } 1028 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/src/fpdftext/fpdf_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698