diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-28 06:34:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 06:34:24 -0700 |
commit | e6ebf7af7ea94d48091be300cec84b499d3b8ae0 (patch) | |
tree | 82d476bc07d65f39ecb32bebf2de45002cd2d37f /xfa/fxfa | |
parent | 3b5cb78353f92ad7d23ace4e452ed26acf9aeaa7 (diff) | |
download | pdfium-e6ebf7af7ea94d48091be300cec84b499d3b8ae0.tar.xz |
Cleanup IFDE_CSS interfaces.
This CL removes the follwing in favour of their concrete class.
* IFDE_CSSDeclaration
* IFDE_CSSSelector
* IFDE_CSSSyntaxParser
* IFDE_CSSStyleSelector
Review-Url: https://codereview.chromium.org/1928763002
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/app/xfa_textlayout.cpp | 13 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_textlayout.h | 11 |
2 files changed, 13 insertions, 11 deletions
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index e210418337..f2479b7d2f 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -11,6 +11,7 @@ #include "core/fxcrt/include/fx_ext.h" #include "xfa/fde/cfde_path.h" #include "xfa/fde/css/fde_csscache.h" +#include "xfa/fde/css/fde_cssstyleselector.h" #include "xfa/fde/fde_gedevice.h" #include "xfa/fde/fde_object.h" #include "xfa/fde/xml/fde_xml_imp.h" @@ -21,15 +22,15 @@ #include "xfa/fxfa/include/xfa_ffdoc.h" #include "xfa/fxfa/include/xfa_fontmgr.h" -void CXFA_TextParseContext::SetDecls(const IFDE_CSSDeclaration** ppDeclArray, +void CXFA_TextParseContext::SetDecls(const CFDE_CSSDeclaration** ppDeclArray, int32_t iDeclCount) { if (iDeclCount <= 0 || !ppDeclArray) return; m_dwMatchedDecls = iDeclCount; - m_ppMatchedDecls = FX_Alloc(IFDE_CSSDeclaration*, iDeclCount); + m_ppMatchedDecls = FX_Alloc(CFDE_CSSDeclaration*, iDeclCount); FXSYS_memcpy(m_ppMatchedDecls, ppDeclArray, - iDeclCount * sizeof(IFDE_CSSDeclaration*)); + iDeclCount * sizeof(CFDE_CSSDeclaration*)); } CXFA_TextParser::~CXFA_TextParser() { if (m_pUASheet) @@ -71,7 +72,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) { CXFA_FFDoc* pDoc = pTextProvider->GetDocNode(); IFX_FontMgr* pFontMgr = pDoc->GetApp()->GetFDEFontMgr(); ASSERT(pFontMgr); - m_pSelector = IFDE_CSSStyleSelector::Create(); + m_pSelector = new CFDE_CSSStyleSelector; m_pSelector->SetFontMgr(pFontMgr); FX_FLOAT fFontSize = 10; CXFA_Font font = pTextProvider->GetFontNode(); @@ -241,8 +242,8 @@ void CXFA_TextParser::ParseRichText(CFDE_XMLNode* pXMLNode, CFDE_CSSDeclarationArray DeclArray; int32_t iMatchedDecls = m_pSelector->MatchDeclarations(&tagProvider, DeclArray); - const IFDE_CSSDeclaration** ppMatchDecls = - (const IFDE_CSSDeclaration**)DeclArray.GetData(); + const CFDE_CSSDeclaration** ppMatchDecls = + const_cast<const CFDE_CSSDeclaration**>(DeclArray.GetData()); m_pSelector->ComputeStyle(&tagProvider, ppMatchDecls, iMatchedDecls, pNewStyle); pCSSAccel->OnLeaveTag(&tagProvider); diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h index e823448105..bc6719a4df 100644 --- a/xfa/fxfa/app/xfa_textlayout.h +++ b/xfa/fxfa/app/xfa_textlayout.h @@ -17,6 +17,7 @@ #define XFA_LOADERCNTXTFLG_FILTERSPACE 0x001 +class CFDE_CSSStyleSelector; class CXFA_Para; class CXFA_Font; class CXFA_TextProvider; @@ -63,15 +64,15 @@ class CXFA_TextParseContext : public CFX_Target { } void SetDisplay(FDE_CSSDISPLAY eDisplay) { m_eDisplay = eDisplay; } FDE_CSSDISPLAY GetDisplay() const { return m_eDisplay; } - void SetDecls(const IFDE_CSSDeclaration** ppDeclArray, int32_t iDeclCount); - const IFDE_CSSDeclaration** GetDecls() { - return (const IFDE_CSSDeclaration**)m_ppMatchedDecls; + void SetDecls(const CFDE_CSSDeclaration** ppDeclArray, int32_t iDeclCount); + const CFDE_CSSDeclaration** GetDecls() { + return const_cast<const CFDE_CSSDeclaration**>(m_ppMatchedDecls); } uint32_t CountDecls() const { return m_dwMatchedDecls; } IFDE_CSSComputedStyle* m_pParentStyle; protected: - IFDE_CSSDeclaration** m_ppMatchedDecls; + CFDE_CSSDeclaration** m_ppMatchedDecls; uint32_t m_dwMatchedDecls; FDE_CSSDISPLAY m_eDisplay; }; @@ -130,7 +131,7 @@ class CXFA_TextParser { IFDE_CSSStyleSheet* LoadDefaultSheetStyle(); IFDE_CSSComputedStyle* CreateStyle(IFDE_CSSComputedStyle* pParentStyle); IFX_MEMAllocator* m_pAllocator; - IFDE_CSSStyleSelector* m_pSelector; + CFDE_CSSStyleSelector* m_pSelector; IFDE_CSSStyleSheet* m_pUASheet; CFX_MapPtrTemplate<CFDE_XMLNode*, CXFA_TextParseContext*> m_mapXMLNodeToParseContext; |