diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-08 18:23:05 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-08 18:23:05 +0000 |
commit | 1699982f45d01cb18585eba80cce5326a63d3b67 (patch) | |
tree | 537d81d989632bab75fda37f5b587e1309e60d5d /fxjs/xfa/cjx_field.cpp | |
parent | f29479d47156d180c0b71f6c98aa4de37c2a7ee2 (diff) | |
download | pdfium-1699982f45d01cb18585eba80cce5326a63d3b67.tar.xz |
Ensure CJS_Return() with error always includes a message.
Change the signature of the constructors to make it impossible to
do this otherwise.
Change-Id: I14e88d98a1128f2d599459ce9337cd6d079469fe
Reviewed-on: https://pdfium-review.googlesource.com/34531
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/xfa/cjx_field.cpp')
-rw-r--r-- | fxjs/xfa/cjx_field.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp index d3f0280d3f..3beb868f1d 100644 --- a/fxjs/xfa/cjx_field.cpp +++ b/fxjs/xfa/cjx_field.cpp @@ -44,7 +44,7 @@ CJS_Return CJX_Field::clearItems( CXFA_Node* node = GetXFANode(); if (node->IsWidgetReady()) node->DeleteItem(-1, true, false); - return CJS_Return(true); + return CJS_Return(); } CJS_Return CJX_Field::execEvent( @@ -57,7 +57,7 @@ CJS_Return CJX_Field::execEvent( int32_t iRet = execSingleEventByName(eventString.AsStringView(), XFA_Element::Field); if (eventString != L"validate") - return CJS_Return(true); + return CJS_Return(); return CJS_Return(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error)); } @@ -73,7 +73,7 @@ CJS_Return CJX_Field::execInitialize( pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Initialize, false, false); } - return CJS_Return(true); + return CJS_Return(); } CJS_Return CJX_Field::deleteItem( @@ -84,7 +84,7 @@ CJS_Return CJX_Field::deleteItem( CXFA_Node* node = GetXFANode(); if (!node->IsWidgetReady()) - return CJS_Return(true); + return CJS_Return(); bool bValue = node->DeleteItem(runtime->ToInt32(params[0]), true, true); return CJS_Return(runtime->NewBoolean(bValue)); @@ -119,7 +119,7 @@ CJS_Return CJX_Field::boundItem( CXFA_Node* node = GetXFANode(); if (!node->IsWidgetReady()) - return CJS_Return(true); + return CJS_Return(); WideString value = runtime->ToWideString(params[0]); WideString boundValue = node->GetItemValue(value.AsStringView()); @@ -134,7 +134,7 @@ CJS_Return CJX_Field::getItemState( CXFA_Node* node = GetXFANode(); if (!node->IsWidgetReady()) - return CJS_Return(true); + return CJS_Return(); int32_t state = node->GetItemState(runtime->ToInt32(params[0])); return CJS_Return(runtime->NewBoolean(state != 0)); @@ -151,7 +151,7 @@ CJS_Return CJX_Field::execCalculate( pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Calculate, false, false); } - return CJS_Return(true); + return CJS_Return(); } CJS_Return CJX_Field::getDisplayItem( @@ -183,17 +183,17 @@ CJS_Return CJX_Field::setItemState( CXFA_Node* node = GetXFANode(); if (!node->IsWidgetReady()) - return CJS_Return(true); + return CJS_Return(); int32_t iIndex = runtime->ToInt32(params[0]); if (runtime->ToInt32(params[1]) != 0) { node->SetItemState(iIndex, true, true, true, true); - return CJS_Return(true); + return CJS_Return(); } if (node->GetItemState(iIndex)) node->SetItemState(iIndex, false, true, true, true); - return CJS_Return(true); + return CJS_Return(); } CJS_Return CJX_Field::addItem(CFX_V8* runtime, @@ -203,7 +203,7 @@ CJS_Return CJX_Field::addItem(CFX_V8* runtime, CXFA_Node* node = GetXFANode(); if (!node->IsWidgetReady()) - return CJS_Return(true); + return CJS_Return(); WideString label; if (params.size() >= 1) @@ -214,7 +214,7 @@ CJS_Return CJX_Field::addItem(CFX_V8* runtime, value = runtime->ToWideString(params[1]); node->InsertItem(label, value, true); - return CJS_Return(true); + return CJS_Return(); } CJS_Return CJX_Field::execValidate( |