diff options
author | tonikitoo <tonikitoo@igalia.com> | 2016-08-19 11:18:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-19 11:18:29 -0700 |
commit | bb5fa043a7ef2de165c7903548e5663a6f8bcf9a (patch) | |
tree | 97d7fcec70171f9d12d2d613486e140d72eb1baa /fpdfsdk | |
parent | fb606f2723b87a145a9ceece6cd6ccaaf15ceadd (diff) | |
download | pdfium-chromium/2834.tar.xz |
Stub out Document::syncAnnotScan method.chromium/2834
The PDF specification [1] says:
"
syncAnnotScan guarantees that all annotations will be scanned
by the time this method returns.
(..)
Normally a background task runs that examine every page and
looks for annotations during idle times.
"
The statement details specifically how Acrobat implements
this method.
Although, neither the method itself nor the background scanner
task are implemented in PDFium (as of today, Ago/2016),
not having ::syncAnnotScan at least stubbed out can be considered
harmfull since its absence makes JS acrobat scripts silently
fail when it has a call to it.
Given that, and following a stub-out pattern present in other
methods including ::addAnnot and ::addField, CL provides
a stubbed out implementation of Document::syncAnnotScan.
[1] http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf
BUG=pdfium:492
Review-Url: https://codereview.chromium.org/2265553002
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/javascript/Document.cpp | 8 | ||||
-rw-r--r-- | fpdfsdk/javascript/Document.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp index 8fb07b085b..8fb9ce60dc 100644 --- a/fpdfsdk/javascript/Document.cpp +++ b/fpdfsdk/javascript/Document.cpp @@ -137,6 +137,7 @@ JS_STATIC_METHOD_ENTRY(resetForm) JS_STATIC_METHOD_ENTRY(removeIcon) JS_STATIC_METHOD_ENTRY(saveAs) JS_STATIC_METHOD_ENTRY(submitForm) +JS_STATIC_METHOD_ENTRY(syncAnnotScan) JS_STATIC_METHOD_ENTRY(mailDoc) END_JS_STATIC_METHOD() @@ -569,6 +570,13 @@ FX_BOOL Document::saveAs(IJS_Context* cc, return TRUE; } +FX_BOOL Document::syncAnnotScan(IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError) { + return TRUE; +} + FX_BOOL Document::submitForm(IJS_Context* cc, const std::vector<CJS_Value>& params, CJS_Value& vRet, diff --git a/fpdfsdk/javascript/Document.h b/fpdfsdk/javascript/Document.h index 1c20ac4221..feef228c6e 100644 --- a/fpdfsdk/javascript/Document.h +++ b/fpdfsdk/javascript/Document.h @@ -255,6 +255,10 @@ class Document : public CJS_EmbedObj { const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL syncAnnotScan(IJS_Context* cc, + const std::vector<CJS_Value>& params, + CJS_Value& vRet, + CFX_WideString& sError); FX_BOOL mailDoc(IJS_Context* cc, const std::vector<CJS_Value>& params, CJS_Value& vRet, @@ -371,6 +375,7 @@ class CJS_Document : public CJS_Object { JS_STATIC_METHOD(resetForm, Document); JS_STATIC_METHOD(saveAs, Document); JS_STATIC_METHOD(submitForm, Document); + JS_STATIC_METHOD(syncAnnotScan, Document); JS_STATIC_METHOD(mailDoc, Document); }; |