summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_nodelocale.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-13 18:29:02 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-13 18:29:02 +0000
commit2614250d4f11ed02033a7da095a1694ece12ab78 (patch)
treecc41c5770c17ea47537856991fa44cd1e2acfeb8 /xfa/fxfa/parser/cxfa_nodelocale.cpp
parent14768f3264a4cff8ca0096a27e41f1861b2c422b (diff)
downloadpdfium-2614250d4f11ed02033a7da095a1694ece12ab78.tar.xz
Methods are on CJX_Object not CJX_Node now
This CL converts all of the JSNode() to JSObject() calls as all of the original CJX_Node methods have been moved to CJX_Object. This fixes potential bad casts from things like CJX_Content which do not inhert from CJX_Node. Bug: pdfium:793372 Change-Id: I6c7f63a78f3d47bb6bad74faed3fd8c535bf095e Reviewed-on: https://pdfium-review.googlesource.com/21090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_nodelocale.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_nodelocale.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/cxfa_nodelocale.cpp b/xfa/fxfa/parser/cxfa_nodelocale.cpp
index da64c4a04c..54440d5834 100644
--- a/xfa/fxfa/parser/cxfa_nodelocale.cpp
+++ b/xfa/fxfa/parser/cxfa_nodelocale.cpp
@@ -43,8 +43,9 @@ CXFA_NodeLocale::CXFA_NodeLocale(CXFA_Node* pLocale) : m_pLocale(pLocale) {}
CXFA_NodeLocale::~CXFA_NodeLocale() {}
WideString CXFA_NodeLocale::GetName() const {
- return WideString(
- m_pLocale ? m_pLocale->JSNode()->GetCData(XFA_Attribute::Name) : nullptr);
+ return WideString(m_pLocale
+ ? m_pLocale->JSObject()->GetCData(XFA_Attribute::Name)
+ : nullptr);
}
WideString CXFA_NodeLocale::GetNumbericSymbol(FX_LOCALENUMSYMBOL eType) const {
@@ -71,7 +72,7 @@ WideString CXFA_NodeLocale::GetDateTimeSymbols() const {
CXFA_Node* pSymbols =
m_pLocale ? m_pLocale->GetChild(0, XFA_Element::DateTimeSymbols, false)
: nullptr;
- return pSymbols ? pSymbols->JSNode()->GetContent(false) : WideString();
+ return pSymbols ? pSymbols->JSObject()->GetContent(false) : WideString();
}
WideString CXFA_NodeLocale::GetMonthName(int32_t nMonth, bool bAbbr) const {
@@ -135,7 +136,7 @@ CXFA_Node* CXFA_NodeLocale::GetNodeByName(CXFA_Node* pParent,
CXFA_Node* pChild =
pParent ? pParent->GetNodeItem(XFA_NODEITEM_FirstChild) : nullptr;
while (pChild) {
- if (pChild->JSNode()->GetAttribute(XFA_Attribute::Name) == wsName)
+ if (pChild->JSObject()->GetAttribute(XFA_Attribute::Name) == wsName)
return pChild;
pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling);
@@ -148,7 +149,7 @@ WideString CXFA_NodeLocale::GetSymbol(XFA_Element eElement,
CXFA_Node* pSymbols =
m_pLocale ? m_pLocale->GetChild(0, eElement, false) : nullptr;
CXFA_Node* pSymbol = GetNodeByName(pSymbols, symbol_type);
- return pSymbol ? pSymbol->JSNode()->GetContent(false) : WideString();
+ return pSymbol ? pSymbol->JSObject()->GetContent(false) : WideString();
}
WideString CXFA_NodeLocale::GetCalendarSymbol(XFA_Element eElement,
@@ -162,9 +163,9 @@ WideString CXFA_NodeLocale::GetCalendarSymbol(XFA_Element eElement,
CXFA_Node* pNode = pCalendar->GetFirstChildByClass(eElement);
for (; pNode; pNode = pNode->GetNextSameClassSibling(eElement)) {
- if (pNode->JSNode()->GetBoolean(XFA_Attribute::Abbr) == bAbbr) {
+ if (pNode->JSObject()->GetBoolean(XFA_Attribute::Abbr) == bAbbr) {
CXFA_Node* pSymbol = pNode->GetChild(index, XFA_Element::Unknown, false);
- return pSymbol ? pSymbol->JSNode()->GetContent(false) : WideString();
+ return pSymbol ? pSymbol->JSObject()->GetContent(false) : WideString();
}
}
return WideString();