diff options
author | weili <weili@chromium.org> | 2016-06-16 08:00:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-16 08:00:06 -0700 |
commit | 47bcd4c5c56cdc2d63a0c2ed4e7f68e6ccf523f6 (patch) | |
tree | 90675d8541871a71c6cd9c64723464878bd49a90 /xfa/fxfa/parser/xfa_parser_imp.cpp | |
parent | b63068f04681f7ade9c062a442977c660e3503d0 (diff) | |
download | pdfium-47bcd4c5c56cdc2d63a0c2ed4e7f68e6ccf523f6.tar.xz |
Make code compile with clang_use_chrome_plugin (part V)chromium/2770
This change mainly contains files in xfa/fxfa directory.
This is part of the efforts to make PDFium code compilable
by Clang chromium style plugins.
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/2071683002
Diffstat (limited to 'xfa/fxfa/parser/xfa_parser_imp.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_parser_imp.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 748cca5cad..9cc324ae9d 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -37,6 +37,9 @@ CXFA_SimpleParser::CXFA_SimpleParser(CXFA_Document* pFactory, CXFA_SimpleParser::~CXFA_SimpleParser() { CloseParser(); } +void CXFA_SimpleParser::Release() { + delete this; +} void CXFA_SimpleParser::SetFactory(CXFA_Document* pFactory) { m_pFactory = pFactory; } @@ -191,6 +194,18 @@ void CXFA_SimpleParser::ConstructXFANode(CXFA_Node* pXFANode, } } +CXFA_Document* CXFA_SimpleParser::GetFactory() const { + return m_pFactory; +} + +CXFA_Node* CXFA_SimpleParser::GetRootNode() const { + return m_pRootNode; +} + +CFDE_XMLDoc* CXFA_SimpleParser::GetXMLDoc() const { + return m_pXMLDoc; +} + FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier( CFDE_XMLElement* pNode, const CFX_WideStringC& wsQualifier, @@ -1347,6 +1362,10 @@ CXFA_DocumentParser::CXFA_DocumentParser(CXFA_FFNotify* pNotify) CXFA_DocumentParser::~CXFA_DocumentParser() { CloseParser(); } + +void CXFA_DocumentParser::Release() { + delete this; +} int32_t CXFA_DocumentParser::StartParse(IFX_FileRead* pStream, XFA_XDPPACKET ePacketID) { CloseParser(); @@ -1388,6 +1407,26 @@ void CXFA_DocumentParser::ConstructXFANode(CXFA_Node* pXFANode, } } +CXFA_Document* CXFA_DocumentParser::GetFactory() const { + return m_nodeParser.GetFactory(); +} + +CXFA_Node* CXFA_DocumentParser::GetRootNode() const { + return m_nodeParser.GetRootNode(); +} + +CFDE_XMLDoc* CXFA_DocumentParser::GetXMLDoc() const { + return m_nodeParser.GetXMLDoc(); +} + +CXFA_FFNotify* CXFA_DocumentParser::GetNotify() const { + return m_pNotify; +} + +CXFA_Document* CXFA_DocumentParser::GetDocument() const { + return m_pDocument; +} + void CXFA_DocumentParser::CloseParser() { delete m_pDocument; m_pDocument = nullptr; @@ -1410,6 +1449,7 @@ CXFA_XMLParser::CXFA_XMLParser(CFDE_XMLNode* pRoot, IFX_Stream* pStream) m_pParser = new CFDE_XMLSyntaxParser; m_pParser->Init(m_pStream, 32 * 1024, 1024 * 1024); } + CXFA_XMLParser::~CXFA_XMLParser() { if (m_pParser) { m_pParser->Release(); @@ -1418,6 +1458,11 @@ CXFA_XMLParser::~CXFA_XMLParser() { m_ws1.clear(); m_ws2.clear(); } + +void CXFA_XMLParser::Release() { + delete this; +} + int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) { if (m_syntaxParserResult == FDE_XmlSyntaxResult::Error) return -1; |