diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-17 19:28:52 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-17 19:28:52 +0000 |
commit | 3a6d058740a9908a06efb9e9362df01acdee6ff8 (patch) | |
tree | 9bc645b0cb3442749458fc63e2feb04c0cb813ef /fxjs/xfa/cjx_instancemanager.cpp | |
parent | 0a2328e0eff7a11aa49b7da8f013e658153a7b1a (diff) | |
download | pdfium-3a6d058740a9908a06efb9e9362df01acdee6ff8.tar.xz |
Rename CJS_Return to CJS_Result.
"Return" is a verb, and "return" is a reserved-word at that,
so avoid using it as part of a class name.
Fully mechanical change apart from rename.
Change-Id: I120e453e8ba001c4ab74a39e2da6aa6eb590835f
Reviewed-on: https://pdfium-review.googlesource.com/40532
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/xfa/cjx_instancemanager.cpp')
-rw-r--r-- | fxjs/xfa/cjx_instancemanager.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/fxjs/xfa/cjx_instancemanager.cpp b/fxjs/xfa/cjx_instancemanager.cpp index ce00af18e6..b36fddc4fc 100644 --- a/fxjs/xfa/cjx_instancemanager.cpp +++ b/fxjs/xfa/cjx_instancemanager.cpp @@ -133,15 +133,15 @@ int32_t CJX_InstanceManager::MoveInstance(int32_t iTo, int32_t iFrom) { return 0; } -CJS_Return CJX_InstanceManager::moveInstance( +CJS_Result CJX_InstanceManager::moveInstance( CFX_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) { CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument(); if (doc->GetFormType() != FormType::kXFAFull) - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); if (params.size() != 2) - return CJS_Return::Failure(JSMessage::kParamError); + return CJS_Result::Failure(JSMessage::kParamError); int32_t iFrom = runtime->ToInt32(params[0]); int32_t iTo = runtime->ToInt32(params[1]); @@ -149,7 +149,7 @@ CJS_Return CJX_InstanceManager::moveInstance( CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); if (!pNotify) - return CJS_Return::Success(); + return CJS_Result::Success(); CXFA_Node* pToInstance = GetXFANode()->GetItemIfExists(iTo); if (pToInstance && pToInstance->GetElementType() == XFA_Element::Subform) @@ -161,32 +161,32 @@ CJS_Return CJX_InstanceManager::moveInstance( pNotify->RunSubformIndexChange(pFromInstance); } - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJX_InstanceManager::removeInstance( +CJS_Result CJX_InstanceManager::removeInstance( CFX_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) { CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument(); if (doc->GetFormType() != FormType::kXFAFull) - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); if (params.size() != 1) - return CJS_Return::Failure(JSMessage::kParamError); + return CJS_Result::Failure(JSMessage::kParamError); int32_t iIndex = runtime->ToInt32(params[0]); int32_t iCount = GetXFANode()->GetCount(); if (iIndex < 0 || iIndex >= iCount) - return CJS_Return::Failure(JSMessage::kInvalidInputError); + return CJS_Result::Failure(JSMessage::kInvalidInputError); CXFA_Occur* occur = GetXFANode()->GetOccurIfExists(); int32_t iMin = occur ? occur->GetMin() : CXFA_Occur::kDefaultMin; if (iCount - 1 < iMin) - return CJS_Return::Failure(JSMessage::kTooManyOccurances); + return CJS_Result::Failure(JSMessage::kTooManyOccurances); CXFA_Node* pRemoveInstance = GetXFANode()->GetItemIfExists(iIndex); if (!pRemoveInstance) - return CJS_Return::Failure(JSMessage::kParamError); + return CJS_Result::Failure(JSMessage::kParamError); GetXFANode()->RemoveItem(pRemoveInstance, true); @@ -205,32 +205,32 @@ CJS_Return CJX_InstanceManager::removeInstance( pLayoutPro->AddChangedContainer( ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Form))); } - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJX_InstanceManager::setInstances( +CJS_Result CJX_InstanceManager::setInstances( CFX_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) { CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument(); if (doc->GetFormType() != FormType::kXFAFull) - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); if (params.size() != 1) - return CJS_Return::Failure(JSMessage::kParamError); + return CJS_Result::Failure(JSMessage::kParamError); SetInstances(runtime->ToInt32(params[0])); - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJX_InstanceManager::addInstance( +CJS_Result CJX_InstanceManager::addInstance( CFX_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) { CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument(); if (doc->GetFormType() != FormType::kXFAFull) - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); if (!params.empty() && params.size() != 1) - return CJS_Return::Failure(JSMessage::kParamError); + return CJS_Result::Failure(JSMessage::kParamError); bool fFlags = true; if (params.size() == 1) @@ -240,11 +240,11 @@ CJS_Return CJX_InstanceManager::addInstance( CXFA_Occur* occur = GetXFANode()->GetOccurIfExists(); int32_t iMax = occur ? occur->GetMax() : CXFA_Occur::kDefaultMax; if (iMax >= 0 && iCount >= iMax) - return CJS_Return::Failure(JSMessage::kTooManyOccurances); + return CJS_Result::Failure(JSMessage::kTooManyOccurances); CXFA_Node* pNewInstance = GetXFANode()->CreateInstanceIfPossible(fFlags); if (!pNewInstance) - return CJS_Return::Success(runtime->NewNull()); + return CJS_Result::Success(runtime->NewNull()); GetXFANode()->InsertItem(pNewInstance, iCount, iCount, false); @@ -262,21 +262,21 @@ CJS_Return CJX_InstanceManager::addInstance( CFXJSE_Value* value = GetDocument()->GetScriptContext()->GetJSValueFromMap(pNewInstance); if (!value) - return CJS_Return::Success(runtime->NewNull()); + return CJS_Result::Success(runtime->NewNull()); - return CJS_Return::Success( + return CJS_Result::Success( value->DirectGetValue().Get(runtime->GetIsolate())); } -CJS_Return CJX_InstanceManager::insertInstance( +CJS_Result CJX_InstanceManager::insertInstance( CFX_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) { CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument(); if (doc->GetFormType() != FormType::kXFAFull) - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); if (params.size() != 1 && params.size() != 2) - return CJS_Return::Failure(JSMessage::kParamError); + return CJS_Result::Failure(JSMessage::kParamError); int32_t iIndex = runtime->ToInt32(params[0]); bool bBind = false; @@ -285,16 +285,16 @@ CJS_Return CJX_InstanceManager::insertInstance( int32_t iCount = GetXFANode()->GetCount(); if (iIndex < 0 || iIndex > iCount) - return CJS_Return::Failure(JSMessage::kInvalidInputError); + return CJS_Result::Failure(JSMessage::kInvalidInputError); CXFA_Occur* occur = GetXFANode()->GetOccurIfExists(); int32_t iMax = occur ? occur->GetMax() : CXFA_Occur::kDefaultMax; if (iMax >= 0 && iCount >= iMax) - return CJS_Return::Failure(JSMessage::kInvalidInputError); + return CJS_Result::Failure(JSMessage::kInvalidInputError); CXFA_Node* pNewInstance = GetXFANode()->CreateInstanceIfPossible(bBind); if (!pNewInstance) - return CJS_Return::Success(runtime->NewNull()); + return CJS_Result::Success(runtime->NewNull()); GetXFANode()->InsertItem(pNewInstance, iIndex, iCount, true); @@ -311,9 +311,9 @@ CJS_Return CJX_InstanceManager::insertInstance( CFXJSE_Value* value = GetDocument()->GetScriptContext()->GetJSValueFromMap(pNewInstance); if (!value) - return CJS_Return::Success(runtime->NewNull()); + return CJS_Result::Success(runtime->NewNull()); - return CJS_Return::Success( + return CJS_Result::Success( value->DirectGetValue().Get(runtime->GetIsolate())); } |