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

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

Issue 1919563002: Pass CFX_*StringCs to FX_HashCode_GETA and _GETW hash functions. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix issue from c4 Created 4 years, 8 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/css/fde_cssstylesheet.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 #ifndef XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_ 7 #ifndef XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_
8 #define XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_ 8 #define XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_
9 9
10 #include "core/fxcrt/include/fx_ext.h" 10 #include "core/fxcrt/include/fx_ext.h"
11 #include "xfa/fde/css/fde_cssdeclaration.h" 11 #include "xfa/fde/css/fde_cssdeclaration.h"
12 12
13 class CFDE_CSSSelector : public IFDE_CSSSelector, public CFX_Target { 13 class CFDE_CSSSelector : public IFDE_CSSSelector, public CFX_Target {
14 public: 14 public:
15 CFDE_CSSSelector(FDE_CSSSELECTORTYPE eType, 15 CFDE_CSSSelector(FDE_CSSSELECTORTYPE eType,
16 const FX_WCHAR* psz, 16 const FX_WCHAR* psz,
17 int32_t iLen, 17 int32_t iLen,
18 FX_BOOL bIgnoreCase) 18 bool bIgnoreCase)
19 : m_eType(eType), 19 : m_eType(eType),
20 m_dwHash(FX_HashCode_String_GetW(psz, iLen, bIgnoreCase)), 20 m_dwHash(FX_HashCode_GetW(CFX_WideStringC(psz, iLen), bIgnoreCase)),
21 m_pNext(NULL) {} 21 m_pNext(nullptr) {}
22 virtual FDE_CSSSELECTORTYPE GetType() const { return m_eType; } 22 virtual FDE_CSSSELECTORTYPE GetType() const { return m_eType; }
23 23
24 virtual uint32_t GetNameHash() const { return m_dwHash; } 24 virtual uint32_t GetNameHash() const { return m_dwHash; }
25 25
26 virtual IFDE_CSSSelector* GetNextSelector() const { return m_pNext; } 26 virtual IFDE_CSSSelector* GetNextSelector() const { return m_pNext; }
27 static IFDE_CSSSelector* FromString(IFX_MEMAllocator* pStaticStore, 27 static IFDE_CSSSelector* FromString(IFX_MEMAllocator* pStaticStore,
28 const FX_WCHAR* psz, 28 const FX_WCHAR* psz,
29 int32_t iLen); 29 int32_t iLen);
30 void SetNext(IFDE_CSSSelector* pNext) { m_pNext = pNext; } 30 void SetNext(IFDE_CSSSelector* pNext) { m_pNext = pNext; }
31 31
32 protected: 32 protected:
33 static CFDE_CSSSelector* ParseSelector(IFX_MEMAllocator* pStaticStore, 33 static CFDE_CSSSelector* ParseSelector(IFX_MEMAllocator* pStaticStore,
34 const FX_WCHAR* psz, 34 const FX_WCHAR* psz,
35 int32_t& iOff, 35 int32_t& iOff,
36 int32_t iLen, 36 int32_t iLen,
37 FDE_CSSSELECTORTYPE eType); 37 FDE_CSSSELECTORTYPE eType);
38 void SetType(FDE_CSSSELECTORTYPE eType) { m_eType = eType; } 38 void SetType(FDE_CSSSELECTORTYPE eType) { m_eType = eType; }
39 FDE_CSSSELECTORTYPE m_eType; 39 FDE_CSSSELECTORTYPE m_eType;
40 uint32_t m_dwHash; 40 uint32_t m_dwHash;
41 IFDE_CSSSelector* m_pNext; 41 IFDE_CSSSelector* m_pNext;
42 }; 42 };
43 typedef CFX_ArrayTemplate<IFDE_CSSSelector*> CFDE_CSSSelectorArray; 43 typedef CFX_ArrayTemplate<IFDE_CSSSelector*> CFDE_CSSSelectorArray;
44
44 class CFDE_CSSStyleRule : public IFDE_CSSStyleRule, public CFX_Target { 45 class CFDE_CSSStyleRule : public IFDE_CSSStyleRule, public CFX_Target {
45 public: 46 public:
46 CFDE_CSSStyleRule() : m_ppSelector(NULL), m_iSelectors(0) {} 47 CFDE_CSSStyleRule() : m_ppSelector(NULL), m_iSelectors(0) {}
47 virtual int32_t CountSelectorLists() const { return m_iSelectors; } 48 virtual int32_t CountSelectorLists() const { return m_iSelectors; }
48 virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const { 49 virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const {
49 return m_ppSelector[index]; 50 return m_ppSelector[index];
50 } 51 }
51 52
52 virtual IFDE_CSSDeclaration* GetDeclaration() const { 53 virtual IFDE_CSSDeclaration* GetDeclaration() const {
53 return (IFDE_CSSDeclaration*)&m_Declaration; 54 return (IFDE_CSSDeclaration*)&m_Declaration;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 uint16_t m_wRefCount; 133 uint16_t m_wRefCount;
133 uint32_t m_dwMediaList; 134 uint32_t m_dwMediaList;
134 IFX_MEMAllocator* m_pAllocator; 135 IFX_MEMAllocator* m_pAllocator;
135 CFDE_CSSRuleArray m_RuleArray; 136 CFDE_CSSRuleArray m_RuleArray;
136 CFX_WideString m_szUrl; 137 CFX_WideString m_szUrl;
137 CFDE_CSSSelectorArray m_Selectors; 138 CFDE_CSSSelectorArray m_Selectors;
138 CFX_MapPtrToPtr m_StringCache; 139 CFX_MapPtrToPtr m_StringCache;
139 }; 140 };
140 141
141 #endif // XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_ 142 #endif // XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_
OLDNEW
« no previous file with comments | « xfa/fde/css/fde_cssstyleselector.cpp ('k') | xfa/fde/css/fde_cssstylesheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698