summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_radiobutton.cpp
AgeCommit message (Collapse)Author
2018-10-26Pass CreateParams to CPWL_Wnd constructor.chromium/3595chromium/3594Tom Sepez
The previous reshuffling means we always have the create params earlier, so pass them in at create time. Clean up two forward declarations that were not needed as noticed in the process. Change-Id: I5d3861f3c1e3508e0d25950e919859244fac5f8b Reviewed-on: https://pdfium-review.googlesource.com/c/44710 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-26cp.pParentWindow is always NULL in NewPWLWindow()Tom Sepez
Because the CreateParams come from one of the GetCreateParam() overrides, and none of these set that particual field. This implies that the caller will always own the result, since it is never handed off by an AddChild() call, which is consistent with the function return. Change-Id: I1a9f580f347e911855c695807795541282d43f3f Reviewed-on: https://pdfium-review.googlesource.com/c/44691 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-26Stop transfering ownership of |this| as CPWL_Wnd::Create() side-effectTom Sepez
Instead, make it an explicit method called on the parent outside of create. Rename Create() to Realize() to be sure to catch all usages, and add the new required call. Attachment to the parent now takes place a little earlier on in the life-cycle as a result but should be ok. Precursor to converting to smart pointers. Change-Id: I45c459fcd28b5d03c428ce5809d0432506cf4ec6 Reviewed-on: https://pdfium-review.googlesource.com/c/44690 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-26Rename NewPDFWindow() => NewPWLWindow()chromium/3593Tom Sepez
The window comes from the PWL layer. The string |PDF| doesn't add a lot of information since the whole repository is about PDF. Change-Id: I396351519e68ac0c59a02806941f45d3b17e7567 Reviewed-on: https://pdfium-review.googlesource.com/c/44670 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-25Make CPWL_Wnd own its pAttachedData.Tom Sepez
This requires moving it out of CreateParams, since that must be a copyable struct, and implies that currently there is some questionable sharing going on. To resolve this, introduce a Clone() method so that each window gets its own copy. Make GetAttachedData() return a const pointer, so that callers can't free it behind our back. Tidy initializations along the way. Change-Id: Iadc97688b4692bf4fafefe8cff88af88672f7110 Reviewed-on: https://pdfium-review.googlesource.com/c/44590 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-24Fix CPLW_Wnd ownership model in CFFL_FormFiller.Tom Sepez
CFFL_FormFiller::DestroyPDFWindow() might get re-entered, so do not leave any dangling references in maps. Use unique_ptr to be more sure that we have it right. Bug: chromium:898531 Change-Id: I7b61940ff4e88c8a7e3219fefb0479f33bbbfae1 Reviewed-on: https://pdfium-review.googlesource.com/c/44542 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-16Replace optional bool bNotify with enum type.Tom Sepez
Adds clarity to the call sites. Change-Id: Id4deed9adda2ad79f0847d618792429044d4f7d6 Reviewed-on: https://pdfium-review.googlesource.com/40351 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-10-10Fix UAF in SaveData on all of CFFL_* types.Luật Nguyễn
Bug: 756427 Change-Id: I8e31d96c6f3b83a6464ed69c95225362c50386d1 Reviewed-on: https://pdfium-review.googlesource.com/15870 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-09-15Move CPWL_CREATPARAM to CPWL_Wnd::CreateParamsTom Sepez
This nesting makes so much more sense when I read the code. Fix member naming for this in CPWL_Wnd. Pass in/out CreateParams arg as pointer. Kill Reset() method, only called during destroy and nothing needs explicit cleanup. Change-Id: If50e403e11c131e7656da09c0cb36866223d64c6 Reviewed-on: https://pdfium-review.googlesource.com/14070 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-07-25Move fpdfsdk/pdfwindow to fpdfsdk/pwlDan Sinclair
This makes it clearer what the directory contains. Change-Id: I34fc38dd30b8e0f6e057052ea33c8b5a10f1b9c3 Reviewed-on: https://pdfium-review.googlesource.com/8791 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-06Convert OnButtonUp to not have in-out paramsDan Sinclair
This CL removes the in-out param from OnButtonUp in favour of a single bool return. Change-Id: I2d91466677adcb366ed1c2d0721ce5e2949ed074 Reviewed-on: https://pdfium-review.googlesource.com/7333 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-15Change some CFFL classes to use early returns.chromium/3132Lei Zhang
Also switch C-style casts to the appropriate C++ casts, and add helper functions in some cases. Change-Id: I73f1ab36c6c89ced9d2b7b98393805142661dcac Reviewed-on: https://pdfium-review.googlesource.com/6650 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-15Add more checks for destroyed annotations in CFFL_FormFiller.Lei Zhang
CFFL_FormFiller::CommitData() should check more rigorously and so should its callers. BUG=chromium:732051 Change-Id: If0cee8fb61de10dc7678dad89c330d75bee55aa4 Reviewed-on: https://pdfium-review.googlesource.com/6530 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-02Rename PWL_FooBar files to cpwl_foo_bar.Lei Zhang
Change-Id: I7ed0ba0acbbee291e285555974ebf50c0073668f Reviewed-on: https://pdfium-review.googlesource.com/6250 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-02Clean up CFFL formfiller classes.Lei Zhang
- Consolidate assertions for m_pFormFillEnv. - Remove check for m_pFormFillEnv being NULL. - Pass in a CPDFSDK_Widget* instead of an Annot* and then casting. - Remove unused LoadPopupMenuString() method. Change-Id: Ic22e75c9e41eb54002be812945a3ee80debeca8b Reviewed-on: https://pdfium-review.googlesource.com/6232 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-02Remove unused parameter from CFFL_FormFiller::NewPDFWindow().Lei Zhang
Change-Id: I27164e023c622d5c0d9490aa2b09ac4e66dda0fb Reviewed-on: https://pdfium-review.googlesource.com/6231 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-05-25Mass conversion of remaining class members (non-xfa)Tom Sepez
Change-Id: I8365ba80e3395d59a3cf35dbd9d9162e86e712e3 Reviewed-on: https://pdfium-review.googlesource.com/5970 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-02-14Reland "Convert CFX_FloatPoint to CFX_PointF"Dan Sinclair
This CL updates the CFX_FloatPoint Cl to accommodate for the Origin CL being reverted. Change-Id: I345fe1117938a49ad9ee5f310fe7b5e21d9f1948 Reviewed-on: https://pdfium-review.googlesource.com/2697 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-02-14Revert "Convert CFX_FloatPoint to CFX_PointF"dsinclair
This reverts commit 4797c4240cb9e2d8cd36c583d46cd52ff94af95d. Reason for revert: Reverting chain to see if fixes Chrome roll. Original change's description: > Convert CFX_FloatPoint to CFX_PointF > > The two classes store the same information, remove the CFX_FloatPoint variant. > > Change-Id: Ie598c2ba5af04fb2bb3347dd48c30fd5e4845e62 > Reviewed-on: https://pdfium-review.googlesource.com/2612 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: Tom Sepez <tsepez@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia42074e706983c62d2e57497c3079b3c338343a3 Reviewed-on: https://pdfium-review.googlesource.com/2694 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-02-13Convert CFX_FloatPoint to CFX_PointFDan Sinclair
The two classes store the same information, remove the CFX_FloatPoint variant. Change-Id: Ie598c2ba5af04fb2bb3347dd48c30fd5e4845e62 Reviewed-on: https://pdfium-review.googlesource.com/2612 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-11-02Remove FX_BOOL from fpdfsdk.tsepez
Review-Url: https://codereview.chromium.org/2453683011
2016-10-12Cleanup env variable namesdsinclair
This CL cleans up any old m_pEnv variables to be correctly named m_pFormFillEnv. Review-Url: https://codereview.chromium.org/2412523002
2016-10-05Rename CPDFSDK_Environment to CPDFSDK_FormfillEnvironmentdsinclair
Rename CPDFSDK_Environment to make it explicit that this is part of the formfill system. Review-Url: https://codereview.chromium.org/2391313002
2016-09-29Move fpdfsdk/include to fpdfsdkdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2384503003
2016-09-27Watch destruction of widgets around OnAAction() method.tsepez
We implemented the CFX_Observable mechanism for detecting stale objects some time ago; now just use it in more places. Change method signatures to required an ObservedPtr to indicate that the callers are aware that the value may be destroyed out from underneath them. BUG=649659 Review-Url: https://codereview.chromium.org/2368403002
2016-09-21Make the I in IFormFiller explicitdsinclair
Typically the I prefix means Interface, except for CFFL_IFormFiller where it means Interactive. Rename CFFL_IFormFiller to CFFL_InteractiveFormFiller to make the meaning explicit. Review-Url: https://codereview.chromium.org/2357203003
2016-09-21Rename m_pApp to m_pEnvdsinclair
The m_pApp variable holds a CPDFSDK_Environment. This Cl renames the variable to be m_pEnv so as not to confuse with the various App classes that exist. Review-Url: https://codereview.chromium.org/2357293002
2016-09-15Replace FX_UINT with unsigned intdsinclair
Remove the FX_UINT typedef and update to use the actual unsigned int type. Review-Url: https://codereview.chromium.org/2343693002
2016-09-14Rename CPDFDoc_Environment to CPDFSDK_Environmentdsinclair
CPDFDoc_Environment does not fit with the general naming scheme of the rest of the files in fpdfsdk. This CL updates the naming to CPDFSDK_Environment to better fit with the surrounding files. Review-Url: https://codereview.chromium.org/2333413003
2016-09-13Split fsdk_mgr files apart.dsinclair
This CL separates the CPDFDoc_Environment, CPDFSDK_Document and CPDFSDK_PageView classes into their own h and cpp files. Review-Url: https://codereview.chromium.org/2335243002
2016-08-17Split fpdfsdk/fsdk_baseform.h into individual classes.jaepark
This CL moves classes in fsdk_baseform.h to their own files. Classes include CPDFSDK_Widget, CBA_AnnotIterator, CPDFSDK_XFAWidget, PDFSDK_FieldAction, and CPDFSDK_Interform. Review-Url: https://codereview.chromium.org/2252723002
2016-03-23Move the fpdfsdk/include/pdfwindow/ headers into fpdfsdk/pdfwindow.dan sinclair
This CL moves all of the pdfwindow headers to live beside their source files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1823153002 .
2016-03-21Move fpdfsdk/include/formfiller to fpdfsdk/formfiller.Dan Sinclair
This CL moves the .h files and renames the .cpp files to match. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1809193002 .