summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_widgetacc.cpp
AgeCommit message (Collapse)Author
2018-01-04Remove CXFA_FFDocView from CXFA_WidgetAcc.Dan Sinclair
This CL removes the CXFA_FFDocView parameter from CXFA_WidgetAcc and passes in the document to the methods which require a document. Change-Id: I7b264caf0ed89d0453ae0b74c27f2ee0f31f61af Reviewed-on: https://pdfium-review.googlesource.com/22260 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-04Convert usages of pdfium::Optional to OptionalRyan Harrison
Change-Id: I29769f78eaad10c6a8b79e27524336c4f330377e Reviewed-on: https://pdfium-review.googlesource.com/22258 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-01-04Pass the FFDocView into CXFA_WidgetAcc::UpdateUIDisplayDan Sinclair
This Cl changes UpdateUIDisplay to accept the FFDocView as a parameter and removes the default value from the pExcept parameter. Change-Id: I4fb42421b6011c93c6c2b19cdd32d94184bc3fe3 Reviewed-on: https://pdfium-review.googlesource.com/22255 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-04Change CXFA_WidgetAcc::GetNextWidget to not require the FFDocViewDan Sinclair
This CL changes GetNextWidget to assume that a valid parameter is passed to the method. For callers which passed nullptr, we change to get a vaild initial widget from the doc view directly. Change-Id: I50c06082831645f62339ade59d5026f546e07840 Reviewed-on: https://pdfium-review.googlesource.com/22254 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-04Move ProcessValueChanged from CXFA_WidgetAcc to CXFA_FFDocViewDan Sinclair
The ProcessValueChanged method works on the DocView data and uses the WidgetAcc as a parameter. This CL moves the code to docview and passes the WidgetAcc as a parameter. Change-Id: I2f9531263c8578931bb44ef247ff281f1f8b4cf7 Reviewed-on: https://pdfium-review.googlesource.com/22253 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-04Merge CXFA_WidgetData into CXFA_WidgetAccDan Sinclair
This CL merges the CXFA_WidgetData class into the only subclass, CXFA_WidgetAcc. Code has been updated as needed. Change-Id: I3f5bc83b1422bcbe065276b16bfb91e656f5c174 Reviewed-on: https://pdfium-review.googlesource.com/22252 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-04Remove CXFA_DataDataDan Sinclair
This CL removes the CXFA_DataData base class and the functionality is moved to where it's needed. Change-Id: Ieba31aa924b9b513466144b31f0e1613923c50aa Reviewed-on: https://pdfium-review.googlesource.com/22250 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-04Fold CXFA_EventData into CXFA_EventDan Sinclair
This CL removes the CXFA_EventData wrapper and puts the code into CXFA_Event. Change-Id: I799a641c434ff926f3ddade1f47845b5666dbbec Reviewed-on: https://pdfium-review.googlesource.com/21991 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-04Fold CXFA_FontData into CXFA_FontDan Sinclair
This CL removes the CXFA_FontData wrapper and puts the functionality into CXFA_Font. Change-Id: Id7e3a71106816a05843a62645f5955a70f7eaeaa Reviewed-on: https://pdfium-review.googlesource.com/22113 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-03Fold CXFA_ImageData into CXFA_ImageDan Sinclair
This CL folds the CXFA_ImageData wrapper into CXFA_Image. Change-Id: I36596abc4dff7d17dc6ee13a857a084f41164c7a Reviewed-on: https://pdfium-review.googlesource.com/22190 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-03Fold CXFA_CaptionData into CXFA_CaptionDan Sinclair
This CL folds the CXFA_CaptionData wrapper class into CXFA_Caption. Change-Id: I65302656a89985dec4d0ec1f42b5eaa95d22aae2 Reviewed-on: https://pdfium-review.googlesource.com/22150 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-03Fold CXFA_MarginData into CXFA_Marginchromium/3311Dan Sinclair
This CL removes the CXFA_MarginData wrapper and moves the methods directly to CXFA_Margin. Change-Id: I7c9e979fb78d0d356605f1318489daabcb8c32cd Reviewed-on: https://pdfium-review.googlesource.com/22110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-03Fold CXFA_CalculateData into CXFA_CalculateDan Sinclair
This CL folds CXFA_CalculateData into CXFA_Calculate as it is just a thin wrapper. Change-Id: I35efbee6c0244139a7ece19f3e8ee18bfb931dda Reviewed-on: https://pdfium-review.googlesource.com/22090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-12-14Fold CXFA_ParaData into CXFA_ParaDan Sinclair
This CL removes the CXFA_ParaData wrapper and folds the code into CXFA_Para. Change-Id: I86d139f1df48dcc80d28c7516b1bda95a59e94bd Reviewed-on: https://pdfium-review.googlesource.com/21270 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-12-14Change CXFA_Node::GetChild to return proper typesDan Sinclair
Currently CXFA_Node::GetChild always returns a CXFA_Node* object. We know the type we want when we call GetChild, so this CL changes the code to add a template parameter to GetChild and return the correct CXFA_Node subtype for the desired element. Change-Id: I5aecf2e840504235dc246483abee48e0564841fe Reviewed-on: https://pdfium-review.googlesource.com/21210 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-12-14Fold CXFA_ScriptData into CXFA_ScriptDan Sinclair
This CL removes the CXFA_ScriptData wrapper and uses CXFA_Script directly. Change-Id: I1f1932ef96ee4a24407de7eb1d68b8631a5a67ea Reviewed-on: https://pdfium-review.googlesource.com/21173 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-12-14Fold CXFA_SubmitData into CXFA_SubmitDan Sinclair
CXFA_SubmitData is a thin wrapper around CXFA_Submit. This CL folds the two classes together. Change-Id: I867b6db067786d232df2a25c1ba7b29d6d454f8e Reviewed-on: https://pdfium-review.googlesource.com/21190 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-12-14Fold CXFA_TextData into CXFA_TextDan Sinclair
This CL folds the CXFA_TextData back into CXFA_Text. CXFA_TextData is a thin wrapper around the CXFA_Text object. Change-Id: I4edc37f2ac66fc9b662942d3351fce6b697f27c7 Reviewed-on: https://pdfium-review.googlesource.com/21172 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-12-14Fold CXFA_ValueData into CXFA_ValueDan Sinclair
The CXFA_ValueData class is a thin wrapper around the CXFA_Value, this CL moves the methods from CXFA_ValueData into CXFA_Value. Change-Id: I2c57e93e5c4675b82af71cf75f2dfc0fb12e4b20 Reviewed-on: https://pdfium-review.googlesource.com/21170 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-12-14Fold CXFA_ValidateData into CXFA_ValidateDan Sinclair
The ValidateData class is a thin wrapper around the Validate class. Now that the Validate class exists we can fold the methods from ValidateData into Validate. Change-Id: I1e72f4b7bddeb22a311f4fe9a5940204221b6d2a Reviewed-on: https://pdfium-review.googlesource.com/21150 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-12-13Methods are on CJX_Object not CJX_Node nowDan Sinclair
This CL converts all of the JSNode() to JSObject() calls as all of the original CJX_Node methods have been moved to CJX_Object. This fixes potential bad casts from things like CJX_Content which do not inhert from CJX_Node. Bug: pdfium:793372 Change-Id: I6c7f63a78f3d47bb6bad74faed3fd8c535bf095e Reviewed-on: https://pdfium-review.googlesource.com/21090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-12-11[xfa] Refactor CJX method signatures.Dan Sinclair
This CL changes the CJX methods from void (*)(CFXJSE_Arguments*) to CJS_Return (*)(CJS_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) which is closer to how CJS works in practice. Change-Id: I3a3129268acfe4262dfeb04179919ed19f6c24e1 Reviewed-on: https://pdfium-review.googlesource.com/20491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-12-07Change %s to %ls in calls to WideString::FormatRyan Harrison
This fixes the text in validation pop ups for XFA forms. BUG=pdfium:951,pdfium:950 Change-Id: Iad46a30cae3fafcf9f73a46cb204c2de54b62b68 Reviewed-on: https://pdfium-review.googlesource.com/20490 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-11-30Rename XFA_ATTRIBUTEENUM to XFA_AttributeEnum enum classDan Sinclair
This CL changes the enum XFA_ATTRIBUTEENUM to an enum class XFA_AttributeEnum. Methods expecting an int32 have been updated to take or return the XFA_AttrbuteEnum type. Change-Id: I268453949545fe2dd3eae707be4d9cc7edeff763 Reviewed-on: https://pdfium-review.googlesource.com/20070 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Generate XFA node attribute informationDan Sinclair
This CL moves the attribute information out of the xfa basic data array and stores in the generated nodes. Change-Id: Id8e280324bf0f75a1da9c937c2734d161324242d Reviewed-on: https://pdfium-review.googlesource.com/19271 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-23Cleanup CXFA_WidgetDatachromium/3277Dan Sinclair
This CL cleans up return values, out-params and changes simple methods to boolean checks where possible in CXFA_WidgetData. Change-Id: I29daa67993730f3e9d61cb6fdf918a886cc9120e Reviewed-on: https://pdfium-review.googlesource.com/19230 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-22Cleanup CXFA_ValueDataDan Sinclair
This CL makes the methods const and uses return values instead of out-params. Change-Id: If760cd8c10d8f3a94dd3e13c46200cb6738a4d5a Reviewed-on: https://pdfium-review.googlesource.com/19150 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-11-22Cleanup CXFA_ValidateDataDan Sinclair
This CL removes out-params in favour of returns; Makes params const; Cleans up return types. Change-Id: I2b7c237130a99859b08af0486a95b4c6f6974f62 Reviewed-on: https://pdfium-review.googlesource.com/19130 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-21Cleanup CXFA_ScriptDataDan Sinclair
This CL cleans removes out params, makes methods const and moves the XFA_ScriptDataType into CXFA_ScriptData. Change-Id: I5a51a0eddc3608577a387472911000daa479af0f Reviewed-on: https://pdfium-review.googlesource.com/19090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-21Cleanup CXFA_ParaDataDan Sinclair
This CL fixes the return types and makes the CXFA_ParaData methods const. Change-Id: Ifb63b46e826d9741682d992d7fc1ee37c772fb41 Reviewed-on: https://pdfium-review.googlesource.com/19070 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-21Cleanup CXFA_ImageDataDan Sinclair
This CL removes the second constructor parameter which is always true and removes all related conditionals. The methods have been changed to const and return instead of using out parameters. Change-Id: Id6d2aa533a212e961e3b8169eef57b7e868d503e Reviewed-on: https://pdfium-review.googlesource.com/19010 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-11-21Cleanup CXFA_FontDataDan Sinclair
This CL makes the various methods const and removes out params from CXFA_FontData. Change-Id: I85268906a2454c23b73d5724c2556758246791cb Reviewed-on: https://pdfium-review.googlesource.com/18970 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-11-21Convert CXFA_WidgetData methods to OptionalDan Sinclair
This CL converts the CXFA_WidgetData size methods to return Optionals instead of boolean with an out parameter. Change-Id: Ibf2fef5a58896abfea9865e086029377c051bdb6 Reviewed-on: https://pdfium-review.googlesource.com/18892 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-21Rename the CXFA_WidgetData size methods from Get to TryDan Sinclair
These methods all return a boolean so should be named Try instead of Get. Change-Id: Ic447bd400c0b4ddcb0d15893883d480ebc33e17d Reviewed-on: https://pdfium-review.googlesource.com/18891 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-21Add CXFA_MarginData::Get*Inset helpersDan Sinclair
This CL adds Get*Inset helpers to CXFA_MarginData which just return a default value of 0 if the Try*Inset method fails. Change-Id: I03b00b7a371c39e521f95952e965b4a3ef71d517 Reviewed-on: https://pdfium-review.googlesource.com/18870 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-20Rename CXFA_MarginData methodschromium/3274Dan Sinclair
This CL renames the CXFA_MarginData::Get*Inset methods to CXFA_MarginData::Try*Inset to match the fact that they may fail. The default value has been removed and all the callers correctly set the default values. Change-Id: Ib0dc8dc35807b60a0ddc0e5724604cb39845fcea Reviewed-on: https://pdfium-review.googlesource.com/18771 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-20Remove CXFA_DataData operator bool overrideDan Sinclair
This CL removes CXFA_DataData::operator bool in favour of an explicit HasValidNode method. This makes the call sites a lot clearer. Change-Id: I6fae14fdeec4674ca7916e21b9e5703070fc3069 Reviewed-on: https://pdfium-review.googlesource.com/18830 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-11-20Convert CXFA_CalculateData::GetMessageText to return WideStringDan Sinclair
Change-Id: I2ae79c6e77fe2717519156af15cd6cbdd19b58f1 Reviewed-on: https://pdfium-review.googlesource.com/18813 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-11-20Convert calc data and layout item to store in CJX_NodeDan Sinclair
This CL moves the XFA_CalcData and XFA_LayoutItem out of the map'd data for a CJX_Node and stores directly on the node. This makes the object a bit bigger but makes the code a lot more understandable. Change-Id: I8897a52d61d37595181960c23928984aa5d67efc Reviewed-on: https://pdfium-review.googlesource.com/18590 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-16Make WideString::{Format|FormatV} staticDan Sinclair
This CL moves the Format and FormatV methods from WideString to be static. Bug: pdfium:934 Change-Id: I9941d6a2a5bbf0a82087cd0ea5d0f8fc42eecd3e Reviewed-on: https://pdfium-review.googlesource.com/18630 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-16Convert TryEnum to return an optionalDan Sinclair
This CL converts CJX_Node::TryEnum to return a pdfium::Optional instead of a bool with an out parameter. Change-Id: Icc1b063ce51656cc5e467aba358eb9e7d6754fea Reviewed-on: https://pdfium-review.googlesource.com/18512 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-16Convert TryCData and TryContent to optionalsDan Sinclair
This CL changes the TryCData and TryContent to return pdfium::Optional<WideString> values instead of returning a bool and taking an out WideString. Change-Id: I9c9d877803f9f1977191e12d6a907c29784c10b2 Reviewed-on: https://pdfium-review.googlesource.com/18510 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-14Cleanup XFA default value codeDan Sinclair
This CL adds helper methods to CXFA_Node to retrieve the default values for attributes with the correct data types. Change-Id: I644435b4b430819f1060a95fa4fffe4ba2826cfe Reviewed-on: https://pdfium-review.googlesource.com/18450 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-14Cleanup const refs and some enumsDan Sinclair
This CL cleans up some const refs and some enum values from the previous rename CLs. Change-Id: Ifaa990c9c45485bb059e0bda0026093d0a2c0944 Reviewed-on: https://pdfium-review.googlesource.com/18230 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-10Cleanup public methods of CXFA_TextLayoutNicolas Pena
Change-Id: I532c3d7b76b650bbc262925b6a4a26f596a16814 Reviewed-on: https://pdfium-review.googlesource.com/18331 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-11-08Convert XFA_ATTRIBUTE to an enum classDan Sinclair
This CL converts the XFA_ATTRIBUTE enum to an enum class and fixes up various usages. Change-Id: I3dd17cc412d97eb212a65ce63bb9fa19605e1e91 Reviewed-on: https://pdfium-review.googlesource.com/18050 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Value to CXFA_ValueDatachromium/3262Dan Sinclair
This CL renames CXFA_Value to CXFA_ValueData to show it's part of the data hierarchy. Change-Id: I4693234f503903a2c11d76a56dbbb6de5f0c3718 Reviewed-on: https://pdfium-review.googlesource.com/18018 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Validate to CXFA_ValidateDataDan Sinclair
This CL renames CXFA_Validate to CXFA_ValidateData to signify it is part of the data hierarchy. Change-Id: Ib6f743513160990b6d64c4b10618f16554dc5c08 Reviewed-on: https://pdfium-review.googlesource.com/18017 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Text to CXFA_TextDataDan Sinclair
This CL renames CXFA_Text to CXFA_TextData to show it is part of the data hierarchy. Change-Id: If60e480d0590a72b71e06c46aaef831a07f085da Reviewed-on: https://pdfium-review.googlesource.com/18015 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Submit to CXFA_SubmitDataDan Sinclair
This CL renames CXFA_Submit to CXFA_SubmitData to show it's part of the data hierarchy. Change-Id: I6f580a28e41e54ffa1f1c7b799d97f079303463f Reviewed-on: https://pdfium-review.googlesource.com/18014 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>