Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: xfa/fxfa/parser/xfa_object_imp.cpp

Issue 1841173002: Rename GetElementValue() to GetDirectObject{By,At}(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use "At" for arrays. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fxfa/parser/xfa_object_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index fad2b26d4e6a382c1e07fcd346245b0e73129a0d..04f0e7e2964ba8a822151dd81d27a35315b2c18f 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -24,10 +24,10 @@
CXFA_Object::CXFA_Object(CXFA_Document* pDocument, uint32_t uFlags)
: m_pDocument(pDocument), m_uFlags(uFlags) {}
void CXFA_Object::GetClassName(CFX_WideStringC& wsName) const {
- wsName = XFA_GetElementByID(GetClassID())->pName;
+ wsName = XFA_GetObjectByByID(GetClassID())->pName;
}
uint32_t CXFA_Object::GetClassHashCode() const {
- return XFA_GetElementByID(GetClassID())->uHash;
+ return XFA_GetObjectByByID(GetClassID())->uHash;
}
XFA_ELEMENT CXFA_Object::GetClassID() const {
if (IsNode()) {
@@ -82,13 +82,13 @@ static void XFA_CopyWideString(void*& pData) {
}
static XFA_MAPDATABLOCKCALLBACKINFO deleteWideStringCallBack = {
XFA_DeleteWideString, XFA_CopyWideString};
-static XFA_OBJECTTYPE XFA_GetElementObjectType(XFA_ELEMENT eElement) {
- return (XFA_OBJECTTYPE)XFA_GetElementByID(eElement)->eObjectType;
+static XFA_OBJECTTYPE XFA_GetObjectByObjectType(XFA_ELEMENT eElement) {
+ return (XFA_OBJECTTYPE)XFA_GetObjectByByID(eElement)->eObjectType;
}
CXFA_Node::CXFA_Node(CXFA_Document* pDoc,
uint16_t ePacket,
XFA_ELEMENT eElement)
- : CXFA_Object(pDoc, XFA_GetElementObjectType(eElement)),
+ : CXFA_Object(pDoc, XFA_GetObjectByObjectType(eElement)),
m_pNext(nullptr),
m_pChild(nullptr),
m_pLastChild(nullptr),
@@ -279,7 +279,7 @@ int32_t CXFA_Node::GetNodeList(CXFA_NodeArray& nodes,
if (bFilterOneOfProperties && nodes.GetSize() < 1) {
int32_t iProperties = 0;
const XFA_PROPERTY* pProperty =
- XFA_GetElementProperties(GetClassID(), iProperties);
+ XFA_GetObjectByProperties(GetClassID(), iProperties);
if (pProperty == NULL || iProperties < 1) {
return 0;
}
@@ -876,7 +876,7 @@ void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) {
FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue));
}
}
-void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) {
+void CXFA_Node::Script_NodeClass_GetObjectBy(CFXJSE_Arguments* pArguments) {
int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 2) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getElement");
@@ -892,7 +892,7 @@ void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) {
if (iLength >= 2) {
iValue = pArguments->GetInt32(1);
}
- const XFA_ELEMENTINFO* pElementInfo = XFA_GetElementByName(wsExpression);
+ const XFA_ELEMENTINFO* pElementInfo = XFA_GetObjectByByName(wsExpression);
dsinclair 2016/03/29 20:45:25 ByBy
CXFA_Node* pNode = GetProperty(iValue, pElementInfo->eName);
FXJSE_Value_Set(pArguments->GetReturnValue(),
m_pDocument->GetScriptContext()->GetJSValueFromMap(pNode));
@@ -927,7 +927,7 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified(
bHas = HasAttribute(pAttributeInfo->eName);
}
if (!bHas) {
- const XFA_ELEMENTINFO* pElementInfo = XFA_GetElementByName(wsExpression);
+ const XFA_ELEMENTINFO* pElementInfo = XFA_GetObjectByByName(wsExpression);
bHas = (GetProperty(iIndex, pElementInfo->eName) != NULL);
}
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
@@ -2721,7 +2721,7 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) {
CFX_WideString::FromUTF8(bsNameSpace, bsNameSpace.GetLength());
}
}
- const XFA_ELEMENTINFO* pElement = XFA_GetElementByName(strTagName);
+ const XFA_ELEMENTINFO* pElement = XFA_GetObjectByByName(strTagName);
CXFA_Node* pNewNode = CreateSamePacketNode(pElement->eName);
if (!pNewNode) {
FXJSE_Value_SetNull(pArguments->GetReturnValue());

Powered by Google App Engine
This is Rietveld 408576698