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

Side by Side Diff: fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp

Issue 361553002: Remove "this==NULL" and adjust corresponding callers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: change tab to spaces Created 6 years, 5 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 "../../include/formfiller/FormFiller.h" 7 #include "../../include/formfiller/FormFiller.h"
8 #include "../../include/formfiller/FFL_CBA_Fontmap.h" 8 #include "../../include/formfiller/FFL_CBA_Fontmap.h"
9 9
10 CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandle r) : 10 CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandle r) :
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget"); 233 FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget");
234 234
235 if (bWidget) 235 if (bWidget)
236 { 236 {
237 if (CPDF_Dictionary * pRootDict = m_pDocument->GetRoot()) 237 if (CPDF_Dictionary * pRootDict = m_pDocument->GetRoot())
238 pAcroFormDict = pRootDict->GetDict("AcroForm"); 238 pAcroFormDict = pRootDict->GetDict("AcroForm");
239 } 239 }
240 240
241 CFX_ByteString sDA; 241 CFX_ByteString sDA;
242 » 242 » CPDF_Object* pObj;
243 » sDA = FPDF_GetFieldAttr(m_pAnnotDict, "DA")->GetString(); 243 » if ( pObj = FPDF_GetFieldAttr(m_pAnnotDict, "DA"))
244 » » sDA = pObj->GetString();
244 245
245 » if (bWidget) 246 » if (bWidget && sDA.IsEmpty() && (pObj = FPDF_GetFieldAttr(pAcroFormDict, "DA")))
Nico 2014/06/28 01:01:07 I don't know if it matters, but this changes behav
Bo Xu 2014/06/28 01:52:30 You are right, this should be adjusted. On 2014/0
246 » { 247 » » sDA = pObj->GetString();
247 » » if (sDA.IsEmpty())
248 » » {
249 » » » sDA = FPDF_GetFieldAttr(pAcroFormDict, "DA")->GetString( );»
250 » » }
251 » }
252 248
253 CPDF_Dictionary * pFontDict = NULL; 249 CPDF_Dictionary * pFontDict = NULL;
254 250
255 if (!sDA.IsEmpty()) 251 if (!sDA.IsEmpty())
256 { 252 {
257 CPDF_SimpleParser syntax(sDA); 253 CPDF_SimpleParser syntax(sDA);
258 syntax.FindTagParam("Tf", 2); 254 syntax.FindTagParam("Tf", 2);
259 CFX_ByteString sFontName = syntax.GetWord(); 255 CFX_ByteString sFontName = syntax.GetWord();
260 sAlias = PDF_NameDecode(sFontName).Mid(1); 256 sAlias = PDF_NameDecode(sFontName).Mid(1);
261 257
(...skipping 29 matching lines...) Expand all
291 } 287 }
292 288
293 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) 289 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType)
294 { 290 {
295 m_sAPType = sAPType; 291 m_sAPType = sAPType;
296 292
297 Reset(); 293 Reset();
298 Initial(); 294 Initial();
299 } 295 }
300 296
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698