| OLD | NEW |
| 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 "xfa/fde/css/fde_cssdatatable.h" | 9 #include "xfa/fde/css/fde_cssdatatable.h" |
| 10 #include "xfa/fde/css/fde_csssyntax.h" | 10 #include "xfa/fde/css/fde_csssyntax.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 case FDE_CSSSYNTAXSTATUS_PropertyValue: | 257 case FDE_CSSSYNTAXSTATUS_PropertyValue: |
| 258 if (propertyArgs.pProperty != NULL) { | 258 if (propertyArgs.pProperty != NULL) { |
| 259 pszValue = pSyntax->GetCurrentString(iValueLen); | 259 pszValue = pSyntax->GetCurrentString(iValueLen); |
| 260 if (iValueLen > 0) { | 260 if (iValueLen > 0) { |
| 261 pStyleRule->GetDeclImp().AddProperty(&propertyArgs, pszValue, | 261 pStyleRule->GetDeclImp().AddProperty(&propertyArgs, pszValue, |
| 262 iValueLen); | 262 iValueLen); |
| 263 } | 263 } |
| 264 } else if (iValueLen > 0) { | 264 } else if (iValueLen > 0) { |
| 265 pszValue = pSyntax->GetCurrentString(iValueLen); | 265 pszValue = pSyntax->GetCurrentString(iValueLen); |
| 266 if (iValueLen > 0) { | 266 if (iValueLen > 0) { |
| 267 pStyleRule->GetDeclImp().AddProperty( | 267 pStyleRule->GetDeclImp().AddProperty(&propertyArgs, wsName.c_str(), |
| 268 &propertyArgs, wsName, wsName.GetLength(), pszValue, iValueLen); | 268 wsName.GetLength(), pszValue, |
| 269 iValueLen); |
| 269 } | 270 } |
| 270 } | 271 } |
| 271 break; | 272 break; |
| 272 case FDE_CSSSYNTAXSTATUS_DeclOpen: | 273 case FDE_CSSSYNTAXSTATUS_DeclOpen: |
| 273 if (pStyleRule == NULL && m_Selectors.GetSize() > 0) { | 274 if (pStyleRule == NULL && m_Selectors.GetSize() > 0) { |
| 274 pStyleRule = FXTARGET_NewWith(m_pAllocator) CFDE_CSSStyleRule; | 275 pStyleRule = FXTARGET_NewWith(m_pAllocator) CFDE_CSSStyleRule; |
| 275 pStyleRule->SetSelector(m_pAllocator, m_Selectors); | 276 pStyleRule->SetSelector(m_pAllocator, m_Selectors); |
| 276 ruleArray.Add(pStyleRule); | 277 ruleArray.Add(pStyleRule); |
| 277 } else { | 278 } else { |
| 278 SkipRuleSet(pSyntax); | 279 SkipRuleSet(pSyntax); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 return NULL; | 501 return NULL; |
| 501 } | 502 } |
| 502 } | 503 } |
| 503 if (pPersudoFirst == NULL) { | 504 if (pPersudoFirst == NULL) { |
| 504 return pFirst; | 505 return pFirst; |
| 505 } else { | 506 } else { |
| 506 pPersudoLast->SetNext(pFirst); | 507 pPersudoLast->SetNext(pFirst); |
| 507 return pPersudoFirst; | 508 return pPersudoFirst; |
| 508 } | 509 } |
| 509 } | 510 } |
| OLD | NEW |