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_cssstyleselector.h" | 7 #include "xfa/fde/css/fde_cssstyleselector.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 } | 536 } |
537 } | 537 } |
538 void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration* pDecl, | 538 void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration* pDecl, |
539 const FX_WCHAR* psz, | 539 const FX_WCHAR* psz, |
540 int32_t iLen) { | 540 int32_t iLen) { |
541 ASSERT(pDecl && psz && iLen > 0); | 541 ASSERT(pDecl && psz && iLen > 0); |
542 std::unique_ptr<CFDE_CSSSyntaxParser> pSyntax(new CFDE_CSSSyntaxParser); | 542 std::unique_ptr<CFDE_CSSSyntaxParser> pSyntax(new CFDE_CSSSyntaxParser); |
543 if (!pSyntax->Init(psz, iLen, 32, TRUE)) | 543 if (!pSyntax->Init(psz, iLen, 32, TRUE)) |
544 return; | 544 return; |
545 | 545 |
546 int32_t iLen2; | 546 int32_t iLen2 = 0; |
547 const FX_WCHAR* psz2; | 547 const FX_WCHAR* psz2; |
548 FDE_CSSPROPERTYARGS args; | 548 FDE_CSSPROPERTYARGS args; |
549 args.pStringCache = nullptr; | 549 args.pStringCache = nullptr; |
550 args.pStaticStore = m_pInlineStyleStore; | 550 args.pStaticStore = m_pInlineStyleStore; |
551 args.pProperty = nullptr; | 551 args.pProperty = nullptr; |
552 CFX_WideString wsName; | 552 CFX_WideString wsName; |
553 while (1) { | 553 while (1) { |
554 FDE_CSSSYNTAXSTATUS eStatus = pSyntax->DoSyntaxParse(); | 554 FDE_CSSSYNTAXSTATUS eStatus = pSyntax->DoSyntaxParse(); |
555 if (eStatus == FDE_CSSSYNTAXSTATUS_PropertyName) { | 555 if (eStatus == FDE_CSSSYNTAXSTATUS_PropertyName) { |
556 psz2 = pSyntax->GetCurrentString(iLen2); | 556 psz2 = pSyntax->GetCurrentString(iLen2); |
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1774 return FDE_CSSTEXTTRANSFORM_LowerCase; | 1774 return FDE_CSSTEXTTRANSFORM_LowerCase; |
1775 default: | 1775 default: |
1776 return FDE_CSSTEXTTRANSFORM_None; | 1776 return FDE_CSSTEXTTRANSFORM_None; |
1777 } | 1777 } |
1778 } | 1778 } |
1779 FDE_CSSFONTVARIANT CFDE_CSSStyleSelector::ToFontVariant( | 1779 FDE_CSSFONTVARIANT CFDE_CSSStyleSelector::ToFontVariant( |
1780 FDE_CSSPROPERTYVALUE eValue) { | 1780 FDE_CSSPROPERTYVALUE eValue) { |
1781 return eValue == FDE_CSSPROPERTYVALUE_SmallCaps ? FDE_CSSFONTVARIANT_SmallCaps | 1781 return eValue == FDE_CSSPROPERTYVALUE_SmallCaps ? FDE_CSSFONTVARIANT_SmallCaps |
1782 : FDE_CSSFONTVARIANT_Normal; | 1782 : FDE_CSSFONTVARIANT_Normal; |
1783 } | 1783 } |
OLD | NEW |