summaryrefslogtreecommitdiff
path: root/xfa
AgeCommit message (Collapse)Author
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-18Cache CFGAS_FontMgr::GetFontByUnicode() failures on Windows.Lei Zhang
Non-Windows does this already, which is why it can handle fuzzers that throws the same invalid unicode character at it efficiently. Whereas Windows tries to do the same failing font load repeatedly. BUG=chromium:895469 Change-Id: I6780d1ec0881222348e05a5a63e7b2238f39a3a6 Reviewed-on: https://pdfium-review.googlesource.com/c/44251 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-18Shuffle platform-specifc code in CFGAS_FontMgr::GetFontByUnicode().Lei Zhang
Move most of it into GetFontByUnicodeImpl(). Change-Id: Ibbfe458589d0d1aea8f52179110690ed83e40fac Reviewed-on: https://pdfium-review.googlesource.com/c/44250 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-17Add CPDF_{Array,Dictionary}Locker to catch illegal iteration patterns.Tom Sepez
Move begin/end methods onto locker object which tracks whether iterators are in existence. Change-Id: Ia869f313fce48d10a0d0180d0cc083eed6ea1584 Reviewed-on: https://pdfium-review.googlesource.com/c/44070 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@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 fpdfsdk/ pass gn check.Lei Zhang
Use allow_circular_includes_from as a crutch for now. Change-Id: I58e90da4b71a22dd54fd59e8d644b6eef740d4cd Reviewed-on: https://pdfium-review.googlesource.com/c/43988 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-12Mark the bigint target as XFA only.chromium/3579Lei Zhang
Depend on it directly from the only user, fxbarcode. Change-Id: I303dc7b0e713d683257fb3d893e74fdd40ac2046 Reviewed-on: https://pdfium-review.googlesource.com/c/43939 Reviewed-by: Henrique Nakashima <hnakashima@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-03Use numbers to test barcode encodings that do not accept letters.Henrique Nakashima
Bug: pdfium:1172 Change-Id: I8399a0add43dcb1f3269101d6ea212cfc33d3ca7 Reviewed-on: https://pdfium-review.googlesource.com/c/43454 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-10-03Fix nits in CFX_FontSourceEnum_File.Lei Zhang
Change-Id: I116745419311b4cd37ce69c85f6ce6972d5325f4 Reviewed-on: https://pdfium-review.googlesource.com/43351 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-03Split CFX_FontSourceEnum_File into its own file.Lei Zhang
Change-Id: I85d2094f77866d18c0dce060755583ea289bb9ea Reviewed-on: https://pdfium-review.googlesource.com/43350 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-03Simplify CFX_FontSourceEnum_File's file iterator.Lei Zhang
Break the methods down to their basic functionality, and built up from there. Change-Id: I691abaf08375425b59f2382cf95577c3917aca9d Reviewed-on: https://pdfium-review.googlesource.com/42972 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-02Clean up some XFA forward declarations.Lei Zhang
Change-Id: I2d30ceb5e475290c0842fe4add7ffb965dc77572 Reviewed-on: https://pdfium-review.googlesource.com/c/43316 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-02Avoid overloading CFGAS_FontMgr::LoadFont().Lei Zhang
Rename the internal one LoadFontInternal. Remove unused out parameter. Change-Id: Ia108bc4fc29ef0ad7732eacad9bb924a8e424c2e Reviewed-on: https://pdfium-review.googlesource.com/c/43317 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@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-24Give CFX_GraphStateData a work-over.chromium/3561Tom Sepez
Use std::vector<float> for dash array. Use compiler-generated default operations. Squeeze some enums. Fix obvious logic botch in DashChanged(). Change-Id: If1d809cc46a3cf2db98a09a3f5a49d22138c0640 Reviewed-on: https://pdfium-review.googlesource.com/42613 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-09-22Remove useless charset data in CFGAS_FontMgr.Lei Zhang
Fix some nits too. Change-Id: I7d088f28b3b6898fcfbafb9c0e6eac6442ff1515 Reviewed-on: https://pdfium-review.googlesource.com/42910 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-22Move some CFGAS_FontMgr methods into an anonymous namespace.Lei Zhang
They do not have to be part of the class. Fix nits and lint errors too. Change-Id: Ie8f745f378beeebf05841ff17a98141924999613 Reviewed-on: https://pdfium-review.googlesource.com/42890 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@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-17Make CBC_CodeBase::SetTextLocation() virtual.Lei Zhang
Do the same for a few other CBC_CodeBase methods, instead of trying to implement virtual methods manually using memory pointers. Change-Id: Iec0e3a4f8eabc54962c7ac0a00a1b80b192ff474 Reviewed-on: https://pdfium-review.googlesource.com/42600 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-15Remove FXFM_ENCODING_NONE.Lei Zhang
FX_CreateFontEncodingEx() always passes FXFM_ENCODING_NONE. Just get rid of it instead. Change-Id: I417f84d8ae2f10ba874265a92576d3ef8481a9d6 Reviewed-on: https://pdfium-review.googlesource.com/42460 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-14Use pdfium::Optional in CFGAS_GEFont.Lei Zhang
Change-Id: I1fe90d94ed782f59745dc47e38cda561c5b5ac47 Reviewed-on: https://pdfium-review.googlesource.com/42512 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-14Use fxcrt::MaybeOwned in CFGAS_GEFont.Lei Zhang
Change-Id: Ie1f4763e37832475a60c55b26263405e0bbf09b3 Reviewed-on: https://pdfium-review.googlesource.com/42510 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-14Use UnownedPtr in CFX_UnicodeEncoding.Lei Zhang
Change-Id: I410909be359a5b5bb0c90d42064144771183525e Reviewed-on: https://pdfium-review.googlesource.com/42461 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-14Clean up CFGAS_GEFont members.Lei Zhang
Remove unused members and initialize the rest in the header. Change-Id: Ic2122fc1d49024632b9ebd4cb490c14dd0724de6 Reviewed-on: https://pdfium-review.googlesource.com/42491 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>