diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-01-03 15:45:10 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-01-03 21:08:58 +0000 |
commit | 3cdcfeb04b5c496199d8c88ebd2402c3db4413ab (patch) | |
tree | abab4708b78aae2bec75ae6d1e9446aec863d159 /xfa/fxfa/parser/cscript_layoutpseudomodel.cpp | |
parent | e8f6897c2a80242217da785318b427c82c00ad40 (diff) | |
download | pdfium-3cdcfeb04b5c496199d8c88ebd2402c3db4413ab.tar.xz |
Create individual exception methods.
This CL removes the LoadString method from CPDFXFA_Context and, instead,
creates individual exception methods for each of the loaded strings and
calls as needed.
BUG=pdfium:549
Change-Id: I1d975f01f13f45a885946a9952f24b13387dc3e4
Reviewed-on: https://pdfium-review.googlesource.com/2135
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cscript_layoutpseudomodel.cpp')
-rw-r--r-- | xfa/fxfa/parser/cscript_layoutpseudomodel.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp index a9c63666b3..a1d1ca5785 100644 --- a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp @@ -39,7 +39,7 @@ void CScript_LayoutPseudoModel::Ready(CFXJSE_Value* pValue, return; } if (bSetting) { - ThrowException(XFA_IDS_UNABLE_SET_READY); + ThrowSetReadyException(); return; } int32_t iStatus = pNotify->GetLayoutStatus(); @@ -65,7 +65,7 @@ void CScript_LayoutPseudoModel::HWXY(CFXJSE_Arguments* pArguments, methodName = L"y"; break; } - ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName); + ThrowParamCountMismatchException(methodName); return; } CXFA_Node* pNode = nullptr; @@ -177,7 +177,7 @@ void CScript_LayoutPseudoModel::PageCount(CFXJSE_Arguments* pArguments) { void CScript_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); if (iLength != 1) { - ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageSpan"); + ThrowParamCountMismatchException(L"pageSpan"); return; } CXFA_Node* pNode = nullptr; @@ -343,7 +343,7 @@ void CScript_LayoutPseudoModel::GetObjArray(CXFA_LayoutProcessor* pDocLayout, void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 3) { - ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageContent"); + ThrowParamCountMismatchException(L"pageContent"); return; } int32_t iIndex = 0; @@ -411,7 +411,7 @@ void CScript_LayoutPseudoModel::AbsPageSpan(CFXJSE_Arguments* pArguments) { void CScript_LayoutPseudoModel::AbsPageInBatch(CFXJSE_Arguments* pArguments) { if (pArguments->GetLength() != 1) { - ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"absPageInBatch"); + ThrowParamCountMismatchException(L"absPageInBatch"); return; } @@ -422,7 +422,7 @@ void CScript_LayoutPseudoModel::AbsPageInBatch(CFXJSE_Arguments* pArguments) { void CScript_LayoutPseudoModel::SheetInBatch(CFXJSE_Arguments* pArguments) { if (pArguments->GetLength() != 1) { - ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sheetInBatch"); + ThrowParamCountMismatchException(L"sheetInBatch"); return; } @@ -456,7 +456,7 @@ void CScript_LayoutPseudoModel::PageImp(CFXJSE_Arguments* pArguments, } else { methodName = L"page"; } - ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName); + ThrowParamCountMismatchException(methodName); return; } CXFA_Node* pNode = nullptr; @@ -481,3 +481,7 @@ void CScript_LayoutPseudoModel::PageImp(CFXJSE_Arguments* pArguments, if (pValue) pValue->SetInteger(bAbsPage ? iPage : iPage + 1); } + +void CScript_LayoutPseudoModel::ThrowSetReadyException() const { + ThrowException(L"Unable to set ready value."); +} |