summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_localemgr.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 20:51:03 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 20:51:03 +0000
commitdf4f30eaaa469c3703118f89579d506209a49237 (patch)
tree881eb4c93dadd3b07414cc950ed5cbbbb3c9693a /xfa/fxfa/parser/cxfa_localemgr.cpp
parent51ef4a6ca3b4ae9b618cb1c96f84697a2bf4a2b1 (diff)
downloadpdfium-df4f30eaaa469c3703118f89579d506209a49237.tar.xz
Add types to the CXFA_Node::Get*{Child|Sibling}* methods
This CL templates the various Get methods in CXFA_Node in order to return the correct node type. Change-Id: I4f50df6dd9213873deb8f8f262eaf579c6c4ca7d Reviewed-on: https://pdfium-review.googlesource.com/21230 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_localemgr.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_localemgr.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp
index e7aa09b52d..323a63dd72 100644
--- a/xfa/fxfa/parser/cxfa_localemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_localemgr.cpp
@@ -16,8 +16,12 @@
#include "core/fxcodec/fx_codec.h"
#include "core/fxcrt/xml/cxml_element.h"
#include "third_party/base/ptr_util.h"
+#include "xfa/fxfa/parser/cxfa_acrobat.h"
+#include "xfa/fxfa/parser/cxfa_common.h"
+#include "xfa/fxfa/parser/cxfa_locale.h"
#include "xfa/fxfa/parser/cxfa_node.h"
#include "xfa/fxfa/parser/cxfa_nodelocale.h"
+#include "xfa/fxfa/parser/cxfa_present.h"
#include "xfa/fxfa/parser/cxfa_xmllocale.h"
#include "xfa/fxfa/parser/xfa_utils.h"
@@ -1225,17 +1229,19 @@ WideStringView CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) {
m_wsConfigLocale.clear();
if (pConfig) {
CXFA_Node* pChildfConfig =
- pConfig->GetFirstChildByClass(XFA_Element::Acrobat);
+ pConfig->GetFirstChildByClass<CXFA_Acrobat>(XFA_Element::Acrobat);
if (!pChildfConfig) {
- pChildfConfig = pConfig->GetFirstChildByClass(XFA_Element::Present);
+ pChildfConfig =
+ pConfig->GetFirstChildByClass<CXFA_Present>(XFA_Element::Present);
}
- CXFA_Node* pCommon =
- pChildfConfig
- ? pChildfConfig->GetFirstChildByClass(XFA_Element::Common)
+ CXFA_Common* pCommon =
+ pChildfConfig ? pChildfConfig->GetFirstChildByClass<CXFA_Common>(
+ XFA_Element::Common)
+ : nullptr;
+ CXFA_Locale* pLocale =
+ pCommon
+ ? pCommon->GetFirstChildByClass<CXFA_Locale>(XFA_Element::Locale)
: nullptr;
- CXFA_Node* pLocale =
- pCommon ? pCommon->GetFirstChildByClass(XFA_Element::Locale)
- : nullptr;
if (pLocale) {
m_wsConfigLocale = pLocale->JSObject()
->TryCData(XFA_Attribute::Value, false)