diff options
author | dsinclair <dsinclair@chromium.org> | 2016-08-15 13:10:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-15 13:10:03 -0700 |
commit | ef523dd36aea991084b8b934df846014a5c09c6f (patch) | |
tree | 2fdaf648680f8705ca26ed40c839dc004cf5fe66 /fpdfsdk/include | |
parent | 8e557bd9e7c09f9ce75fbea42f826b74d5cdc54b (diff) | |
download | pdfium-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/include')
-rw-r--r-- | fpdfsdk/include/fsdk_baseform.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h index c5f45e75ae..8eee56c03e 100644 --- a/fpdfsdk/include/fsdk_baseform.h +++ b/fpdfsdk/include/fsdk_baseform.h @@ -263,7 +263,8 @@ class CPDFSDK_InterForm : public IPDF_FormNotify { FX_BOOL HighlightWidgets(); CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; - CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; + CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl, + bool createIfNeeded) const; void GetWidgets(const CFX_WideString& sFieldName, std::vector<CPDFSDK_Widget*>* widgets) const; void GetWidgets(CPDF_FormField* pField, |