diff options
author | weili <weili@chromium.org> | 2016-06-18 06:25:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-18 06:25:37 -0700 |
commit | eec3a366adbfada36b98f1de651546ee09df8fc0 (patch) | |
tree | 794aa8c69392b60d8737a8a5b424732b98bdd4b4 /xfa/fde/css/fde_cssstylesheet.h | |
parent | 4ce94e118d66064715de5baebeb4b2b580dcac66 (diff) | |
download | pdfium-eec3a366adbfada36b98f1de651546ee09df8fc0.tar.xz |
Make code compile with clang_use_chrome_plugin (final)
This change mainly contains files in xfa/ and fxjse/ directories
which were not covered by previous changes.
This is part of the efforts to make PDFium code compilable
by Clang chromium style plugins. After this change, PDFium can be
compiled with "clang_use_chrome_plugin=true" for GN build. Since
clang_use_chrome_plugin is true by default, we no longer need to
set this parameter explicitly.
The changes are mainly the following:
-- move inline constructor/destructor of complex class/struct out-of-line;
-- add constructor/destructor of complex class/struct if not
explicitly defined;
-- add explicit out-of-line copy constructor when needed;
-- move inline virtual functions out-of-line;
-- Properly mark virtual functions with 'override';
-- some minor cleanups;
BUG=pdfium:469
Review-Url: https://codereview.chromium.org/2072803002
Diffstat (limited to 'xfa/fde/css/fde_cssstylesheet.h')
-rw-r--r-- | xfa/fde/css/fde_cssstylesheet.h | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/xfa/fde/css/fde_cssstylesheet.h b/xfa/fde/css/fde_cssstylesheet.h index 4c51579661..83eac993e7 100644 --- a/xfa/fde/css/fde_cssstylesheet.h +++ b/xfa/fde/css/fde_cssstylesheet.h @@ -19,42 +19,37 @@ class CFDE_CSSSelector : public CFX_Target { CFDE_CSSSelector(FDE_CSSSELECTORTYPE eType, const FX_WCHAR* psz, int32_t iLen, - bool bIgnoreCase) - : m_eType(eType), - m_dwHash(FX_HashCode_GetW(CFX_WideStringC(psz, iLen), bIgnoreCase)), - m_pNext(nullptr) {} - virtual FDE_CSSSELECTORTYPE GetType() const { return m_eType; } + bool bIgnoreCase); - virtual uint32_t GetNameHash() const { return m_dwHash; } + virtual FDE_CSSSELECTORTYPE GetType() const; + virtual uint32_t GetNameHash() const; + virtual CFDE_CSSSelector* GetNextSelector() const; - virtual CFDE_CSSSelector* GetNextSelector() const { return m_pNext; } static CFDE_CSSSelector* FromString(IFX_MemoryAllocator* pStaticStore, const FX_WCHAR* psz, int32_t iLen); + void SetNext(CFDE_CSSSelector* pNext) { m_pNext = pNext; } protected: - static CFDE_CSSSelector* ParseSelector(IFX_MemoryAllocator* pStaticStore, - const FX_WCHAR* psz, - int32_t& iOff, - int32_t iLen, - FDE_CSSSELECTORTYPE eType); void SetType(FDE_CSSSELECTORTYPE eType) { m_eType = eType; } + FDE_CSSSELECTORTYPE m_eType; uint32_t m_dwHash; CFDE_CSSSelector* m_pNext; }; + typedef CFX_ArrayTemplate<CFDE_CSSSelector*> CFDE_CSSSelectorArray; class CFDE_CSSStyleRule : public IFDE_CSSStyleRule, public CFX_Target { public: - CFDE_CSSStyleRule() : m_ppSelector(nullptr), m_iSelectors(0) {} - int32_t CountSelectorLists() const override { return m_iSelectors; } - CFDE_CSSSelector* GetSelectorList(int32_t index) const override { - return m_ppSelector[index]; - } + CFDE_CSSStyleRule(); + + // IFDE_CSSStyleRule + int32_t CountSelectorLists() const override; + CFDE_CSSSelector* GetSelectorList(int32_t index) const override; + CFDE_CSSDeclaration* GetDeclaration() override; - CFDE_CSSDeclaration* GetDeclaration() override { return &m_Declaration; } CFDE_CSSDeclaration& GetDeclImp() { return m_Declaration; } void SetSelector(IFX_MemoryAllocator* pStaticStore, const CFDE_CSSSelectorArray& list); @@ -64,37 +59,42 @@ class CFDE_CSSStyleRule : public IFDE_CSSStyleRule, public CFX_Target { CFDE_CSSSelector** m_ppSelector; int32_t m_iSelectors; }; + class CFDE_CSSMediaRule : public IFDE_CSSMediaRule, public CFX_Target { public: - CFDE_CSSMediaRule(uint32_t dwMediaList) : m_dwMediaList(dwMediaList) {} - ~CFDE_CSSMediaRule(); + explicit CFDE_CSSMediaRule(uint32_t dwMediaList); + ~CFDE_CSSMediaRule() override; - virtual uint32_t GetMediaList() const { return m_dwMediaList; } + // IFDE_CSSMediaRule + uint32_t GetMediaList() const override; + int32_t CountRules() const override; + IFDE_CSSRule* GetRule(int32_t index) override; - virtual int32_t CountRules() const { return m_RuleArray.GetSize(); } - virtual IFDE_CSSRule* GetRule(int32_t index) { - return m_RuleArray.GetAt(index); - } CFDE_CSSRuleArray& GetArray() { return m_RuleArray; } protected: uint32_t m_dwMediaList; CFDE_CSSRuleArray m_RuleArray; }; + class CFDE_CSSFontFaceRule : public IFDE_CSSFontFaceRule, public CFX_Target { public: - CFDE_CSSDeclaration* GetDeclaration() override { return &m_Declaration; } + // IFDE_CSSFontFaceRule + CFDE_CSSDeclaration* GetDeclaration() override; + CFDE_CSSDeclaration& GetDeclImp() { return m_Declaration; } protected: CFDE_CSSDeclaration m_Declaration; }; + #define FDE_CSSSWITCHDEFAULTS() \ case FDE_CSSSYNTAXSTATUS_EOS: \ return FDE_CSSSYNTAXSTATUS_EOS; \ case FDE_CSSSYNTAXSTATUS_Error: \ default: \ return FDE_CSSSYNTAXSTATUS_Error; + class CFDE_CSSStyleSheet : public IFDE_CSSStyleSheet, public CFX_Target { public: CFDE_CSSStyleSheet(uint32_t dwMediaList); @@ -105,12 +105,9 @@ class CFDE_CSSStyleSheet : public IFDE_CSSStyleSheet, public CFX_Target { uint32_t Release() override; // IFDE_CSSStyleSheet: - FX_BOOL GetUrl(CFX_WideString& szUrl) override { - szUrl = m_szUrl; - return szUrl.GetLength() > 0; - } - uint32_t GetMediaList() const override { return m_dwMediaList; } - uint16_t GetCodePage() const override { return m_wCodePage; } + FX_BOOL GetUrl(CFX_WideString& szUrl) override; + uint32_t GetMediaList() const override; + uint16_t GetCodePage() const override; int32_t CountRules() const override; IFDE_CSSRule* GetRule(int32_t index) override; |