Chromium Code Reviews| Index: xfa/fde/xml/fde_xml_imp.h |
| diff --git a/xfa/fde/xml/fde_xml_imp.h b/xfa/fde/xml/fde_xml_imp.h |
| index b977d693d8d3ce9db5c7cc6651c7f499eb8d9453..464fe5c286684eae9a2540915aa9f9c0d8e6ab34 100644 |
| --- a/xfa/fde/xml/fde_xml_imp.h |
| +++ b/xfa/fde/xml/fde_xml_imp.h |
| @@ -40,29 +40,27 @@ class CFDE_XMLNode : public CFX_Target { |
| }; |
| CFDE_XMLNode(); |
| - virtual ~CFDE_XMLNode(); |
| - |
| - virtual void Release() { delete this; } |
| - virtual FDE_XMLNODETYPE GetType() const { return FDE_XMLNODE_Unknown; } |
| + ~CFDE_XMLNode() override; |
| + |
| + virtual void Release(); |
| + virtual FDE_XMLNODETYPE GetType() const; |
| + virtual int32_t CountChildNodes() const; |
| + virtual CFDE_XMLNode* GetChildNode(int32_t index) const; |
| + virtual int32_t GetChildNodeIndex(CFDE_XMLNode* pNode) const; |
|
Lei Zhang
2016/06/17 03:10:05
Why are these virtual now?
Wei Li
2016/06/17 21:47:45
Rebase madness :(
Thanks for spotting this.
|
| + virtual CFDE_XMLNode* GetPath(const FX_WCHAR* pPath, |
| + int32_t iLength = -1, |
| + FX_BOOL bQualifiedName = TRUE) const; |
| + virtual int32_t InsertChildNode(CFDE_XMLNode* pNode, int32_t index = -1); |
| + virtual void RemoveChildNode(CFDE_XMLNode* pNode); |
| + virtual void DeleteChildren(); |
| + virtual CFDE_XMLNode* GetNodeItem(CFDE_XMLNode::NodeItem eItem) const; |
| + virtual int32_t GetNodeLevel() const; |
| + virtual FX_BOOL InsertNodeItem(CFDE_XMLNode::NodeItem eItem, |
| + CFDE_XMLNode* pNode); |
| + virtual CFDE_XMLNode* RemoveNodeItem(CFDE_XMLNode::NodeItem eItem); |
| virtual CFDE_XMLNode* Clone(FX_BOOL bRecursive); |
| - int32_t CountChildNodes() const; |
| - CFDE_XMLNode* GetChildNode(int32_t index) const; |
| - int32_t GetChildNodeIndex(CFDE_XMLNode* pNode) const; |
| - int32_t InsertChildNode(CFDE_XMLNode* pNode, int32_t index = -1); |
| - void RemoveChildNode(CFDE_XMLNode* pNode); |
| - void DeleteChildren(); |
| void CloneChildren(CFDE_XMLNode* pClone); |
| - |
| - CFDE_XMLNode* GetPath(const FX_WCHAR* pPath, |
| - int32_t iLength = -1, |
| - FX_BOOL bQualifiedName = TRUE) const; |
| - |
| - int32_t GetNodeLevel() const; |
| - CFDE_XMLNode* GetNodeItem(CFDE_XMLNode::NodeItem eItem) const; |
| - FX_BOOL InsertNodeItem(CFDE_XMLNode::NodeItem eItem, CFDE_XMLNode* pNode); |
| - CFDE_XMLNode* RemoveNodeItem(CFDE_XMLNode::NodeItem eItem); |
| - |
| void SaveXMLNode(IFX_Stream* pXMLStream); |
| CFDE_XMLNode* m_pParent; |
| @@ -74,33 +72,35 @@ class CFDE_XMLNode : public CFX_Target { |
| class CFDE_XMLInstruction : public CFDE_XMLNode { |
| public: |
| CFDE_XMLInstruction(const CFX_WideString& wsTarget); |
| - ~CFDE_XMLInstruction() override {} |
| + ~CFDE_XMLInstruction() override; |
| // CFDE_XMLNode |
| - void Release() override { delete this; } |
| - FDE_XMLNODETYPE GetType() const override { return FDE_XMLNODE_Instruction; } |
| + void Release() override; |
| + FDE_XMLNODETYPE GetType() const override; |
| CFDE_XMLNode* Clone(FX_BOOL bRecursive) override; |
| - void GetTargetName(CFX_WideString& wsTarget) const { wsTarget = m_wsTarget; } |
| - int32_t CountAttributes() const; |
| - FX_BOOL GetAttribute(int32_t index, |
| - CFX_WideString& wsAttriName, |
| - CFX_WideString& wsAttriValue) const; |
| - FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const; |
| - void GetString(const FX_WCHAR* pwsAttriName, |
| - CFX_WideString& wsAttriValue, |
| - const FX_WCHAR* pwsDefValue = nullptr) const; |
| - void SetString(const CFX_WideString& wsAttriName, |
| - const CFX_WideString& wsAttriValue); |
| - int32_t GetInteger(const FX_WCHAR* pwsAttriName, int32_t iDefValue = 0) const; |
| - void SetInteger(const FX_WCHAR* pwsAttriName, int32_t iAttriValue); |
| - FX_FLOAT GetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fDefValue = 0) const; |
| - void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue); |
| - void RemoveAttribute(const FX_WCHAR* pwsAttriName); |
| - int32_t CountData() const; |
| - FX_BOOL GetData(int32_t index, CFX_WideString& wsData) const; |
| - void AppendData(const CFX_WideString& wsData); |
| - void RemoveData(int32_t index); |
| + virtual void GetTargetName(CFX_WideString& wsTarget) const; |
|
Lei Zhang
2016/06/17 03:10:05
Ditto
Wei Li
2016/06/17 21:47:45
Done.
|
| + virtual int32_t CountAttributes() const; |
| + virtual FX_BOOL GetAttribute(int32_t index, |
| + CFX_WideString& wsAttriName, |
| + CFX_WideString& wsAttriValue) const; |
| + virtual FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const; |
| + virtual void GetString(const FX_WCHAR* pwsAttriName, |
| + CFX_WideString& wsAttriValue, |
| + const FX_WCHAR* pwsDefValue = nullptr) const; |
| + virtual void SetString(const CFX_WideString& wsAttriName, |
| + const CFX_WideString& wsAttriValue); |
| + virtual int32_t GetInteger(const FX_WCHAR* pwsAttriName, |
| + int32_t iDefValue = 0) const; |
| + virtual void SetInteger(const FX_WCHAR* pwsAttriName, int32_t iAttriValue); |
| + virtual FX_FLOAT GetFloat(const FX_WCHAR* pwsAttriName, |
| + FX_FLOAT fDefValue = 0) const; |
| + virtual void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue); |
| + virtual void RemoveAttribute(const FX_WCHAR* pwsAttriName); |
| + virtual int32_t CountData() const; |
| + virtual FX_BOOL GetData(int32_t index, CFX_WideString& wsData) const; |
| + virtual void AppendData(const CFX_WideString& wsData); |
| + virtual void RemoveData(int32_t index); |
| CFX_WideString m_wsTarget; |
| CFX_WideStringArray m_Attributes; |
| @@ -113,37 +113,33 @@ class CFDE_XMLElement : public CFDE_XMLNode { |
| ~CFDE_XMLElement() override; |
| // CFDE_XMLNode |
| - void Release() override { delete this; } |
| - FDE_XMLNODETYPE GetType() const override { return FDE_XMLNODE_Element; } |
| + void Release() override; |
| + FDE_XMLNODETYPE GetType() const override; |
| CFDE_XMLNode* Clone(FX_BOOL bRecursive) override; |
| - void GetTagName(CFX_WideString& wsTag) const; |
| - void GetLocalTagName(CFX_WideString& wsTag) const; |
| - |
| - void GetNamespacePrefix(CFX_WideString& wsPrefix) const; |
| - void GetNamespaceURI(CFX_WideString& wsNamespace) const; |
| - |
| - int32_t CountAttributes() const; |
| - FX_BOOL GetAttribute(int32_t index, |
| - CFX_WideString& wsAttriName, |
| - CFX_WideString& wsAttriValue) const; |
| - FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const; |
| - void RemoveAttribute(const FX_WCHAR* pwsAttriName); |
| - |
| - void GetString(const FX_WCHAR* pwsAttriName, |
| - CFX_WideString& wsAttriValue, |
| - const FX_WCHAR* pwsDefValue = nullptr) const; |
| - void SetString(const CFX_WideString& wsAttriName, |
| - const CFX_WideString& wsAttriValue); |
| - |
| - int32_t GetInteger(const FX_WCHAR* pwsAttriName, int32_t iDefValue = 0) const; |
| - void SetInteger(const FX_WCHAR* pwsAttriName, int32_t iAttriValue); |
| - |
| - FX_FLOAT GetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fDefValue = 0) const; |
| - void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue); |
| - |
| - void GetTextData(CFX_WideString& wsText) const; |
| - void SetTextData(const CFX_WideString& wsText); |
| + virtual void GetTagName(CFX_WideString& wsTag) const; |
|
Lei Zhang
2016/06/17 03:10:05
Ditto ditto, and more below.
Wei Li
2016/06/17 21:47:45
Done.
|
| + virtual void GetLocalTagName(CFX_WideString& wsTag) const; |
| + virtual void GetNamespacePrefix(CFX_WideString& wsPrefix) const; |
| + virtual void GetNamespaceURI(CFX_WideString& wsNamespace) const; |
| + virtual int32_t CountAttributes() const; |
| + virtual FX_BOOL GetAttribute(int32_t index, |
| + CFX_WideString& wsAttriName, |
| + CFX_WideString& wsAttriValue) const; |
| + virtual FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const; |
| + virtual void GetString(const FX_WCHAR* pwsAttriName, |
| + CFX_WideString& wsAttriValue, |
| + const FX_WCHAR* pwsDefValue = nullptr) const; |
| + virtual void SetString(const CFX_WideString& wsAttriName, |
| + const CFX_WideString& wsAttriValue); |
| + virtual int32_t GetInteger(const FX_WCHAR* pwsAttriName, |
| + int32_t iDefValue = 0) const; |
| + virtual void SetInteger(const FX_WCHAR* pwsAttriName, int32_t iAttriValue); |
| + virtual FX_FLOAT GetFloat(const FX_WCHAR* pwsAttriName, |
| + FX_FLOAT fDefValue = 0) const; |
| + virtual void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue); |
| + virtual void RemoveAttribute(const FX_WCHAR* pwsAttriName); |
| + virtual void GetTextData(CFX_WideString& wsText) const; |
| + virtual void SetTextData(const CFX_WideString& wsText); |
| CFX_WideString m_wsTag; |
| CFX_WideStringArray m_Attributes; |
| @@ -152,15 +148,15 @@ class CFDE_XMLElement : public CFDE_XMLNode { |
| class CFDE_XMLText : public CFDE_XMLNode { |
| public: |
| CFDE_XMLText(const CFX_WideString& wsText); |
| - ~CFDE_XMLText() override {} |
| + ~CFDE_XMLText() override; |
| // CFDE_XMLNode |
| - void Release() override { delete this; } |
| - FDE_XMLNODETYPE GetType() const override { return FDE_XMLNODE_Text; } |
| + void Release() override; |
| + FDE_XMLNODETYPE GetType() const override; |
| CFDE_XMLNode* Clone(FX_BOOL bRecursive) override; |
| - void GetText(CFX_WideString& wsText) const { wsText = m_wsText; } |
| - void SetText(const CFX_WideString& wsText) { m_wsText = wsText; } |
| + virtual void GetText(CFX_WideString& wsText) const; |
| + virtual void SetText(const CFX_WideString& wsText); |
| CFX_WideString m_wsText; |
| }; |
| @@ -174,16 +170,15 @@ class CFDE_XMLDeclaration : public CFDE_XMLNode { |
| class CFDE_XMLCharData : public CFDE_XMLDeclaration { |
| public: |
| CFDE_XMLCharData(const CFX_WideString& wsCData); |
| - ~CFDE_XMLCharData() override {} |
| + ~CFDE_XMLCharData() override; |
| - void Release() override { delete this; } |
| - FDE_XMLNODETYPE GetType() const override { return FDE_XMLNODE_CharData; } |
| + // CFDE_XMLNode |
| + void Release() override; |
| + FDE_XMLNODETYPE GetType() const override; |
| CFDE_XMLNode* Clone(FX_BOOL bRecursive) override; |
| - void GetCharData(CFX_WideString& wsCharData) const { |
| - wsCharData = m_wsCharData; |
| - } |
| - void SetCharData(const CFX_WideString& wsCData) { m_wsCharData = wsCData; } |
| + virtual void GetCharData(CFX_WideString& wsCharData) const; |
| + virtual void SetCharData(const CFX_WideString& wsCData); |
| CFX_WideString m_wsCharData; |
| }; |
| @@ -193,13 +188,13 @@ class CFDE_XMLDoc : public CFX_Target { |
| CFDE_XMLDoc(); |
| ~CFDE_XMLDoc() override; |
| - void Release() { delete this; } |
| - FX_BOOL LoadXML(CFDE_XMLParser* pXMLParser); |
| - int32_t DoLoad(IFX_Pause* pPause = nullptr); |
| - void CloseXML(); |
| - CFDE_XMLNode* GetRoot() const { return m_pRoot; } |
| - void SaveXML(IFX_Stream* pXMLStream = nullptr, FX_BOOL bSaveBOM = TRUE); |
| - void SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pNode); |
| + virtual void Release(); |
| + virtual FX_BOOL LoadXML(CFDE_XMLParser* pXMLParser); |
| + virtual int32_t DoLoad(IFX_Pause* pPause = nullptr); |
| + virtual void CloseXML(); |
| + virtual CFDE_XMLNode* GetRoot() const; |
| + virtual void SaveXML(IFX_Stream* pXMLStream = NULL, FX_BOOL bSaveBOM = TRUE); |
|
Lei Zhang
2016/06/17 03:10:05
nullptr
Wei Li
2016/06/17 21:47:45
Done.
|
| + virtual void SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pNode); |
| protected: |
| void Reset(FX_BOOL bInitRoot); |
| @@ -223,7 +218,7 @@ class CFDE_XMLParser { |
| class CFDE_BlockBuffer : public CFX_Target { |
| public: |
| CFDE_BlockBuffer(int32_t iAllocStep = 1024 * 1024); |
| - ~CFDE_BlockBuffer(); |
| + ~CFDE_BlockBuffer() override; |
| FX_BOOL InitBuffer(int32_t iBufferSize = 1024 * 1024); |
| FX_BOOL IsInitialized() { return m_iBufferSize / m_iAllocStep >= 1; } |
| @@ -259,7 +254,7 @@ class CFDE_BlockBuffer : public CFX_Target { |
| class CFDE_XMLSyntaxParser : public CFX_Target { |
| public: |
| CFDE_XMLSyntaxParser(); |
| - ~CFDE_XMLSyntaxParser(); |
| + ~CFDE_XMLSyntaxParser() override; |
| void Release() { delete this; } |
| void Init(IFX_Stream* pStream, |