summaryrefslogtreecommitdiff
path: root/xfa/fxfa
AgeCommit message (Collapse)Author
2017-01-11Convert FDE CSS enums to enum classes.Dan Sinclair
This CL updates the possible FDE CSS enums to enum classes and fixes up any instances of incorrect values being used. A few other cleanups and changes were needed to complete the conversion. Change-Id: Ibcca5229a9ca8de1f4beb6462535f61705fd4f8c Reviewed-on: https://pdfium-review.googlesource.com/2170 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-11Cleaning up memory allocation in CXFA_FM2JSContext - IVDan Sinclair
This CL removes the use of FX_Alloc and any remaining new'd CFXJSE_Value objects from CXFA_FM2JSContext and replaces them with unique_ptrs and vectors. Change-Id: I30ba697d65ee326d2faa895c3217bdc407419298 Reviewed-on: https://pdfium-review.googlesource.com/2157 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-10Strip out custom allocator codeDan Sinclair
This Cl replaces the custom IFX_MemoryAllocator code with new/delete as needed. Change-Id: Ie786f607c9e0b3035ffd87733bc3e29a4b6426d9 Reviewed-on: https://pdfium-review.googlesource.com/2164 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-10Split xfa_textlayout apart.Dan Sinclair
This CL splits the xfa_texlayout.{cpp|h} files into individual class files. Minor reformatting was done in the new clasess. Change-Id: Id79ffcb8dca3fcf287a2e6dec78fd2b1f990a542 Reviewed-on: https://pdfium-review.googlesource.com/2162 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-10Remove more _LP* typedefs.tsepez
Code is much clearer when we use the actual types rather than this convention. Review-Url: https://codereview.chromium.org/2618993002
2017-01-06Remove CFX_MapPtrToPtr and templates.chromium/2976chromium/2975tsepez
All usage is now replaced with stl equivalents. Move one definition from fx_basic.h to where it's actually needed. Review-Url: https://codereview.chromium.org/2612773007
2017-01-05use unique_ptr in cxfa_layoutprocessor.htsepez
Review-Url: https://codereview.chromium.org/2617483005
2017-01-06Cleaning up memory allocation in CXFA_FM2JSContext - IIIDan Sinclair
This CL updates the unique_ptrs to use MakeUnique instead of new. The types are updated to be auto. Change-Id: I2a82a4ec6659e5c343cc03d4840b3046ecb6934e Reviewed-on: https://pdfium-review.googlesource.com/2156 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-05Cleaning up memory allocation in CXFA_FM2JSContext - IIDan Sinclair
This CL removes the size arrays and variables and uses the vector to get the size directly. Change-Id: I0f7b5f48e53ff1ec379ad34a23807d70b02a538a Reviewed-on: https://pdfium-review.googlesource.com/2155 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-05Cleaning up memory allocation in CXFA_FM2JSContext - Ichromium/2974Dan Sinclair
This CL updates ::ParseResolveResult to accept a std::vector<std::unique_ptr<CFXJSE_Value>>& instead of a CFXJSE_Value**&. This removes a bunch of manual new/delete code used to mantain the values. The size parameter was also removed and is retrieved by calling .size() on the vector now. Change-Id: I60fc6176523ece112d41fdefc767aaefedfae2db Reviewed-on: https://pdfium-review.googlesource.com/2153 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-05Properly ref-count CFGAS_GEFont with CFX_RetainPtr.tsepez
We worry about cyclical references, but no leaks found. Review-Url: https://codereview.chromium.org/2609423003
2017-01-05Remove CFX_MapPtrToPtr from xfa/fxfa.tsepez
Review-Url: https://codereview.chromium.org/2612923002
2017-01-03remove some CFX_ArrayTemplate in xfa_ffdocview.hchromium/2971tsepez
Review-Url: https://codereview.chromium.org/2593163002
2017-01-03Remove the ::GetCapacity methods.Dan Sinclair
The GetCapacity methods return a void* because they return different types of internal class memory based on what the calling parameter was. This is confusing and makes it difficult to tell when then enum values can be removed. This CL removes GetCapacity and adds methods as needed to get the real values. Change-Id: I64c2edc858220624880e27f4ed49c2dae080f462 Reviewed-on: https://pdfium-review.googlesource.com/2137 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-03Create individual exception methods.Dan Sinclair
This CL removes the LoadString method from CPDFXFA_Context and, instead, creates individual exception methods for each of the loaded strings and calls as needed. BUG=pdfium:549 Change-Id: I1d975f01f13f45a885946a9952f24b13387dc3e4 Reviewed-on: https://pdfium-review.googlesource.com/2135 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-03Kill last use of CFX_PtrList.tsepez
I'd been waiting on this hoping the code would be refactored out of existence, but it looks to be used. Use tests against x.end() in place of a "null position". This is greatly complicated by the use of "tail position", which now calcluated by std::prev(x.end()) unless the list is empty. Review-Url: https://codereview.chromium.org/2592163002
2017-01-03Cleaning out params in CPDFXFA_ContextDan Sinclair
This CL cleans up some of the out params in CPDFXFA_Context. In the process several of the strings returned by ::LoadString() are inlined in their call sites and the defines removed. BUG=pdfium:549 Change-Id: I41a7ceeba3962299eecd0cb714ddb03d28dbb0ea Reviewed-on: https://pdfium-review.googlesource.com/2134 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2016-12-16Better tests for password protected documents.chromium/2954tsepez
- Add unit tests for sha256 implementation. - Remove void* types from API in favor of correct actual types. Review-Url: https://codereview.chromium.org/2577223002
2016-12-14Return unique_ptr from CXFA_FFApp::CreateDoc.tsepez
Remove one unused CreateDoc variant. Review-Url: https://codereview.chromium.org/2576893002
2016-12-14Update CFWL_ListBox to return instead of using out params.dsinclair
This CL updates the CFWL_ListBox code to work with return values instead of out params. This also extracts the CFWL_ListItem code out of CFWL_ListBox and puts into the correct class. Review-Url: https://codereview.chromium.org/2572783002
2016-12-14Avoid the ptr.reset(new XXX()) anti-patterntsepez
Be suspicious of |new|. This removes some of the easy cases. Review-Url: https://codereview.chromium.org/2571913002
2016-12-13Replace CFX_FloatArray with std::vectortsepez
Review-Url: https://codereview.chromium.org/2567503002
2016-12-08Replace CFX_WideStringCArray with std::vector.chromium/2946tsepez
Review-Url: https://codereview.chromium.org/2562833002
2016-12-08Change layout item in CFWL_Widget type from voiddsinclair
Previously the LayoutItem was a void*. This Cl changes the LayoutItem to explicity be a CXFA_FFWidget. Review-Url: https://codereview.chromium.org/2559643004
2016-12-08Cleanup CFWL_Widget code to return CFX_RectFs where appropriatedsinclair
This Cl changes the various Get*Rect methods in CFWL_Widget to return CFX_RectF classes instead of taking an out parameter. The Repaint method is split into Repaint() and RepaintRect() in order to change the param to a const CFX_RectF& from a CFX_RectF*. Review-Url: https://codereview.chromium.org/2560873005
2016-12-08Remove last usage of CFX_ObjectArray.tsepez
Review-Url: https://codereview.chromium.org/2558373002
2016-12-08Replace CFX_WideStringArray with std::vectortsepez
Minimalist changes with the tidying of the code to use better loop iterators as a follow-up. Review-Url: https://codereview.chromium.org/2556963004
2016-12-08Move xfa/fwl/core to xfa/fwl.dsinclair
The core/ directory in FWL no-longer provides any context. This Cl moves all of the core/ files up to the fwl/ folder. As well, the CFWL_EvtFoo files are renamed CFWL_EventFoo and the CFWL_MsgFoo files are renamed CFWL_MessageFoo. The event and message preceed the type in order to keep the files sorted together and to make it clear that they're all related. Review-Url: https://codereview.chromium.org/2559173002
2016-12-07Use unique_ptr for CXFA_XMLParser.tsepez
Also rename CFDE_XMLParser to IFDE_XMLParser since its an interface. Review-Url: https://codereview.chromium.org/2555373002
2016-12-07Convert GetWidgetRect to return rect.dsinclair
Current GetWidgetRect accepts the rect as an out-param. This CL converts the code to return the rect instead. Review-Url: https://codereview.chromium.org/2556873004
2016-12-07Cleanup return values in CFWL_ComboBoxdsinclair
This CL changes methods in CFWL_ComboBox to return values instead of taking out params. Review-Url: https://codereview.chromium.org/2555103005
2016-12-07Cleanup FWL default values part II.dsinclair
This CL cleans up the remaining default values in the fwl/core directory. Some methods are renamed to better represent what they do. Review-Url: https://codereview.chromium.org/2557103002
2016-12-07Cleanup default FWL params part Idsinclair
This Cl removes some of the default FWL parameters. Review-Url: https://codereview.chromium.org/2533623002
2016-12-07Cleanup FWL Event and Message code.dsinclair
This CL removes any CFWL_Evt classes for which nothing was listening to the events. For events with no parameters the override class was removed and the event type passed into CFWL_Event which is used instead. Any event or message parameters which are un-read have been removed. Review-Url: https://codereview.chromium.org/2530993002
2016-12-07Remove CFX_FormatString::Release()tsepez
Avoid the |delete this| anti-pattern. Remove some checks which don't avoid other segvs anyways. Review-Url: https://codereview.chromium.org/2557173002
2016-12-07Catch stray Retains() and Releases() outside of RetainPtr<>.tsepez
The previous CLs made the code clean, so now we can mark more things private, and add friends as appropriate. Review-Url: https://codereview.chromium.org/2560783003
2016-12-07Refcount IFGAS_ streams all the time, tootsepez
IFGAS_Streams are not part of the IFX_Stream hierarchy, but can be made from such. Review-Url: https://codereview.chromium.org/2559763002
2016-12-07Refcount all the IFX_ stream classes all the time.tsepez
We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002
2016-12-06Return unique_ptrs from CFX_DIBitmap::Clone().tsepez
Because that's what clone does. Perform immediate release in some spots to avoid disrupting too much at once. Review-Url: https://codereview.chromium.org/2534953004
2016-12-02Rename IFX_Stream to IFGAS_Stream.tsepez
It's a separate hierarchy unrelated to the IFX_*Stream classes. Also rename CFX_Stream to CFGAS_Stream, and so forth. Review-Url: https://codereview.chromium.org/2535723010
2016-12-01Make concrete stream classes private to .cpp, part 3tsepez
Review-Url: https://codereview.chromium.org/2545953002
2016-12-01Move Init to constructor in CXFA_FMProgramNicolas Pena
Change-Id: I6b2d1a5b06211b32f3053aad4d7ae7501ec8d8f6 Reviewed-on: https://pdfium-review.googlesource.com/2093 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-11-30Convert loose FX_Create* functions into static methodstsepez
Also remove a bool that is always false. Review-Url: https://codereview.chromium.org/2539203002
2016-11-29Use unique_ptr in CFXA_FM expressions constructorschromium/2937npm
Review-Url: https://codereview.chromium.org/2534143003
2016-11-28Use unique pointers in CXFA_FMParsenpm
Replaced CXFA_FMParse's returns to be unique pointers to prevent leaks. Review-Url: https://codereview.chromium.org/2530933002
2016-11-24Change TxtEdtEngine to return CFX_WideStringchromium/2935chromium/2934chromium/2933chromium/2932dan sinclair
This Cl updates the TxtEdtEngine and TxtEdtBuf to return CFX_WideStrings on a Get instead of taking an out param. The change is propagated out through the various Get methods that call into the edit engine. Change-Id: Iccf10a8ee06678ae3b59f3afd6e65308dacd16bd Reviewed-on: https://pdfium-review.googlesource.com/2070 Commit-Queue: ooo 11-24 -- 12-05 (dsinclair) <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2016-11-23Merge IFWL and CFWL classes.dsinclair
This CL merges the IFWL hierarchy into the CFWL hierachy. All CFWL proxy methods have been replaced by the IFWL implementations. Review-Url: https://codereview.chromium.org/2524173002
2016-11-23Rename IFWL classes which do not have CFWL equivalentsdsinclair
This CL moves the IFWL classes that do not have CFWL class buddies to have the CFWL name. This CL leaves the tree in a weird state of having CFWL be two hierarchies, one of which is intertwined with the IFWL hierarchy. This should be commited just before the CL to move the rest of IFWL to CFWL. Review-Url: https://codereview.chromium.org/2525083002
2016-11-23More unique_ptrs in CXFA_FMParse::ParseForeachExpression and avoid leaknpm
Commit a31098417852bdf13e693a6e0913e0706cf94098 accidentally caused a leak. Replaced pointers with unique_ptr to prevent this from happening. BUG=664891 Review-Url: https://codereview.chromium.org/2528543003
2016-11-22Rename IFWL_App to CFWL_Appdsinclair
This class is not an interface but a concrete implementation. Rename to match. Review-Url: https://codereview.chromium.org/2521303002