diff options
Diffstat (limited to 'fpdfsdk/src/javascript/PublicMethods.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/PublicMethods.cpp | 138 |
1 files changed, 75 insertions, 63 deletions
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index 92b47666e2..66b08d20a8 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -911,7 +911,7 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, // function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, // bCurrencyPrepend) FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { #if _FX_OS_ != _FX_ANDROID_ @@ -1089,10 +1089,11 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc, // function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, // bCurrencyPrepend) -FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFNumber_Keystroke( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -1208,10 +1209,11 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IJS_Context* cc, } // function AFPercent_Format(nDec, sepStyle) -FX_BOOL CJS_PublicMethods::AFPercent_Format(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFPercent_Format( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { #if _FX_OS_ != _FX_ANDROID_ CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -1302,16 +1304,17 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IJS_Context* cc, return TRUE; } // AFPercent_Keystroke(nDec, sepStyle) -FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFPercent_Keystroke( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { return AFNumber_Keystroke(cc, params, vRet, sError); } // function AFDate_FormatEx(cFormat) FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1426,10 +1429,11 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) { } // AFDate_KeystrokeEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -1463,7 +1467,7 @@ FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IJS_Context* cc, } FX_BOOL CJS_PublicMethods::AFDate_Format(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1491,17 +1495,18 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IJS_Context* cc, if (iIndex < 0 || (static_cast<size_t>(iIndex) >= FX_ArraySize(cFormats))) iIndex = 0; - CJS_Parameters newParams; + std::vector<CJS_Value> newParams; newParams.push_back( CJS_Value(CJS_Runtime::FromContext(cc), cFormats[iIndex])); return AFDate_FormatEx(cc, newParams, vRet, sError); } // AFDate_KeystrokeEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFDate_Keystroke( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); @@ -1527,7 +1532,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IJS_Context* cc, if (iIndex < 0 || (static_cast<size_t>(iIndex) >= FX_ArraySize(cFormats))) iIndex = 0; - CJS_Parameters newParams; + std::vector<CJS_Value> newParams; newParams.push_back( CJS_Value(CJS_Runtime::FromContext(cc), cFormats[iIndex])); return AFDate_KeystrokeEx(cc, newParams, vRet, sError); @@ -1535,7 +1540,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IJS_Context* cc, // function AFTime_Format(ptf) FX_BOOL CJS_PublicMethods::AFTime_Format(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1551,16 +1556,17 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IJS_Context* cc, if (iIndex < 0 || (static_cast<size_t>(iIndex) >= FX_ArraySize(cFormats))) iIndex = 0; - CJS_Parameters newParams; + std::vector<CJS_Value> newParams; newParams.push_back( CJS_Value(CJS_Runtime::FromContext(cc), cFormats[iIndex])); return AFDate_FormatEx(cc, newParams, vRet, sError); } -FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFTime_Keystroke( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); @@ -1574,31 +1580,33 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IJS_Context* cc, if (iIndex < 0 || (static_cast<size_t>(iIndex) >= FX_ArraySize(cFormats))) iIndex = 0; - CJS_Parameters newParams; + std::vector<CJS_Value> newParams; newParams.push_back( CJS_Value(CJS_Runtime::FromContext(cc), cFormats[iIndex])); return AFDate_KeystrokeEx(cc, newParams, vRet, sError); } FX_BOOL CJS_PublicMethods::AFTime_FormatEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { return AFDate_FormatEx(cc, params, vRet, sError); } -FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { return AFDate_KeystrokeEx(cc, params, vRet, sError); } // function AFSpecial_Format(psf) -FX_BOOL CJS_PublicMethods::AFSpecial_Format(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFSpecial_Format( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -1646,10 +1654,11 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IJS_Context* cc, } // function AFSpecial_KeystrokeEx(mask) -FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -1739,10 +1748,11 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IJS_Context* cc, } // function AFSpecial_Keystroke(psf) -FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); @@ -1784,13 +1794,13 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IJS_Context* cc, break; } - CJS_Parameters params2; + std::vector<CJS_Value> params2; params2.push_back(CJS_Value(CJS_Runtime::FromContext(cc), cFormat.c_str())); return AFSpecial_KeystrokeEx(cc, params2, vRet, sError); } FX_BOOL CJS_PublicMethods::AFMergeChange(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1832,7 +1842,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IJS_Context* cc, } FX_BOOL CJS_PublicMethods::AFParseDateEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1862,7 +1872,7 @@ FX_BOOL CJS_PublicMethods::AFParseDateEx(IJS_Context* cc, } FX_BOOL CJS_PublicMethods::AFSimple(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() != 3) { @@ -1879,7 +1889,7 @@ FX_BOOL CJS_PublicMethods::AFSimple(IJS_Context* cc, } FX_BOOL CJS_PublicMethods::AFMakeNumber(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() != 1) { @@ -1893,10 +1903,11 @@ FX_BOOL CJS_PublicMethods::AFMakeNumber(IJS_Context* cc, return TRUE; } -FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFSimple_Calculate( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 2) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); @@ -1993,10 +2004,11 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IJS_Context* cc, /* This function validates the current event to ensure that its value is ** within the specified range. */ -FX_BOOL CJS_PublicMethods::AFRange_Validate(IJS_Context* cc, - const CJS_Parameters& params, - CJS_Value& vRet, - CFX_WideString& sError) { +FX_BOOL CJS_PublicMethods::AFRange_Validate( + IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -2041,7 +2053,7 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(IJS_Context* cc, } FX_BOOL CJS_PublicMethods::AFExtractNums(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; |