summaryrefslogtreecommitdiff
path: root/xfa/fde/xml/fde_xml_imp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fde/xml/fde_xml_imp.cpp')
-rw-r--r--xfa/fde/xml/fde_xml_imp.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/xfa/fde/xml/fde_xml_imp.cpp b/xfa/fde/xml/fde_xml_imp.cpp
index f333b4fcda..7880804367 100644
--- a/xfa/fde/xml/fde_xml_imp.cpp
+++ b/xfa/fde/xml/fde_xml_imp.cpp
@@ -7,6 +7,7 @@
#include "xfa/fde/xml/fde_xml_imp.h"
#include <algorithm>
+#include <utility>
#include "core/fxcrt/fx_ext.h"
#include "core/fxcrt/fx_safe_types.h"
@@ -957,29 +958,27 @@ void CFDE_XMLDoc::Reset(bool bInitRoot) {
}
void CFDE_XMLDoc::ReleaseParser() {
- if (m_pXMLParser) {
- m_pXMLParser->Release();
- m_pXMLParser = nullptr;
- }
+ m_pXMLParser.reset();
if (m_pSyntaxParser) {
m_pSyntaxParser->Release();
m_pSyntaxParser = nullptr;
}
}
-bool CFDE_XMLDoc::LoadXML(CFDE_XMLParser* pXMLParser) {
+bool CFDE_XMLDoc::LoadXML(std::unique_ptr<IFDE_XMLParser> pXMLParser) {
if (!pXMLParser)
return false;
Reset(true);
- m_pXMLParser = pXMLParser;
- return !!m_pXMLParser;
+ m_pXMLParser = std::move(pXMLParser);
+ return true;
}
int32_t CFDE_XMLDoc::DoLoad(IFX_Pause* pPause) {
- if (m_iStatus >= 100)
- return m_iStatus;
- return m_iStatus = m_pXMLParser->DoParser(pPause);
+ if (m_iStatus < 100)
+ m_iStatus = m_pXMLParser->DoParser(pPause);
+
+ return m_iStatus;
}
void CFDE_XMLDoc::CloseXML() {