summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_widgetacc.cpp
AgeCommit message (Collapse)Author
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>
2017-11-07Rename CXFA_Script to CXFA_ScriptDataDan Sinclair
This CL renames CXFA_Script to CXFA_ScriptData to show it is part of the data hierarchy. Change-Id: Idba3618af6a95eae2ff4541184e5a17f1457e1cb Reviewed-on: https://pdfium-review.googlesource.com/18012 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Para to CXFA_ParaDataDan Sinclair
This CL renames CXFA_Para to CXFA_ParaData to show it is part of the data hierarchy. Change-Id: I71f58c87416b17d1e59252ca374aad13935fc430 Reviewed-on: https://pdfium-review.googlesource.com/17989 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Margin to CXFA_MarginDataDan Sinclair
This CL renames CXFA_Margin to CXFA_MarginData to reflect the fact this is part of the data hierarchy. Change-Id: I50d82d01fcaf35c621f13b8b68bc04d850ec885a Reviewed-on: https://pdfium-review.googlesource.com/17986 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Image to CXFA_ImageDataDan Sinclair
This CL renames CXFA_Image to CXFA_ImageData to make it clear it's part of the data hierarchy. Change-Id: Ia593ef3c9deb872db11f8246b13ef3c39a90d4c7 Reviewed-on: https://pdfium-review.googlesource.com/17984 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Font to CXFA_FontDataDan Sinclair
This CL renames CXFA_Font to CXFA_FontData to make it clear this is part of the data hierarchy. The GetFontNode methods were renamed to GetFontData to match the return type. Change-Id: I5d5b9200eedc9c8c1bd8929a5a0df3d2663d7e3d Reviewed-on: https://pdfium-review.googlesource.com/17983 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Event to CXFA_EventDataDan Sinclair
This CL renames CXFA_Event to CXFA_EventData to make it clear it's part of the Data hierarchy. Change-Id: I3659dfba66498d07ce75fd5e8322732f9898e688 Reviewed-on: https://pdfium-review.googlesource.com/17980 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Caption to CXFA_CaptionDataDan Sinclair
This CL renames CXFA_Caption to CXFA_CaptionData to make it clear it's part of the data hierarchy. Change-Id: I0268005e12a6b58aed7274bf9d023887119a8a63 Reviewed-on: https://pdfium-review.googlesource.com/17977 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Calculate to CXFA_CalculateDataDan Sinclair
This CL renames CXFA_Calculate to CXFA_CalculateData to make it clear it's part of the data hierarchy. Change-Id: I259b9816bde9cc6c70550944906fcafa954ef32e Reviewed-on: https://pdfium-review.googlesource.com/17976 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-06Cleanup CXFA_WidgetAccDan Sinclair
This CL cleans up some CXFA_WidgetAcc methods and hides the need for a CFXJSE_Value inside the class. The API which required the Value always used it to retrieve a boolean value, so make a new API which returns the bool. Change-Id: Ic50a9a73c992a9db8b57ce5f9f5ac17c88267809 Reviewed-on: https://pdfium-review.googlesource.com/17853 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-04Remove default values from CXFA_Node::{CountChildren|GetChild}chromium/3259Dan Sinclair
This CL removes the default values and inlines into the call sites as needed. Change-Id: I554e9d5ac781003695f90522f9c6c3160653eb59 Reviewed-on: https://pdfium-review.googlesource.com/17572 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Roll {Set|Get}ScriptContent into {Set|Get}ContentDan Sinclair
The SetContent method was a proxy to SetScriptContent. The GetContent added a default param value. The methods have been merged and the GetContent call sites updated to pass in the needed value. Change-Id: I61f950bef8beec7157bdb22e0a25904729f9e00a Reviewed-on: https://pdfium-review.googlesource.com/17613 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>