summaryrefslogtreecommitdiff
path: root/xfa/fxfa
AgeCommit message (Collapse)Author
2017-04-28Remove more |new|s, part 3Tom Sepez
These are already unique_ptr's, we should make them as such. Change-Id: I576396d73c1d39e7a3bc8f91e8530d2e08883213 Reviewed-on: https://pdfium-review.googlesource.com/4614 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-28CXFA_FMStringExpression: int16_t is not a good type for a string index.Tom Sepez
Use early return while we're at it. Bug: 716519 Change-Id: I4630d8b6121266c76a53f0171ba6dfd307da725a Reviewed-on: https://pdfium-review.googlesource.com/4611 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-04-26Avoid unordered_set and maps for the time being.chromium/3082Tom Sepez
See discussion at https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/rdxOHKzQmRY Change-Id: I1803ae97c39b592001835814e2f6674b2c7cb3ea Reviewed-on: https://pdfium-review.googlesource.com/4531 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-25Use unique_ptr in CXFA_ScriptContext::m_mapVariableToContext.Tom Sepez
Remove unused CFXJSE_Arguments::GetRuntime(). Remove some default argument values. Make members of CFXJSE_Context private. Change-Id: Id21951f7d8d68929b2799a9d6a2cdd7a3677f52a Reviewed-on: https://pdfium-review.googlesource.com/4493 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-25Use fx_extension.h utilities in more places in xfa/Lei Zhang
Change-Id: Id58c313aa446ecfa223e5c8edc095586b62a61fa Reviewed-on: https://pdfium-review.googlesource.com/4455 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-24Use a pdfium-specific unittest main rather than gtest'sTom Sepez
We must initialize our partition allocator before calling into any test cases. We can then remove the FPDF_Test class, which did the same thing. Change-Id: I614480fa474b2032052857a02e94781f15a27a4e Reviewed-on: https://pdfium-review.googlesource.com/4473 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-24Nit cleanup in XFA widget codeDan Sinclair
This Cl cleans up nits in the remaining XFA widget code. Change-Id: I10f33ee2ab0ebdb06aeee582a04188fbd7a8bf9e Reviewed-on: https://pdfium-review.googlesource.com/4472 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-24Cleanup the XFA Bacode widgetDan Sinclair
This Cl cleans up the XFA barcode widget. The custom binary search is removed. Some code shuffled from the header to the cpp file. Nits fixed. Change-Id: Icad0d2b25b07ea36afc5a5922a79f55b82616486 Reviewed-on: https://pdfium-review.googlesource.com/4394 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-21Add CFX_RenderDevice::AutoRestorer()chromium/3078Tom Sepez
Avoid cleanup on every return path. Change-Id: I6978adb6f31020d812ac88c5d46c703d1461d373 Reviewed-on: https://pdfium-review.googlesource.com/4435 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-21Change more fxbarcode to use return values.Lei Zhang
Change-Id: Idcc05fb8c5a1448f552b4db5ae131ad82aef4d59 Reviewed-on: https://pdfium-review.googlesource.com/4258 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-04-20Remove hand-written bsearch from cxfa_dataexporter.cppTom Sepez
Binary search over an array of 5 elements is overkill. Change-Id: I3a39e82035d67564012c11aaf78045e435d59a41 Reviewed-on: https://pdfium-review.googlesource.com/4396 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-20Cleanup some XFA widget codeDan Sinclair
This CL cleans up the nits in some of the XFA widget files. Change-Id: If72e7855a09a22b2ec8ad3ce297b142ce35f71c9 Reviewed-on: https://pdfium-review.googlesource.com/4395 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-20Let {Argb,Cmyk}Decode return tuplesNicolas Pena
Change-Id: Ic4e766d9417f9a9ece5f9e4269d0f96e1e91639b Reviewed-on: https://pdfium-review.googlesource.com/4392 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-20Convert IFX_MemoryStream to CFX_MemoryStreamDan Sinclair
The CFX_MemoryStream is the only implementation of IFX_MemoryStream. This CL removes the interfaces and uses CFX_MemoryStream directly. Change-Id: I2f43fa39e82dafa7673517d214ae15fd2d0df331 Reviewed-on: https://pdfium-review.googlesource.com/4391 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-20Do not insert null node if ParseAsXDPPacket_Config failsTom Sepez
Doing so trips an assert in the debug build but is harmless otherwise. This appears to be wrong since the beginning of time. Bug: 709793 Change-Id: I179f6944a3f7b2a89efa65a16078f6f58448ba4b Reviewed-on: https://pdfium-review.googlesource.com/4390 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-20Cleanup the fx_extension code.Dan Sinclair
This CL cleans up the fx_extension file. The stream code was moved to fx_stream. IFX_FileAccess was removed and CFX_CRTFileAccess split to its own file. Code shuffled from header to cpp file. Change-Id: I700fdfcc9797cf4e8050cd9ba010ad8854feefbf Reviewed-on: https://pdfium-review.googlesource.com/4371 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-19Cleanup the fgas_language definesDan Sinclair
This CL renames the language defines to be country and language code instead of names. The XFA_LANG copies have been removed in favour of the FX_LANG variants. Change-Id: I7307c4128baa29b9c71b37278e018e95b5527e33 Reviewed-on: https://pdfium-review.googlesource.com/4317 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-19Move fde XML parser to coreDan Sinclair
This CL moves the XML parser from FDE into FXCRT and renames to CFX_ from CFDE_. Change-Id: I21a9590bf74daf5517df630d7e7a5de89da99ea4 Reviewed-on: https://pdfium-review.googlesource.com/4312 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-19Move CFGAS_Stream to CFX_SeekableStreamProxyDan Sinclair
This CL moves the FGAS stream code into core/fxcrt and renames to CFX_SeekableStreamProxy. Change-Id: I6641fe0cca45a128ef3ec281b0b40f8d60296387 Reviewed-on: https://pdfium-review.googlesource.com/4311 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-18Remove hand-written bsearch from XFA_GetAttributeEnumByName()Tom Sepez
Change-Id: Ic4bf34dfbdd06971d8935d031bdb7996c78d262f Reviewed-on: https://pdfium-review.googlesource.com/4315 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-18Remove hand-written bsearch from XFA_GetAttributeByName()Tom Sepez
Also fix potential for collisions by checking exact name. Change-Id: I48cd609d28a23f738f7a6c946820a688a4163024 Reviewed-on: https://pdfium-review.googlesource.com/4314 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-18Rename IFGAS_Stream to CFGAS_StreamDan Sinclair
This CL replaces IFGAS_Stream with the only implementation CFGAS_Stream. The CreateReadStream and CreateWriteStream methods are removed in favour of calling MakeRetain directly. Change-Id: I882a89258f642e24fc3d631587db05652bd53ded Reviewed-on: https://pdfium-review.googlesource.com/4210 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-18Remove IFGAS_Stream::CreateWideStringReadStreamDan Sinclair
This Cl removes the wide string read stream and passes through a memory stream as needed. The callers were updated to pass the correct types. Change-Id: I8e2660859a85e38ed1c3f4c596ef7c8242762084 Reviewed-on: https://pdfium-review.googlesource.com/4172 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-18Subclass the stream implementations from CFGAS_StreamDan Sinclair
Rename CFGAS_TextStream to CFGAS_Stream. CFGAS_Stream is converted to a base class instead of accepting an IFGAS_StreamImp. Things which inherted from IFGAS_StreamImp now inherit from CFGAS_Stream. The stream type inputs are changed to IFX_SeekableStream so that they can accept the same type (IFX_SeekableStream is an IFX_SeekableWriteStream and an IFX_SeekableReadStream). This way the storage can be shared in the base class. Change-Id: I06645071e68e2a4d4120c0e336529f2c18c2b705 Reviewed-on: https://pdfium-review.googlesource.com/4152 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-18Use unique_ptr in CFWL_NoteDriver::m_eventTargets mapTom Sepez
Invert CFWL_EventTarget::m_bInvalid for the sake of positive logic. Change-Id: I9ccc512ab2ff553e1033698f36bf3a297c4ee7c9 Reviewed-on: https://pdfium-review.googlesource.com/4251 Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-18Rename text break files to match class names.Dan Sinclair
This CL renames several fgas/layout files to match the class names contained in the files. Change-Id: Ib4feaa902618e577261e51dbac743cb4cb500ea1 Reviewed-on: https://pdfium-review.googlesource.com/4290 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-18Update IFGAS_Stream::WriteString to take a string.Dan Sinclair
This Cl updates the WriteString method to accept a CFX_WideString. Change-Id: I9f480abf32f4132f8ca33799e673a9e8540285f6 Reviewed-on: https://pdfium-review.googlesource.com/4151 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-18Use Byte/WideString iteratorsTom Sepez
Change-Id: I85c8423c177fd7ecd5da90ef89419efc0f9cf44b Reviewed-on: https://pdfium-review.googlesource.com/4262 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-18Use unique_ptr for m_pNormalWidgetTom Sepez
Change-Id: I8f28171b55c625061bb047899dbfcd4a61004e09 Reviewed-on: https://pdfium-review.googlesource.com/4253 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-18Require unique_ptr arg for CXFA_FMLexer::SetToken()Tom Sepez
Change-Id: Id252b3b2208ac9f792220605ddc1eb3ba29e2d55 Reviewed-on: https://pdfium-review.googlesource.com/4260 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-13Add ability to make StringCs from std::vector<>s.Tom Sepez
Pre-cursor to using more std::vector<uint8_t> as byte buffers. The widestring test case is more complicated, where we're not sure of having any particular uint*_t type to match wchar_t. Change-Id: Ic27980f16cdbc61fac7c11f39a85eea58d19bacb Reviewed-on: https://pdfium-review.googlesource.com/4153 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-12Fix string passing coventions in xfa_fm2jscontext.hchromium/3070Tom Sepez
Change-Id: Ibcb3a95a52ab67c4c9c397ff9c4eab483ef1fcc3 Reviewed-on: https://pdfium-review.googlesource.com/3954 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-12Fold CXFA_WideTextRead into IFGAS_StreamDan Sinclair
This Cl moves CXFA_WideTextRead to be in the anonymous namespace of IFGAS_Stream and adds a IFGAS_Stream::CreateWideStringReadStream() method. This is done so we have all the implementations of IFGAS_Stream centralized. Change-Id: I9fbbf0a493fc2dd05fcd544e344268214a75d8a1 Reviewed-on: https://pdfium-review.googlesource.com/4052 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-12Remove MakeSeekableReadStreamDan Sinclair
This Cl removes the MakeSeekableReadStream call and, at the one place it's used, creates an IFX_MemoryStream which is a seekable read stream. Change-Id: I6b0b23636eff47f8caca5432313ba99703e21e4d Reviewed-on: https://pdfium-review.googlesource.com/4037 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-11Avoid long assignment chain in FM parserNicolas Pena
We only parse FM right before translating to JS. Our current implementation of assignment will duplicate to first expression's ToJavascript. So having a long chain of assignments will result in a huge ToJavascript. Bug: chromium:665087 Change-Id: I542371b5787113be2f2d686153ed0a6c48191bab Reviewed-on: https://pdfium-review.googlesource.com/4030 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-11Remove unneeded stream access flagsDan Sinclair
This Cl removes all of the steam access flags other then write. Flags which were always set were removed. Change-Id: I96df4fa0c95d89f4f454db050f3f032bc163e498 Reviewed-on: https://pdfium-review.googlesource.com/4034 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-11Disabiguate CreateStream callsDan Sinclair
This CL creates a CreateReadStream and CreateWriteStream method instead of having a single overloaded method. This removes the need for the cast at the call sites. The access parameter has been rolled into the method as it was always passed the same way to each Create*Stream method. Change-Id: I845951c3fe386b8051daf4f6b2ee5ba29b5c7d54 Reviewed-on: https://pdfium-review.googlesource.com/4032 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-10Remove unused CreateSharedStreamDan Sinclair
The CreateShreadStream code is not called, remove. Change-Id: I62871ce190e50598b7c82ab3b43355dbde6b8b4b Reviewed-on: https://pdfium-review.googlesource.com/4013 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-10Fix bytestring passing conventions, part 2.Tom Sepez
Change pass by reference to const reference or pointer. Change-Id: Ic007f14e6569679a846980a96cc627eac4ecd5d6 Reviewed-on: https://pdfium-review.googlesource.com/3953 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-04-07Cleanup string passing in core/fpdf*Tom Sepez
Return strings where possible. Add missing consts to strings passed by ref. Convert non-const cases to pointers. Rename a few methods to be clearer. Change-Id: I86569bc1744f539e6dd67fc73649b272c016328c Reviewed-on: https://pdfium-review.googlesource.com/3951 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-06Fix unit tests to initialize PartitionAlloc.Chris Palmer
Tests need to be subclasses of FPDF_Test. BUG=pdfium:700 Change-Id: I317ec2c49567e58cb57c6222e387574226f594b3 Reviewed-on: https://pdfium-review.googlesource.com/3890 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Chris Palmer <palmer@chromium.org>
2017-04-05Check first then cast in XFA_FDEExtension_ResolveNamespaceQualifierTom Sepez
Bug: 708383 Change-Id: I6d59fb40bbddd4bdc7224d72bfb789d360f029ca Reviewed-on: https://pdfium-review.googlesource.com/3770 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-05Move XML attribute handling to a base class.Dan Sinclair
This CL moves the attribute handling out of CFDE_XMLElement and CFDE_XMLInstruction into a common CFDE_XMLAttributeNode. The handling is also converted to a std::map from either a) a vector storing name,value,name,value or b) two vectors one for names and the other for values. The unused Get/Set methods for interger and float are removed and the iteration is converted to use iterators. Change-Id: Icda00ae898a595d58b06af0ced337f55f47c317c Reviewed-on: https://pdfium-review.googlesource.com/3753 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-04RefCount CPDF_StreamAcc all the time.Tom Sepez
Pass stream argument to constructor; it feels like a stream accessor should always be made from a stream rather than passing one in after the fact. Change-Id: Iaa46cb37677b81f0170f5d39bab76ad38ea4af44 Reviewed-on: https://pdfium-review.googlesource.com/3620 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-04-04Cleanup CFDE_XMLCharData and CFDE_XMLTextDan Sinclair
This Cl switchs CFDE_XMLCharData to subclass CFDE_XMLText and cleans up the code which was the same except for the accessor names. Change-Id: I85ebf4f3f19f0d15be4dd77a71b89ca8083f4b1e Reviewed-on: https://pdfium-review.googlesource.com/3672 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-04Let CPDF_ImageRenderer own the CFX_ImageRendererNicolas Pena
This CL avoids some void* usage and removes CancelDIBits after making a CPDF_ImageRenderer own its CFX_ImageRenderer. Bug: pdfium:686 Change-Id: Ied205c57a858cc14d8e2c592db3444ed465b2796 Reviewed-on: https://pdfium-review.googlesource.com/3673 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-04-04Finish splitting up fx_dib.hNicolas Pena
After this CL, fx_dib.h only has some definitions used in multiple places. Definitions that were of restricted usage were moved out to the corresponding place. Includes in fx_dib were reduced, thus revealing other needed includes. Change-Id: I3607da0af81c491256d64c0aa085225631efbdcc Reviewed-on: https://pdfium-review.googlesource.com/3594 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-03Split the FDE XML file into indiviual class files.Dan Sinclair
This Cl splits the fde_xml_int file apart into individual class files. Includes are fixed as needed. fde_xml.h is also removed and the needed defines moved to more appropiate places. Change-Id: I29774dabc4d0fb2d5092fcbbe7853f03401b6ec7 Reviewed-on: https://pdfium-review.googlesource.com/3616 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-03Drop FXSYS_ from mem methodsDan Sinclair
This Cl drops the FXSYS_ from mem methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236 Reviewed-on: https://pdfium-review.googlesource.com/3613 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Drop FXSYS_ from math methodsDan Sinclair
This Cl drops the FXSYS_ from math methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I85c9ff841fd9095b1434f67319847ba0cd9df7ac Reviewed-on: https://pdfium-review.googlesource.com/3598 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>