summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-01-05 11:06:55 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-05 16:36:57 +0000
commit2c0ca7ddbc38e33cc692b2be02c32419b97927e0 (patch)
treeff91c2bc992ec1a718e87f923e70e550f0555160
parent1f04e6111013673880767e98834fa9bb649c7aac (diff)
downloadpdfium-2c0ca7ddbc38e33cc692b2be02c32419b97927e0.tar.xz
Convert GetSOMExpression methods to return WideString
Change-Id: I34eb40ff1c14e7b9362d4e52166243eacc6710da Reviewed-on: https://pdfium-review.googlesource.com/22270 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
-rw-r--r--fxjs/cfxjse_engine.cpp6
-rw-r--r--fxjs/cfxjse_engine.h2
-rw-r--r--fxjs/xfa/cjx_tree.cpp3
-rw-r--r--xfa/fxfa/cxfa_fftextedit.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_object.cpp6
-rw-r--r--xfa/fxfa/parser/cxfa_object.h2
6 files changed, 9 insertions, 14 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index b9cd502e96..179866b555 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -738,11 +738,9 @@ int32_t CFXJSE_Engine::GetIndexByClassName(CXFA_Node* refNode) {
lpNodeHelper->NodeIsProperty(refNode), true);
}
-void CFXJSE_Engine::GetSomExpression(CXFA_Node* refNode,
- WideString& wsExpression) {
+WideString CFXJSE_Engine::GetSomExpression(CXFA_Node* refNode) {
CXFA_NodeHelper* lpNodeHelper = m_ResolveProcessor->GetNodeHelper();
- wsExpression =
- lpNodeHelper->GetNameExpression(refNode, true, XFA_LOGIC_Transparent);
+ return lpNodeHelper->GetNameExpression(refNode, true, XFA_LOGIC_Transparent);
}
void CFXJSE_Engine::SetNodesOfRunScript(std::vector<CXFA_Node*>* pArray) {
diff --git a/fxjs/cfxjse_engine.h b/fxjs/cfxjse_engine.h
index 777921dfc4..0b360bdbb2 100644
--- a/fxjs/cfxjse_engine.h
+++ b/fxjs/cfxjse_engine.h
@@ -70,7 +70,7 @@ class CFXJSE_Engine : public CJS_V8 {
int32_t GetIndexByName(CXFA_Node* refNode);
int32_t GetIndexByClassName(CXFA_Node* refNode);
- void GetSomExpression(CXFA_Node* refNode, WideString& wsExpression);
+ WideString GetSomExpression(CXFA_Node* refNode);
void SetNodesOfRunScript(std::vector<CXFA_Node*>* pArray);
void AddNodesOfRunScript(CXFA_Node* pNode);
diff --git a/fxjs/xfa/cjx_tree.cpp b/fxjs/xfa/cjx_tree.cpp
index 1a20611cad..4a7a2fcc17 100644
--- a/fxjs/xfa/cjx_tree.cpp
+++ b/fxjs/xfa/cjx_tree.cpp
@@ -196,8 +196,7 @@ void CJX_Tree::somExpression(CFXJSE_Value* pValue,
return;
}
- WideString wsSOMExpression;
- GetXFAObject()->GetSOMExpression(wsSOMExpression);
+ WideString wsSOMExpression = GetXFAObject()->GetSOMExpression();
pValue->SetString(wsSOMExpression.UTF8Encode().AsStringView());
}
diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp
index 6f782b34cc..b97b218894 100644
--- a/xfa/fxfa/cxfa_fftextedit.cpp
+++ b/xfa/fxfa/cxfa_fftextedit.cpp
@@ -200,9 +200,7 @@ void CXFA_FFTextEdit::ValidateNumberField(const WideString& wsText) {
if (!pAppProvider)
return;
- WideString wsSomField;
- pAcc->GetNode()->GetSOMExpression(wsSomField);
-
+ WideString wsSomField = pAcc->GetNode()->GetSOMExpression();
pAppProvider->MsgBox(WideString::Format(L"%ls can not contain %ls",
wsText.c_str(), wsSomField.c_str()),
pAppProvider->GetAppTitle(), XFA_MBICON_Error,
diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp
index 93d31244f6..666186c4ba 100644
--- a/xfa/fxfa/parser/cxfa_object.cpp
+++ b/xfa/fxfa/parser/cxfa_object.cpp
@@ -31,12 +31,12 @@ CXFA_Object::CXFA_Object(CXFA_Document* pDocument,
CXFA_Object::~CXFA_Object() {}
-void CXFA_Object::GetSOMExpression(WideString& wsSOMExpression) {
+WideString CXFA_Object::GetSOMExpression() {
CFXJSE_Engine* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext)
- return;
+ return WideString();
- pScriptContext->GetSomExpression(ToNode(this), wsSOMExpression);
+ return pScriptContext->GetSomExpression(ToNode(this));
}
CXFA_Node* CXFA_Object::AsNode() {
diff --git a/xfa/fxfa/parser/cxfa_object.h b/xfa/fxfa/parser/cxfa_object.h
index ce9ce9333b..0b17273316 100644
--- a/xfa/fxfa/parser/cxfa_object.h
+++ b/xfa/fxfa/parser/cxfa_object.h
@@ -75,7 +75,7 @@ class CXFA_Object : public CFXJSE_HostObject {
WideStringView GetClassName() const { return m_elementName; }
uint32_t GetClassHashCode() const { return m_elementNameHash; }
- void GetSOMExpression(WideString& wsSOMExpression);
+ WideString GetSOMExpression();
protected:
CXFA_Object(CXFA_Document* pDocument,