summaryrefslogtreecommitdiff
path: root/xfa/fxfa
AgeCommit message (Collapse)Author
2018-10-26Replace int flags with struct FXDIB_ResampleOptions.Lei Zhang
Using bit values in an int may not be reliable, since different parts of the code can interpret the bits differently. e.g. FXDIB_DOWNSAMPLE and RENDER_FORCE_DOWNSAMPLE are defined in different places, but can be used interchangeably because they just happen to have the same value. It works but is rather fragile. Instead, use a struct of bools to explicitly define what different bits mean. Remove FXDIB_DOWNSAMPLE and friends. Change-Id: I9cf0c8f94d1ed27edf8dba22b0ab0ee67f2722cc Reviewed-on: https://pdfium-review.googlesource.com/c/44650 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-26Forward declare a bunch of classes.Lei Zhang
Then do IWYU to fix up build errors. Move some implementations out of headers to allow more forward declarations. Change-Id: Idbeb978705a21cd6fb710ca9f5e99b4ea7d93ec5 Reviewed-on: https://pdfium-review.googlesource.com/c/44632 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-25Change StartDIBits() to take a matrix by reference.Lei Zhang
In RenderDeviceDriverIface and related classes, and for related methods in the call stack. Change-Id: I420fafe70084eb3941dffc6f9f51ecbed79581de Reviewed-on: https://pdfium-review.googlesource.com/c/44552 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-25Change FXDIB_BLEND_FOO typedefs to an enum class.Lei Zhang
BUG=pdfium:1085 Change-Id: Ieb43d4588e1d689e327e428dcbbf7adba45ce178 Reviewed-on: https://pdfium-review.googlesource.com/c/44545 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Clean up CFX_ImageTransformer parameters.Lei Zhang
- A valid matrix is always passed in, so make the parameter const-ref. Since it is not obvious who owns the passed in matrix, make a copy with the corresponding matrix member. - Since the matrix parameter is const-ref, CFX_DIBBase::TransformTo() can also have a const-ref matrix parameter. - |flags| should be uint32_t, since |m_Flags| is. - |pClips| is only used inside the ctor, so remove |m_pClip|. Change-Id: If3d58a3fd28fa72b4ac7caac15f49a8057c594db Reviewed-on: https://pdfium-review.googlesource.com/c/44541 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Use ASSERT() consistently. Replace assert() usage.Lei Zhang
ASSERT() is PDFium's wrapper for cross-platform wrapper for assert(). Change-Id: Ie2a98a8e1de101f93aa9bf667d6f125d11d129cd Reviewed-on: https://pdfium-review.googlesource.com/c/44539 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-18Do IWYU for core/fxcrt/xml headers.Lei Zhang
Also make more core/fxcrt/xml member variable names consistent in style. Change-Id: I892841b4026df302aa28f754441bf21707e96764 Reviewed-on: https://pdfium-review.googlesource.com/c/44171 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-18Do IWYU in core/fxcrt/css and fix lint errors.Lei Zhang
Change-Id: I6d2b35849e9f1935277986b6c72e6f507d976974 Reviewed-on: https://pdfium-review.googlesource.com/c/43948 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-10-18Change CXFA_LoaderContext::dwFlags to bFilterSpace.Lei Zhang
Only 1 bit in the flag is ever used, so simplify it. Change-Id: I75fb7d89c18cbb2538a1c8702bb85b4f3c10d420 Reviewed-on: https://pdfium-review.googlesource.com/c/44256 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-18Convert CXFA_LoaderContext to a struct.Lei Zhang
It only has members and they are all public. Initialize them in the header, remove an unused one, and remove the "m_" prefix. Change-Id: Ia4a0b673794f82afddfc6c1bd3a73700cb968259 Reviewed-on: https://pdfium-review.googlesource.com/c/44255 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-18Clean up CXFA_TextLayout.Lei Zhang
- Forward declare more. - Initialize members in the header. - Move code into anonymous function and fix nits. Change-Id: I5fda66266ead631ae63461b6455d516dbec629fc Reviewed-on: https://pdfium-review.googlesource.com/c/44254 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-15Split pdfium_embeddertests sources.chromium/3582Lei Zhang
Move foo_embeddertest.cpp to the same BUILD.gn file as foo.cpp. Set up dependencies to make pdfium_embeddertests pass gn check. Change-Id: If1fe67c261960c35c344c1047950cd7fdb32c4a1 Reviewed-on: https://pdfium-review.googlesource.com/c/43997 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Split pdfium_unittests sources.Lei Zhang
Move foo_unittest.cpp to the same BUILD.gn file as foo.cpp. Set up dependencies to make pdfium_unittests pass gn check. Change-Id: Id9f649d5d0c76fe4254f3887778516abb75fcbce Reviewed-on: https://pdfium-review.googlesource.com/c/43995 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Make fxjs/ pass gn check.Lei Zhang
Use allow_circular_includes_from as a crutch for now. Change-Id: I8c53bafd864048506a77354f57e27cac50369005 Reviewed-on: https://pdfium-review.googlesource.com/c/43989 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Make xfa/ pass gn check.Lei Zhang
Use allow_circular_includes_from as a crutch for now. Change-Id: I1aad3276a6fd571071270090235b0cfb625e337b Reviewed-on: https://pdfium-review.googlesource.com/c/43986 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Make core/fxcrt pass gn check.Lei Zhang
Split some XFA-only code into their own targets to avoid circular dependencies. Make CFX_SeekableMultiStream XFA-only. Change-Id: I88f49556623d52dddd4d0013cc3308b694c01d42 Reviewed-on: https://pdfium-review.googlesource.com/c/43973 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Do IWYU in xfa.Lei Zhang
Change-Id: Ia104471caffe79f92d439920baeea37a71c71c50 Reviewed-on: https://pdfium-review.googlesource.com/c/43971 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Split core/fxcrt build rules into core/fxcrt/BUILD.gn.Lei Zhang
Change-Id: I9b3608bd76ec4911a4bb820fcda62c5d9533fb4f Reviewed-on: https://pdfium-review.googlesource.com/c/43947 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Remove more unnecessary includes and do IWYU as needed.Lei Zhang
Also move some implementations out of headers. Change-Id: I321fc26970c440d874b135bd28e8bc8156b9afee Reviewed-on: https://pdfium-review.googlesource.com/c/43890 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-12Split fxjs build rules into fxjs/BUILD.gn.Lei Zhang
Change-Id: I7d9d5bb14a4a2b11afeab0da25bad35322560d3b Reviewed-on: https://pdfium-review.googlesource.com/c/43942 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-10-12Split xfa build rules into various BUILD.gn files in xfa/.Lei Zhang
Change-Id: I3e6624d0e7af6c4f7ec9674d5990ae25cc3954d0 Reviewed-on: https://pdfium-review.googlesource.com/c/43941 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-10-12Rename CPDF_{Array,Dictionary}::GetCount() to size().Lei Zhang
Make them compatible with pdfium::CollectionSize(). Change-Id: Ibef3b182e35a7eca7c656cf590462782de0cc157 Reviewed-on: https://pdfium-review.googlesource.com/c/43937 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-09Do IWYU for retain_ptr.h and unowned_ptr.hLei Zhang
Change-Id: I2897feee27f80c85f0328f0b220ae5be93686170 Reviewed-on: https://pdfium-review.googlesource.com/c/43610 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-09Do IWYU for ptr_util.h.Lei Zhang
Change-Id: Ib96a66eb47bea791f061e1d6da8aadad8037a99d Reviewed-on: https://pdfium-review.googlesource.com/c/43609 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-09Do IWYU for cpdf_dictionary.h.Lei Zhang
Move some method implementations out of headers in the process. Change-Id: I8701e360d4addd9aec39fe887d932209985d2443 Reviewed-on: https://pdfium-review.googlesource.com/c/43608 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-04Change |virtual ~Foo(){}| to |virtual ~Foo()=default;|chromium/3571Tom Sepez
Otherwise code coverage flags the empty body as unreachable. Change-Id: Iee1d9a876d68276529c70d9b8c7a28276f271767 Reviewed-on: https://pdfium-review.googlesource.com/c/43514 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Reject argument lists that are not comma separatedRyan Harrison
The FormCalc grammar explicitly calls out that argument lists must have commas separating the simple expressions that make up the elements. The current implementation will accept the invalid string !a!b!c, which is 3 variables; !a, !b, and !c. BUG=chromium:890407 Change-Id: I3e2da4abce9989e9e9b929ce2da030e0f8dfd371 Reviewed-on: https://pdfium-review.googlesource.com/c/43430 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-10-02Make CFGAS_DefaultFontManager a class with only static methods.Lei Zhang
It has no member variables. Change-Id: I25b333e201d76e90d25e3f526cf23bccd2b4687a Reviewed-on: https://pdfium-review.googlesource.com/c/43315 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-02Reduce includes in cfgas_defaultfontmanager.hLei Zhang
Do IWYU elsewhere, and unindent CFGAS_DefaultFontManager::GetFont(). Change-Id: Idb06c4ae75ce2d72b231cc4c84f61e5ca8a80cc5 Reviewed-on: https://pdfium-review.googlesource.com/c/43314 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-02Remove unneeded cfgas_fontmgr.h includes.Lei Zhang
Fix IWYU issues in affected files. Change-Id: I92c145348549d2d0f0e066e134e649b3b958e068 Reviewed-on: https://pdfium-review.googlesource.com/c/43313 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-01Initialize more CXFA_Node members in the header.Lei Zhang
And remove some unnecessary casts. Change-Id: Ifbc78e7b399ce668c92122c8c45d5995b599c971 Reviewed-on: https://pdfium-review.googlesource.com/43193 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-10-01Use size_t and FX_ArraySize() for some arrays.Lei Zhang
Change-Id: Ib8caef1f46478e9bf1c0e717997accb71000124a Reviewed-on: https://pdfium-review.googlesource.com/43192 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-09-20Fix misc lint errors and other cleanups.Lei Zhang
Change-Id: I00ce0109251d1231858e87ffc3889abe6937fa26 Reviewed-on: https://pdfium-review.googlesource.com/42811 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-09-20Remove more unneeded STL #includes from headers.Lei Zhang
Remove some variables named "string" to avoid false positives from the linter. Change-Id: I00a53e6970451fd0cea8ab2f8178183650ca00d2 Reviewed-on: https://pdfium-review.googlesource.com/42810 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-20Remove many unneeded STL #includes from headers.Lei Zhang
Change-Id: I7010cedee8d17d05b2c37a94d767e6f3a9c48f7d Reviewed-on: https://pdfium-review.googlesource.com/42790 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-17Fix final/protected conflicts.Tom Sepez
Classes marked |final| should not have |protected| members. In turn, "private field m_dwEncryptObjNum is not used" warning is produced. Change-Id: I51a96aca5a5f499381a6764d892962f7f2dc0327 Reviewed-on: https://pdfium-review.googlesource.com/42611 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-09-11Make flate decode functions' buffer out parameter unique_ptrs.Lei Zhang
Change-Id: Idb14846e87a8287dd911b0a2f7a32146e86c2af7 Reviewed-on: https://pdfium-review.googlesource.com/41853 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-04Remove unneeded fpdf_parser_decode.h #includes.Lei Zhang
Change-Id: I2c52828c25b4941669503328517c12a0a1dd770e Reviewed-on: https://pdfium-review.googlesource.com/41850 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-08-29Use pdfium::span<> in fpdf_parser_decode.h helper functions.Tom Sepez
Change-Id: Ib0a2bd21fe4304163cf9c080e07475e7c033c299 Reviewed-on: https://pdfium-review.googlesource.com/41570 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-08-29Move XFA_RESOLVENODE_TagName to xfa_resolvenode_rs.h.Lei Zhang
Change-Id: I600013bcbf44661fd132ce786bcd08980a7ecd4e Reviewed-on: https://pdfium-review.googlesource.com/41572 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-08-27The final game: mark everything final.Tom Sepez
Then revert the ones that break compilation. Fix one IWYU noticed during presubmit. Change-Id: I881a8a72818e55dbc4816247e35ff5e3015194e7 Reviewed-on: https://pdfium-review.googlesource.com/41470 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-24Rename CFX_DIBSource to CFX_DIBBase.Tom Sepez
It is not a source from which you can get CFX_DIBs, but rather a base class from which all DIBs inherit. Do the same thing for the CPDF_DIBSource wrapper class. Mechanical change apart from adding a one-line comment in cfx_dibbase.h Change-Id: Id2bde87813ca301d9fafc55ce08d703dfc6a7184 Reviewed-on: https://pdfium-review.googlesource.com/41352 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-23Fix shadowed variablesRyan Harrison
This CL fixes instances of variable shadowing that are discovered by turning on -Wshadow. BUG=pdfium:1137 Change-Id: I418d50de89ecbeb12e85b23a358bc61e8f16e888 Reviewed-on: https://pdfium-review.googlesource.com/41150 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-08-23Remove m_bTruncated flag from CBC_PDF417Writer.Henrique Nakashima
The flag is unused. Change-Id: I15eb3e20e6a632ae2aa2afc19cb09d2402e607e0 Reviewed-on: https://pdfium-review.googlesource.com/41031 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-08-22Use UnownedPtr<> in CXFA_RenderContext.chromium/3531Tom Sepez
Change-Id: I0658f63a0d8fb8a5233e135dacedc4153532f01d Reviewed-on: https://pdfium-review.googlesource.com/41112 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-22Mark CFX_XMLNode pointers as const in various places.Lei Zhang
Change-Id: I86c6f7526e2ef4c3e8de30ebaff223095ee70fc4 Reviewed-on: https://pdfium-review.googlesource.com/40811 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-08-22Add GetLowerCaseElementAttributeOrDefault() helper function.Lei Zhang
CXFA_TextParser::GetEmbeddedObj() does the same thing twice in a row. Change-Id: Ia46a0a697ff667b2884cea82258399889dbb5dc6 Reviewed-on: https://pdfium-review.googlesource.com/40775 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-08-22Simplify GetEmbeddedObj() methods.Lei Zhang
Change-Id: I976a8841f1519310cbf934103336dc050a7c293d Reviewed-on: https://pdfium-review.googlesource.com/40773 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-08-21Use UnownedPtr<> in xfa_resolvenode_rs.hTom Sepez
Change-Id: I4420fbf7402a8b08e33ca525e98690643d59efdf Reviewed-on: https://pdfium-review.googlesource.com/40930 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-21Change GetEmbbedObj() to return an Optional<WideString>.Lei Zhang
Change "EmbbedObj" to "EmbeddedObj". Change-Id: Ia6a8ec45b4563b3ec64b91a10e087dbf32a8d8db Reviewed-on: https://pdfium-review.googlesource.com/40751 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>