summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-08-15 13:10:03 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-15 13:10:03 -0700
commitef523dd36aea991084b8b934df846014a5c09c6f (patch)
tree2fdaf648680f8705ca26ed40c839dc004cf5fe66 /fpdfsdk/javascript/Field.h
parent8e557bd9e7c09f9ce75fbea42f826b74d5cdc54b (diff)
downloadpdfium-ef523dd36aea991084b8b934df846014a5c09c6f.tar.xz
Only create widgets if really needed.
Currently the GetWidget call will create a backing widget for a control behind the scenes if it doesn't exist. This can cause more work to be done then needed as we may need to create the page and any supporting structures. This created structure will then be torn down as we don't need it anymore once we're done with the widget. For the instances where setting the value on the widget will have no effect (as we'll destroy it anyway) we can tell GetWidget() to not create the widget and return without doing any work. BUG=pdfium:632709 Review-Url: https://codereview.chromium.org/2251453002
Diffstat (limited to 'fpdfsdk/javascript/Field.h')
-rw-r--r--fpdfsdk/javascript/Field.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/javascript/Field.h b/fpdfsdk/javascript/Field.h
index 5697865b7c..3d1b0ff876 100644
--- a/fpdfsdk/javascript/Field.h
+++ b/fpdfsdk/javascript/Field.h
@@ -425,7 +425,8 @@ class Field : public CJS_EmbedObj {
FX_BOOL bRefresh);
static CPDFSDK_Widget* GetWidget(CPDFSDK_Document* pDocument,
- CPDF_FormControl* pFormControl);
+ CPDF_FormControl* pFormControl,
+ bool createIfNeeded);
static std::vector<CPDF_FormField*> GetFormFields(
CPDFSDK_Document* pDocument,
const CFX_WideString& csFieldName);