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_cssdatatable.h" | 7 #include "xfa/fde/css/fde_cssdatatable.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fgas/crt/fgas_algorithm.h" | 10 #include "xfa/fgas/crt/fgas_algorithm.h" |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 FDE_LPCCSSCOLORTABLE pColor = | 772 FDE_LPCCSSCOLORTABLE pColor = |
773 FDE_GetCSSColorByName(CFX_WideStringC(pszValue, iValueLen)); | 773 FDE_GetCSSColorByName(CFX_WideStringC(pszValue, iValueLen)); |
774 if (pColor != NULL) { | 774 if (pColor != NULL) { |
775 dwColor = pColor->dwValue; | 775 dwColor = pColor->dwValue; |
776 return TRUE; | 776 return TRUE; |
777 } | 777 } |
778 } | 778 } |
779 return FALSE; | 779 return FALSE; |
780 } | 780 } |
781 | 781 |
782 CFDE_CSSValueList::CFDE_CSSValueList(IFX_MEMAllocator* pStaticStore, | 782 CFDE_CSSValueList::CFDE_CSSValueList(IFX_MemoryAllocator* pStaticStore, |
783 const CFDE_CSSValueArray& list) { | 783 const CFDE_CSSValueArray& list) { |
784 m_iCount = list.GetSize(); | 784 m_iCount = list.GetSize(); |
785 int32_t iByteCount = m_iCount * sizeof(IFDE_CSSValue*); | 785 int32_t iByteCount = m_iCount * sizeof(IFDE_CSSValue*); |
786 m_ppList = (IFDE_CSSValue**)pStaticStore->Alloc(iByteCount); | 786 m_ppList = (IFDE_CSSValue**)pStaticStore->Alloc(iByteCount); |
787 FXSYS_memcpy(m_ppList, list.GetData(), iByteCount); | 787 FXSYS_memcpy(m_ppList, list.GetData(), iByteCount); |
788 } | 788 } |
789 FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE& eType, | 789 FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE& eType, |
790 const FX_WCHAR*& pStart, | 790 const FX_WCHAR*& pStart, |
791 int32_t& iLength) { | 791 int32_t& iLength) { |
792 while (m_pCur < m_pEnd && (*m_pCur <= ' ' || *m_pCur == m_Separator)) { | 792 while (m_pCur < m_pEnd && (*m_pCur <= ' ' || *m_pCur == m_Separator)) { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 } | 880 } |
881 while (iBracketCount > 0 && m_pCur < m_pEnd) { | 881 while (iBracketCount > 0 && m_pCur < m_pEnd) { |
882 if (*m_pCur == ')') { | 882 if (*m_pCur == ')') { |
883 iBracketCount--; | 883 iBracketCount--; |
884 } | 884 } |
885 m_pCur++; | 885 m_pCur++; |
886 } | 886 } |
887 } | 887 } |
888 return m_pCur - pStart; | 888 return m_pCur - pStart; |
889 } | 889 } |
OLD | NEW |