diff options
author | Lei Zhang <thestig@chromium.org> | 2015-11-11 10:10:44 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-11-11 10:10:44 -0800 |
commit | 56e3da27d8bed8a6c03274b7b946e3f6d6ac11f4 (patch) | |
tree | 21384233f9cf6b2de3a094e8b42ac8ffab9bb02a /fpdfsdk/src/javascript | |
parent | 211cab5b58151f09fbeafe2b18da77b63664c39d (diff) | |
download | pdfium-56e3da27d8bed8a6c03274b7b946e3f6d6ac11f4.tar.xz |
Cleanup CPDF_ApSettings and CJS_Parameters.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1432863004 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 11 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_Value.h | 8 |
2 files changed, 6 insertions, 13 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index bae068a57f..2bd800af82 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -567,8 +567,7 @@ FX_BOOL Document::resetForm(IJS_Context* cc, CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc); CJS_Array aName(pRuntime); - // TODO(thestig) Convert CJS_Parameters to a std::vector and use .empty(). - if (params.size() <= 0) { + if (params.empty()) { pPDFForm->ResetForm(TRUE); m_pDocument->SetChangeMark(); return TRUE; @@ -1509,9 +1508,9 @@ FX_BOOL Document::getPageNthWord(IJS_Context* cc, if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; - int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0; - int nWordNo = params.GetSize() > 1 ? params[1].ToInt() : 0; - bool bStrip = params.GetSize() > 2 ? params[2].ToBool() : true; + int nPageNo = params.size() > 0 ? params[0].ToInt() : 0; + int nWordNo = params.size() > 1 ? params[1].ToInt() : 0; + bool bStrip = params.size() > 2 ? params[2].ToBool() : true; CPDF_Document* pDocument = m_pDocument->GetPDFDocument(); if (!pDocument) @@ -1583,7 +1582,7 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc, if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; - int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0; + int nPageNo = params.size() > 0 ? params[0].ToInt() : 0; CPDF_Document* pDocument = m_pDocument->GetPDFDocument(); ASSERT(pDocument != NULL); diff --git a/fpdfsdk/src/javascript/JS_Value.h b/fpdfsdk/src/javascript/JS_Value.h index b8c5563f70..68e643e055 100644 --- a/fpdfsdk/src/javascript/JS_Value.h +++ b/fpdfsdk/src/javascript/JS_Value.h @@ -88,13 +88,7 @@ class CJS_Value { CJS_Runtime* m_pJSRuntime; }; -class CJS_Parameters : public CFX_ArrayTemplate<CJS_Value> { - public: - void push_back(const CJS_Value& newElement) { - CFX_ArrayTemplate<CJS_Value>::Add(newElement); - } - int size() const { return CFX_ArrayTemplate<CJS_Value>::GetSize(); } -}; +using CJS_Parameters = std::vector<CJS_Value>; class CJS_PropValue : public CJS_Value { public: |