diff options
author | dan sinclair <dsinclair@chromium.org> | 2018-04-13 16:44:05 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-13 16:44:05 +0000 |
commit | 27e364389e507f69ee9dc256cd4dbe558d05f887 (patch) | |
tree | e4da5ff121e54da5c3beeba7a047799536beb4d6 /xfa/fxfa/parser/cxfa_localemgr.cpp | |
parent | e04b66cc759c2cf0ceafae47340fdf9588ca2e23 (diff) | |
download | pdfium-27e364389e507f69ee9dc256cd4dbe558d05f887.tar.xz |
Hide XML parsing inside CXFA_XMLLocale
This CL moves the parsing of the XML document into a static method of
CXFA_XMLLocale. This removes the need for CXFA_LocaleMgr to care about
the XML parser used.
Change-Id: I04d14d78f458bfb37f0370fac2eb752e9840bfd6
Reviewed-on: https://pdfium-review.googlesource.com/30390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_localemgr.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_localemgr.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp index 277ba38eb9..5ad0ce2438 100644 --- a/xfa/fxfa/parser/cxfa_localemgr.cpp +++ b/xfa/fxfa/parser/cxfa_localemgr.cpp @@ -14,7 +14,6 @@ #include "core/fpdfapi/cpdf_modulemgr.h" #include "core/fxcodec/codec/ccodec_flatemodule.h" #include "core/fxcodec/fx_codec.h" -#include "core/fxcrt/xml/cxml_element.h" #include "fxjs/xfa/cjx_object.h" #include "third_party/base/ptr_util.h" #include "xfa/fxfa/parser/cxfa_acrobat.h" @@ -1080,10 +1079,9 @@ std::unique_ptr<LocaleIface> GetLocaleFromBuffer(const uint8_t* pBuf, if (!pOut) return nullptr; - std::unique_ptr<CXML_Element> pLocale = CXML_Element::Parse(pOut, dwSize); + auto locale = CXFA_XMLLocale::Create(pdfium::make_span(pOut, dwSize)); FX_Free(pOut); - return pLocale ? pdfium::MakeUnique<CXFA_XMLLocale>(std::move(pLocale)) - : nullptr; + return locale; } uint16_t GetLanguage(WideString wsLanguage) { |