From 945fdb70f022952e9ed53847649226369352920a Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 11 Nov 2015 10:18:16 -0800 Subject: Merge to XFA: Replace CJS_Parameters with std::vector. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1437713003 . (cherry picked from commit f20a34c0f2dfca49f735a0f11147254c26831e7c) Review URL: https://codereview.chromium.org/1437863005 . --- fpdfsdk/src/javascript/Document.cpp | 80 +++++++++--------- fpdfsdk/src/javascript/Document.h | 80 +++++++++--------- fpdfsdk/src/javascript/Field.cpp | 52 ++++++------ fpdfsdk/src/javascript/Field.h | 52 ++++++------ fpdfsdk/src/javascript/JS_Define.h | 12 +-- fpdfsdk/src/javascript/JS_Value.h | 2 - fpdfsdk/src/javascript/PublicMethods.cpp | 138 +++++++++++++++++-------------- fpdfsdk/src/javascript/PublicMethods.h | 44 +++++----- fpdfsdk/src/javascript/app.cpp | 42 +++++----- fpdfsdk/src/javascript/app.h | 42 +++++----- fpdfsdk/src/javascript/color.cpp | 4 +- fpdfsdk/src/javascript/color.h | 4 +- fpdfsdk/src/javascript/console.cpp | 8 +- fpdfsdk/src/javascript/console.h | 8 +- fpdfsdk/src/javascript/global.cpp | 2 +- fpdfsdk/src/javascript/global.h | 2 +- fpdfsdk/src/javascript/report.cpp | 4 +- fpdfsdk/src/javascript/report.h | 4 +- fpdfsdk/src/javascript/util.cpp | 10 +-- fpdfsdk/src/javascript/util.h | 10 +-- 20 files changed, 306 insertions(+), 294 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index a88c97c274..4bd0fd7430 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -256,7 +256,7 @@ FX_BOOL Document::pageNum(IJS_Context* cc, } FX_BOOL Document::addAnnot(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Not supported. @@ -264,7 +264,7 @@ FX_BOOL Document::addAnnot(IJS_Context* cc, } FX_BOOL Document::addField(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Not supported. @@ -272,7 +272,7 @@ FX_BOOL Document::addField(IJS_Context* cc, } FX_BOOL Document::exportAsText(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -280,7 +280,7 @@ FX_BOOL Document::exportAsText(IJS_Context* cc, } FX_BOOL Document::exportAsFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -288,7 +288,7 @@ FX_BOOL Document::exportAsFDF(IJS_Context* cc, } FX_BOOL Document::exportAsXFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -301,7 +301,7 @@ FX_BOOL Document::exportAsXFDF(IJS_Context* cc, // valiable filed name in this document FX_BOOL Document::getField(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -334,7 +334,7 @@ FX_BOOL Document::getField(IJS_Context* cc, // Gets the name of the nth field in the document FX_BOOL Document::getNthFieldName(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -360,7 +360,7 @@ FX_BOOL Document::getNthFieldName(IJS_Context* cc, } FX_BOOL Document::importAnFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -368,7 +368,7 @@ FX_BOOL Document::importAnFDF(IJS_Context* cc, } FX_BOOL Document::importAnXFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -376,7 +376,7 @@ FX_BOOL Document::importAnXFDF(IJS_Context* cc, } FX_BOOL Document::importTextData(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -391,7 +391,7 @@ FX_BOOL Document::importTextData(IJS_Context* cc, // cbcc,string cSubject,string cms); FX_BOOL Document::mailForm(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -432,7 +432,7 @@ FX_BOOL Document::mailForm(IJS_Context* cc, } FX_BOOL Document::print(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { FX_BOOL bUI = TRUE; @@ -500,7 +500,7 @@ FX_BOOL Document::print(IJS_Context* cc, // note: if the filed name is not retional, adobe is dumb for it. FX_BOOL Document::removeField(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -553,7 +553,7 @@ FX_BOOL Document::removeField(IJS_Context* cc, // note: if the fields names r not rational, aodbe is dumb for it. FX_BOOL Document::resetForm(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || @@ -600,7 +600,7 @@ FX_BOOL Document::resetForm(IJS_Context* cc, } FX_BOOL Document::saveAs(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -608,7 +608,7 @@ FX_BOOL Document::saveAs(IJS_Context* cc, } FX_BOOL Document::submitForm(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -716,7 +716,7 @@ FX_BOOL Document::bookmarkRoot(IJS_Context* cc, } FX_BOOL Document::mailDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { FX_BOOL bUI = TRUE; @@ -1223,14 +1223,14 @@ FX_BOOL Document::layout(IJS_Context* cc, } FX_BOOL Document::addLink(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Document::closeDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1238,21 +1238,21 @@ FX_BOOL Document::closeDoc(IJS_Context* cc, } FX_BOOL Document::getPageBox(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Document::getAnnot(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Document::getAnnots(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { vRet.SetNull(); @@ -1260,7 +1260,7 @@ FX_BOOL Document::getAnnots(IJS_Context* cc, } FX_BOOL Document::getAnnot3D(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { vRet.SetNull(); @@ -1268,7 +1268,7 @@ FX_BOOL Document::getAnnot3D(IJS_Context* cc, } FX_BOOL Document::getAnnots3D(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { vRet = CJS_Value::VT_undefined; @@ -1276,14 +1276,14 @@ FX_BOOL Document::getAnnots3D(IJS_Context* cc, } FX_BOOL Document::getOCGs(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Document::getLinks(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; @@ -1340,7 +1340,7 @@ IconElement* IconTree::operator[](int iIndex) { } FX_BOOL Document::addIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1423,7 +1423,7 @@ FX_BOOL Document::icons(IJS_Context* cc, } FX_BOOL Document::getIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1467,7 +1467,7 @@ FX_BOOL Document::getIcon(IJS_Context* cc, } FX_BOOL Document::removeIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, no supported. @@ -1475,7 +1475,7 @@ FX_BOOL Document::removeIcon(IJS_Context* cc, } FX_BOOL Document::createDataObject(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not implemented. @@ -1489,7 +1489,7 @@ FX_BOOL Document::media(IJS_Context* cc, } FX_BOOL Document::calculateNow(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1513,7 +1513,7 @@ FX_BOOL Document::Collab(IJS_Context* cc, } FX_BOOL Document::getPageNthWord(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1575,7 +1575,7 @@ FX_BOOL Document::getPageNthWord(IJS_Context* cc, } FX_BOOL Document::getPageNthWordQuads(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1587,7 +1587,7 @@ FX_BOOL Document::getPageNthWordQuads(IJS_Context* cc, } FX_BOOL Document::getPageNumWords(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1634,7 +1634,7 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc, } FX_BOOL Document::getPrintParams(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1745,7 +1745,7 @@ FX_BOOL Document::zoomType(IJS_Context* cc, } FX_BOOL Document::deletePages(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, no supported. @@ -1753,7 +1753,7 @@ FX_BOOL Document::deletePages(IJS_Context* cc, } FX_BOOL Document::extractPages(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -1761,7 +1761,7 @@ FX_BOOL Document::extractPages(IJS_Context* cc, } FX_BOOL Document::insertPages(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -1769,7 +1769,7 @@ FX_BOOL Document::insertPages(IJS_Context* cc, } FX_BOOL Document::replacePages(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -1777,7 +1777,7 @@ FX_BOOL Document::replacePages(IJS_Context* cc, } FX_BOOL Document::getURL(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. diff --git a/fpdfsdk/src/javascript/Document.h b/fpdfsdk/src/javascript/Document.h index 4e6fdee218..3e957a6057 100644 --- a/fpdfsdk/src/javascript/Document.h +++ b/fpdfsdk/src/javascript/Document.h @@ -113,163 +113,163 @@ class Document : public CJS_EmbedObj { FX_BOOL zoomType(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL addAnnot(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL addField(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL addLink(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL addIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL calculateNow(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL closeDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL createDataObject(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL deletePages(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL exportAsText(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL exportAsFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL exportAsXFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL extractPages(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getAnnot(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getAnnots(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getAnnot3D(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getAnnots3D(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getField(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getLinks(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getNthFieldName(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getOCGs(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getPageBox(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getPageNthWord(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getPageNthWordQuads(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getPageNumWords(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getPrintParams(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getURL(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL importAnFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL importAnXFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL importTextData(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL insertPages(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL mailForm(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL print(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL removeField(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL replacePages(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL resetForm(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL saveAs(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL submitForm(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL mailDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL removeIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 1697b34337..6287850bb6 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -2989,7 +2989,7 @@ FX_BOOL Field::valueAsString(IJS_Context* cc, */ FX_BOOL Field::browseForFileToSubmit(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3013,7 +3013,7 @@ FX_BOOL Field::browseForFileToSubmit(IJS_Context* cc, } FX_BOOL Field::buttonGetCaption(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3048,7 +3048,7 @@ FX_BOOL Field::buttonGetCaption(IJS_Context* cc, } FX_BOOL Field::buttonGetIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3096,28 +3096,28 @@ FX_BOOL Field::buttonGetIcon(IJS_Context* cc, } FX_BOOL Field::buttonImportIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Field::buttonSetCaption(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::buttonSetIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::checkThisBox(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3155,14 +3155,14 @@ FX_BOOL Field::checkThisBox(IJS_Context* cc, } FX_BOOL Field::clearItems(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Field::defaultIsChecked(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3192,7 +3192,7 @@ FX_BOOL Field::defaultIsChecked(IJS_Context* cc, } FX_BOOL Field::deleteItemAt(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; @@ -3206,7 +3206,7 @@ int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2) { } FX_BOOL Field::getArray(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3248,7 +3248,7 @@ FX_BOOL Field::getArray(IJS_Context* cc, } FX_BOOL Field::getItemAt(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3288,21 +3288,21 @@ FX_BOOL Field::getItemAt(IJS_Context* cc, } FX_BOOL Field::getLock(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::insertItemAt(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Field::isBoxChecked(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3335,7 +3335,7 @@ FX_BOOL Field::isBoxChecked(IJS_Context* cc, } FX_BOOL Field::isDefaultChecked(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3367,14 +3367,14 @@ FX_BOOL Field::isDefaultChecked(IJS_Context* cc, } FX_BOOL Field::setAction(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Field::setFocus(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3423,56 +3423,56 @@ FX_BOOL Field::setFocus(IJS_Context* cc, } FX_BOOL Field::setItems(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL Field::setLock(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::signatureGetModifications(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::signatureGetSeedValue(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::signatureInfo(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::signatureSetSeedValue(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::signatureSign(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL Field::signatureValidate(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; diff --git a/fpdfsdk/src/javascript/Field.h b/fpdfsdk/src/javascript/Field.h index d0ee490e80..4899ee2a96 100644 --- a/fpdfsdk/src/javascript/Field.h +++ b/fpdfsdk/src/javascript/Field.h @@ -188,107 +188,107 @@ class Field : public CJS_EmbedObj { FX_BOOL source(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL browseForFileToSubmit(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL buttonGetCaption(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL buttonGetIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL buttonImportIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL buttonSetCaption(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL buttonSetIcon(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL checkThisBox(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL clearItems(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL defaultIsChecked(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL deleteItemAt(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getArray(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getItemAt(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL getLock(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL insertItemAt(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL isBoxChecked(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL isDefaultChecked(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL setAction(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL setFocus(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL setItems(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL setLock(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL signatureGetModifications(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL signatureGetSeedValue(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL signatureInfo(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL signatureSetSeedValue(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL signatureSign(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL signatureValidate(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/JS_Define.h b/fpdfsdk/src/javascript/JS_Define.h index b097aaa63f..0a6426868f 100644 --- a/fpdfsdk/src/javascript/JS_Define.h +++ b/fpdfsdk/src/javascript/JS_Define.h @@ -136,7 +136,7 @@ void JSPropSetter(const char* prop_name_string, template &, CJS_Value&, CFX_WideString&)> void JSMethod(const char* method_name_string, @@ -148,7 +148,7 @@ void JSMethod(const char* method_name_string, if (!pRuntime) return; IJS_Context* pContext = pRuntime->GetCurrentContext(); - CJS_Parameters parameters; + std::vector parameters; for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) { parameters.push_back(CJS_Value(pRuntime, info[i], CJS_Value::VT_unknown)); } @@ -436,8 +436,10 @@ void JSSpecialPropDel(const char* class_name, } } -template +template &, + CJS_Value&, + CFX_WideString&)> void JSGlobalFunc(const char* func_name_string, const v8::FunctionCallbackInfo& info) { CJS_Runtime* pRuntime = static_cast( @@ -445,7 +447,7 @@ void JSGlobalFunc(const char* func_name_string, if (!pRuntime) return; IJS_Context* pContext = pRuntime->GetCurrentContext(); - CJS_Parameters parameters; + std::vector parameters; for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) { parameters.push_back(CJS_Value(pRuntime, info[i], CJS_Value::VT_unknown)); } diff --git a/fpdfsdk/src/javascript/JS_Value.h b/fpdfsdk/src/javascript/JS_Value.h index 68e643e055..875ab18ca9 100644 --- a/fpdfsdk/src/javascript/JS_Value.h +++ b/fpdfsdk/src/javascript/JS_Value.h @@ -88,8 +88,6 @@ class CJS_Value { CJS_Runtime* m_pJSRuntime; }; -using CJS_Parameters = std::vector; - class CJS_PropValue : public CJS_Value { public: CJS_PropValue(const CJS_Value&); diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index c11197d93e..ac9669d564 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -903,7 +903,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& params, CJS_Value& vRet, CFX_WideString& sError) { #if _FX_OS_ != _FX_ANDROID_ @@ -1081,10 +1081,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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -1200,10 +1201,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& params, + CJS_Value& vRet, + CFX_WideString& sError) { #if _FX_OS_ != _FX_ANDROID_ CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -1294,16 +1296,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& 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& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1418,10 +1421,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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -1455,7 +1459,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& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1483,17 +1487,18 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IJS_Context* cc, if (iIndex < 0 || (static_cast(iIndex) >= FX_ArraySize(cFormats))) iIndex = 0; - CJS_Parameters newParams; + std::vector 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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); @@ -1519,7 +1524,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IJS_Context* cc, if (iIndex < 0 || (static_cast(iIndex) >= FX_ArraySize(cFormats))) iIndex = 0; - CJS_Parameters newParams; + std::vector newParams; newParams.push_back( CJS_Value(CJS_Runtime::FromContext(cc), cFormats[iIndex])); return AFDate_KeystrokeEx(cc, newParams, vRet, sError); @@ -1527,7 +1532,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& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1543,16 +1548,17 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IJS_Context* cc, if (iIndex < 0 || (static_cast(iIndex) >= FX_ArraySize(cFormats))) iIndex = 0; - CJS_Parameters newParams; + std::vector 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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); @@ -1566,31 +1572,33 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IJS_Context* cc, if (iIndex < 0 || (static_cast(iIndex) >= FX_ArraySize(cFormats))) iIndex = 0; - CJS_Parameters newParams; + std::vector 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& 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& 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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -1638,10 +1646,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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -1731,10 +1740,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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); @@ -1776,13 +1786,13 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IJS_Context* cc, break; } - CJS_Parameters params2; + std::vector 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& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1824,7 +1834,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IJS_Context* cc, } FX_BOOL CJS_PublicMethods::AFParseDateEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -1854,7 +1864,7 @@ FX_BOOL CJS_PublicMethods::AFParseDateEx(IJS_Context* cc, } FX_BOOL CJS_PublicMethods::AFSimple(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() != 3) { @@ -1871,7 +1881,7 @@ FX_BOOL CJS_PublicMethods::AFSimple(IJS_Context* cc, } FX_BOOL CJS_PublicMethods::AFMakeNumber(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() != 1) { @@ -1885,10 +1895,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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; if (params.size() != 2) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); @@ -1985,10 +1996,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& params, + CJS_Value& vRet, + CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -2033,7 +2045,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& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; diff --git a/fpdfsdk/src/javascript/PublicMethods.h b/fpdfsdk/src/javascript/PublicMethods.h index f328c15400..80465035ea 100644 --- a/fpdfsdk/src/javascript/PublicMethods.h +++ b/fpdfsdk/src/javascript/PublicMethods.h @@ -16,91 +16,91 @@ class CJS_PublicMethods : public CJS_Object { public: static FX_BOOL AFNumber_Format(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFNumber_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFPercent_Format(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFPercent_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFDate_FormatEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFDate_KeystrokeEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFDate_Format(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFDate_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFTime_FormatEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); // static FX_BOOL AFTime_KeystrokeEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFTime_Format(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFTime_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFSpecial_Format(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFSpecial_Keystroke(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFSpecial_KeystrokeEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); // static FX_BOOL AFSimple(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFMakeNumber(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFSimple_Calculate(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFRange_Validate(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFMergeChange(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFParseDateEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFExtractNums(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index d6344d9132..dd8223ce9a 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -237,7 +237,7 @@ FX_BOOL app::language(IJS_Context* cc, // note: // CFDF_Document * CPDFDoc_Environment::NewFDF(); FX_BOOL app::newFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; @@ -249,14 +249,14 @@ FX_BOOL app::newFDF(IJS_Context* cc, // CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv); FX_BOOL app::openFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL app::alert(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); @@ -351,7 +351,7 @@ FX_BOOL app::alert(IJS_Context* cc, } FX_BOOL app::beep(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() == 1) { @@ -367,14 +367,14 @@ FX_BOOL app::beep(IJS_Context* cc, } FX_BOOL app::findComponent(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL app::popUpMenuEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; @@ -385,7 +385,7 @@ FX_BOOL app::fs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { } FX_BOOL app::setInterval(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -421,7 +421,7 @@ FX_BOOL app::setInterval(IJS_Context* cc, } FX_BOOL app::setTimeOut(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() > 2 || params.size() == 0) { @@ -462,7 +462,7 @@ FX_BOOL app::setTimeOut(IJS_Context* cc, } FX_BOOL app::clearTimeOut(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -498,7 +498,7 @@ FX_BOOL app::clearTimeOut(IJS_Context* cc, } FX_BOOL app::clearInterval(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -534,7 +534,7 @@ FX_BOOL app::clearInterval(IJS_Context* cc, } FX_BOOL app::execMenuItem(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; @@ -571,7 +571,7 @@ void app::RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript) { } FX_BOOL app::goBack(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Not supported. @@ -579,7 +579,7 @@ FX_BOOL app::goBack(IJS_Context* cc, } FX_BOOL app::goForward(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Not supported. @@ -587,7 +587,7 @@ FX_BOOL app::goForward(IJS_Context* cc, } FX_BOOL app::mailMsg(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() < 1) @@ -654,7 +654,7 @@ FX_BOOL app::mailMsg(IJS_Context* cc, } FX_BOOL app::launchURL(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -680,14 +680,14 @@ FX_BOOL app::fullscreen(IJS_Context* cc, } FX_BOOL app::popUpMenu(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL app::browseForDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -713,21 +713,21 @@ CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) { } FX_BOOL app::newDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL app::openDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } FX_BOOL app::response(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CFX_WideString swQuestion = L""; @@ -812,7 +812,7 @@ FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { } FX_BOOL app::execDialog(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; diff --git a/fpdfsdk/src/javascript/app.h b/fpdfsdk/src/javascript/app.h index 59f5050911..1eef13e7bb 100644 --- a/fpdfsdk/src/javascript/app.h +++ b/fpdfsdk/src/javascript/app.h @@ -70,87 +70,87 @@ class app : public CJS_EmbedObj { CFX_WideString& sError); FX_BOOL alert(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL beep(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL browseForDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL clearInterval(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL clearTimeOut(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL execDialog(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL execMenuItem(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL findComponent(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL goBack(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL goForward(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL launchURL(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL mailMsg(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL newFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL newDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL openDoc(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL openFDF(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL popUpMenuEx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL popUpMenu(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL response(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL setInterval(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL setTimeOut(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp index 515548e1ac..d00ac70e80 100644 --- a/fpdfsdk/src/javascript/color.cpp +++ b/fpdfsdk/src/javascript/color.cpp @@ -160,7 +160,7 @@ JS_IMPLEMENT_COLORPROP(gray, m_crGray) JS_IMPLEMENT_COLORPROP(ltGray, m_crLTGray) FX_BOOL color::convert(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); @@ -198,7 +198,7 @@ FX_BOOL color::convert(IJS_Context* cc, } FX_BOOL color::equal(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() < 2) diff --git a/fpdfsdk/src/javascript/color.h b/fpdfsdk/src/javascript/color.h index 3a6356ae75..360f66709c 100644 --- a/fpdfsdk/src/javascript/color.h +++ b/fpdfsdk/src/javascript/color.h @@ -31,11 +31,11 @@ class color : public CJS_EmbedObj { FX_BOOL yellow(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL convert(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL equal(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp index ebd7162650..f8dbd527d8 100644 --- a/fpdfsdk/src/javascript/console.cpp +++ b/fpdfsdk/src/javascript/console.cpp @@ -35,21 +35,21 @@ console::console(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {} console::~console() {} FX_BOOL console::clear(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL console::hide(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } FX_BOOL console::println(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { if (params.size() < 1) { @@ -59,7 +59,7 @@ FX_BOOL console::println(IJS_Context* cc, } FX_BOOL console::show(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; diff --git a/fpdfsdk/src/javascript/console.h b/fpdfsdk/src/javascript/console.h index 535fe9e94e..f4901045e4 100644 --- a/fpdfsdk/src/javascript/console.h +++ b/fpdfsdk/src/javascript/console.h @@ -16,19 +16,19 @@ class console : public CJS_EmbedObj { public: FX_BOOL clear(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL hide(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL println(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL show(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); }; diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index 84af76a3de..f7c71e88b1 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -204,7 +204,7 @@ FX_BOOL JSGlobalAlternate::DoProperty(IJS_Context* cc, } FX_BOOL JSGlobalAlternate::setPersistent(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { CJS_Context* pContext = static_cast(cc); diff --git a/fpdfsdk/src/javascript/global.h b/fpdfsdk/src/javascript/global.h index 174e63a760..6d2f632645 100644 --- a/fpdfsdk/src/javascript/global.h +++ b/fpdfsdk/src/javascript/global.h @@ -41,7 +41,7 @@ class JSGlobalAlternate : public CJS_EmbedObj { ~JSGlobalAlternate() override; FX_BOOL setPersistent(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL QueryProperty(const FX_WCHAR* propname); diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp index 269a038319..40fb682fbe 100644 --- a/fpdfsdk/src/javascript/report.cpp +++ b/fpdfsdk/src/javascript/report.cpp @@ -31,7 +31,7 @@ Report::Report(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {} Report::~Report() {} FX_BOOL Report::writeText(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. @@ -39,7 +39,7 @@ FX_BOOL Report::writeText(IJS_Context* cc, } FX_BOOL Report::save(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { // Unsafe, not supported. diff --git a/fpdfsdk/src/javascript/report.h b/fpdfsdk/src/javascript/report.h index 51b1c78303..36d1f686f1 100644 --- a/fpdfsdk/src/javascript/report.h +++ b/fpdfsdk/src/javascript/report.h @@ -16,11 +16,11 @@ class Report : public CJS_EmbedObj { public: FX_BOOL save(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL writeText(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); }; diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index 14e15c1b6f..2c28cc55e3 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -115,7 +115,7 @@ int util::ParstDataType(std::wstring* sFormat) { } FX_BOOL util::printf(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); @@ -178,7 +178,7 @@ FX_BOOL util::printf(IJS_Context* cc, } FX_BOOL util::printd(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); @@ -390,7 +390,7 @@ void util::printd(const std::wstring& cFormat2, } FX_BOOL util::printx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); @@ -490,7 +490,7 @@ void util::printx(const std::string& cFormat, } FX_BOOL util::scand(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); @@ -539,7 +539,7 @@ int64_t FX_atoi64(const char* nptr) { } FX_BOOL util::byteToChar(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError) { int iSize = params.size(); diff --git a/fpdfsdk/src/javascript/util.h b/fpdfsdk/src/javascript/util.h index 1affeac8ad..7b9a18c878 100644 --- a/fpdfsdk/src/javascript/util.h +++ b/fpdfsdk/src/javascript/util.h @@ -18,23 +18,23 @@ class util : public CJS_EmbedObj { public: FX_BOOL printd(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL printf(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL printx(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL scand(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL byteToChar(IJS_Context* cc, - const CJS_Parameters& params, + const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); -- cgit v1.2.3