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

Side by Side Diff: xfa/fde/css/fde_cssstylesheet.cpp

Issue 1998873002: Clean up XFA code which causes warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 7 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 | « xfa/fde/css/fde_cssstyleselector.cpp ('k') | xfa/fde/xml/fde_xml_imp.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 "xfa/fde/css/fde_cssstylesheet.h" 7 #include "xfa/fde/css/fde_cssstylesheet.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if (pFontFaceRule == NULL) { 314 if (pFontFaceRule == NULL) {
315 pFontFaceRule = FXTARGET_NewWith(m_pAllocator) CFDE_CSSFontFaceRule; 315 pFontFaceRule = FXTARGET_NewWith(m_pAllocator) CFDE_CSSFontFaceRule;
316 ruleArray.Add(pFontFaceRule); 316 ruleArray.Add(pFontFaceRule);
317 } 317 }
318 break; 318 break;
319 case FDE_CSSSYNTAXSTATUS_DeclClose: 319 case FDE_CSSSYNTAXSTATUS_DeclClose:
320 return FDE_CSSSYNTAXSTATUS_None; 320 return FDE_CSSSYNTAXSTATUS_None;
321 FDE_CSSSWITCHDEFAULTS(); 321 FDE_CSSSWITCHDEFAULTS();
322 } 322 }
323 } 323 }
324 return FDE_CSSSYNTAXSTATUS_None;
325 } 324 }
326 FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadImportRule( 325 FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadImportRule(
327 CFDE_CSSSyntaxParser* pSyntax) { 326 CFDE_CSSSyntaxParser* pSyntax) {
328 for (;;) { 327 for (;;) {
329 switch (pSyntax->DoSyntaxParse()) { 328 switch (pSyntax->DoSyntaxParse()) {
330 case FDE_CSSSYNTAXSTATUS_ImportClose: 329 case FDE_CSSSYNTAXSTATUS_ImportClose:
331 return FDE_CSSSYNTAXSTATUS_None; 330 return FDE_CSSSYNTAXSTATUS_None;
332 case FDE_CSSSYNTAXSTATUS_URI: 331 case FDE_CSSSYNTAXSTATUS_URI:
333 break; 332 break;
334 FDE_CSSSWITCHDEFAULTS(); 333 FDE_CSSSWITCHDEFAULTS();
(...skipping 11 matching lines...) Expand all
346 case FDE_CSSSYNTAXSTATUS_Selector: 345 case FDE_CSSSYNTAXSTATUS_Selector:
347 case FDE_CSSSYNTAXSTATUS_DeclOpen: 346 case FDE_CSSSYNTAXSTATUS_DeclOpen:
348 case FDE_CSSSYNTAXSTATUS_PropertyName: 347 case FDE_CSSSYNTAXSTATUS_PropertyName:
349 case FDE_CSSSYNTAXSTATUS_PropertyValue: 348 case FDE_CSSSYNTAXSTATUS_PropertyValue:
350 break; 349 break;
351 case FDE_CSSSYNTAXSTATUS_DeclClose: 350 case FDE_CSSSYNTAXSTATUS_DeclClose:
352 return FDE_CSSSYNTAXSTATUS_None; 351 return FDE_CSSSYNTAXSTATUS_None;
353 FDE_CSSSWITCHDEFAULTS(); 352 FDE_CSSSWITCHDEFAULTS();
354 } 353 }
355 } 354 }
356 return FDE_CSSSYNTAXSTATUS_None;
357 } 355 }
358 void CFDE_CSSStyleRule::SetSelector(IFX_MemoryAllocator* pStaticStore, 356 void CFDE_CSSStyleRule::SetSelector(IFX_MemoryAllocator* pStaticStore,
359 const CFDE_CSSSelectorArray& list) { 357 const CFDE_CSSSelectorArray& list) {
360 ASSERT(m_ppSelector == NULL); 358 ASSERT(m_ppSelector == NULL);
361 m_iSelectors = list.GetSize(); 359 m_iSelectors = list.GetSize();
362 m_ppSelector = static_cast<CFDE_CSSSelector**>( 360 m_ppSelector = static_cast<CFDE_CSSSelector**>(
363 pStaticStore->Alloc(m_iSelectors * sizeof(CFDE_CSSSelector*))); 361 pStaticStore->Alloc(m_iSelectors * sizeof(CFDE_CSSSelector*)));
364 for (int32_t i = 0; i < m_iSelectors; ++i) { 362 for (int32_t i = 0; i < m_iSelectors; ++i) {
365 m_ppSelector[i] = list.GetAt(i); 363 m_ppSelector[i] = list.GetAt(i);
366 } 364 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 return NULL; 494 return NULL;
497 } 495 }
498 } 496 }
499 if (pPersudoFirst == NULL) { 497 if (pPersudoFirst == NULL) {
500 return pFirst; 498 return pFirst;
501 } else { 499 } else {
502 pPersudoLast->SetNext(pFirst); 500 pPersudoLast->SetNext(pFirst);
503 return pPersudoFirst; 501 return pPersudoFirst;
504 } 502 }
505 } 503 }
OLDNEW
« no previous file with comments | « xfa/fde/css/fde_cssstyleselector.cpp ('k') | xfa/fde/xml/fde_xml_imp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698