summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cxml_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/xml/cxml_parser.cpp')
-rw-r--r--core/fxcrt/xml/cxml_parser.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/fxcrt/xml/cxml_parser.cpp b/core/fxcrt/xml/cxml_parser.cpp
index 3c91d744ec..d43fbd6581 100644
--- a/core/fxcrt/xml/cxml_parser.cpp
+++ b/core/fxcrt/xml/cxml_parser.cpp
@@ -6,6 +6,7 @@
#include <algorithm>
#include <memory>
+#include <utility>
#include <vector>
#include "core/fxcrt/fx_extension.h"
@@ -493,8 +494,7 @@ std::unique_ptr<CXML_Element> CXML_Parser::ParseElementInternal(
if (!pSubElement)
break;
- pElement->m_Children.push_back(
- {CXML_Element::Element, pSubElement.release()});
+ pElement->m_Children.push_back(std::move(pSubElement));
SkipWhiteSpaces();
}
break;
@@ -537,7 +537,6 @@ void CXML_Parser::InsertContentSegment(bool bCDATA,
if (content.IsEmpty())
return;
- CXML_Content* pContent = new CXML_Content;
- pContent->Set(bCDATA, content);
- pElement->m_Children.push_back({CXML_Element::Content, pContent});
+ pElement->m_Children.push_back(
+ pdfium::MakeUnique<CXML_Content>(bCDATA, content));
}