From 3cdcfeb04b5c496199d8c88ebd2402c3db4413ab Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 3 Jan 2017 15:45:10 -0500 Subject: 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 Commit-Queue: dsinclair --- fpdfsdk/fpdfxfa/cpdfxfa_context.cpp | 42 ------------------------------------- fpdfsdk/fpdfxfa/cpdfxfa_context.h | 1 - 2 files changed, 43 deletions(-) (limited to 'fpdfsdk/fpdfxfa') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp index 29888c314e..113a74e22e 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp @@ -358,48 +358,6 @@ bool CPDFXFA_Context::PutRequestURL(const CFX_WideString& wsURL, wsEncode.c_str()); } -CFX_WideString CPDFXFA_Context::LoadString(int32_t iStringID) { - switch (iStringID) { - case XFA_IDS_INVAlID_PROP_SET: - return L"Invalid property set operation."; - case XFA_IDS_NOT_DEFAUL_VALUE: - return L" doesn't have a default property."; - case XFA_IDS_UNABLE_SET_LANGUAGE: - return L"Unable to set language value."; - case XFA_IDS_UNABLE_SET_NUMPAGES: - return L"Unable to set numPages value."; - case XFA_IDS_UNABLE_SET_PLATFORM: - return L"Unable to set platform value."; - case XFA_IDS_UNABLE_SET_VARIATION: - return L"Unable to set variation value."; - case XFA_IDS_UNABLE_SET_VERSION: - return L"Unable to set version value."; - case XFA_IDS_UNABLE_SET_READY: - return L"Unable to set ready value."; - case XFA_IDS_COMPILER_ERROR: - return L"Compiler error."; - case XFA_IDS_DIVIDE_ZERO: - return L"Divide by zero."; - case XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT: - return L"An attempt was made to reference property '%s' of a non-object " - L"in SOM expression %s."; - case XFA_IDS_INDEX_OUT_OF_BOUNDS: - return L"Index value is out of bounds."; - case XFA_IDS_INCORRECT_NUMBER_OF_METHOD: - return L"Incorrect number of parameters calling method '%s'."; - case XFA_IDS_ARGUMENT_MISMATCH: - return L"Argument mismatch in property or function argument."; - case XFA_IDS_NOT_HAVE_PROPERTY: - return L"'%s' doesn't have property '%s'."; - case XFA_IDS_VIOLATE_BOUNDARY: - return L"The element [%s] has violated its allowable number of " - L"occurrences."; - case XFA_IDS_SERVER_DENY: - return L"Server does not permit."; - } - return L""; -} - IFWL_AdapterTimerMgr* CPDFXFA_Context::GetTimerMgr() { CXFA_FWLAdapterTimerMgr* pAdapter = nullptr; if (m_pFormFillEnv) diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.h b/fpdfsdk/fpdfxfa/cpdfxfa_context.h index 52b16891de..de3f39cb2a 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.h @@ -80,7 +80,6 @@ class CPDFXFA_Context : public IXFA_AppProvider { const CFX_WideString& wsData, const CFX_WideString& wsEncode) override; - CFX_WideString LoadString(int32_t iStringID) override; IFWL_AdapterTimerMgr* GetTimerMgr() override; protected: -- cgit v1.2.3