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

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

Issue 2104963002: Change CXFA_Node::GetClassName to return (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « xfa/fxfa/parser/xfa_object.h ('k') | xfa/fxfa/parser/xfa_script_nodehelper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 04b33b47c9f3f501854c1c0d83abb56d62979d30..99198d24f5b532a3f353bc44b2b32efff3128295 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -61,8 +61,8 @@ CXFA_Object::CXFA_Object(CXFA_Document* pDocument,
CXFA_Object::~CXFA_Object() {}
-void CXFA_Object::GetClassName(CFX_WideStringC& wsName) const {
- wsName = XFA_GetElementByID(GetElementType())->pName;
+CFX_WideStringC CXFA_Object::GetClassName() const {
+ return XFA_GetElementByID(GetElementType())->pName;
}
uint32_t CXFA_Object::GetClassHashCode() const {
@@ -77,8 +77,7 @@ void CXFA_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
- CFX_WideStringC className;
- GetClassName(className);
+ CFX_WideStringC className = GetClassName();
pValue->SetString(
FX_UTF8Encode(className.c_str(), className.GetLength()).AsStringC());
} else {
@@ -751,9 +750,8 @@ void CXFA_Node::Script_TreeClass_ClassAll(CFXJSE_Value* pValue,
ThrowException(XFA_IDS_INVAlID_PROP_SET);
} else {
uint32_t dwFlag = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_ALL;
- CFX_WideStringC wsName;
- GetClassName(wsName);
- CFX_WideString wsExpression = FX_WSTRC(L"#") + wsName + FX_WSTRC(L"[*]");
+ CFX_WideString wsExpression =
+ FX_WSTRC(L"#") + GetClassName() + FX_WSTRC(L"[*]");
Script_Som_ResolveNodeList(pValue, wsExpression, dwFlag);
}
}
@@ -965,11 +963,9 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) {
CFDE_XMLNode* pThisXMLRoot = GetXMLMappingNode();
pFakeXMLRoot = pThisXMLRoot ? pThisXMLRoot->Clone(FALSE) : nullptr;
}
- if (!pFakeXMLRoot) {
- CFX_WideStringC wsClassName;
- GetClassName(wsClassName);
- pFakeXMLRoot = new CFDE_XMLElement(CFX_WideString(wsClassName));
- }
+ if (!pFakeXMLRoot)
+ pFakeXMLRoot = new CFDE_XMLElement(CFX_WideString(GetClassName()));
+
if (bIgnoreRoot) {
CFDE_XMLNode* pXMLChild = pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild);
while (pXMLChild) {
« no previous file with comments | « xfa/fxfa/parser/xfa_object.h ('k') | xfa/fxfa/parser/xfa_script_nodehelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698