Age | Commit message (Collapse) | Author |
|
CFX_Point and CFX_PointF are derived from CFX_PTemplate.
Add a helper function to replace the rarely used method where its used.
Change-Id: I28448d44bbae9aa6773d1ad5fd7daf342b67c84c
Reviewed-on: https://pdfium-review.googlesource.com/12071
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Currently these use -1 as a special value to indicate not set. This
creates the same issues that FX_STRNPOS created for converting
FX_STRSIZE to size_t, so this code has been rewritten.
BUG=pdfium:828
Change-Id: Iaaa96af0dcb2eb8b600f3ea39060a398ac9a3800
Reviewed-on: https://pdfium-review.googlesource.com/12130
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Remove some useless overrides.
Change-Id: Icf4d8bfcca6358ef3f59f768c2d60759d4b05243
Reviewed-on: https://pdfium-review.googlesource.com/10854
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Refactor identical code used in decode_Template0_unopt() into their own
methods.
Change-Id: I37348a280ecc66d91fdcd3c9aabe49d2a8065417
Reviewed-on: https://pdfium-review.googlesource.com/11950
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
ReplaceIndirectObjectIfHigherGeneration() deletes replaced objects, but
those objects may be in use. So move them to the orphans list instead to
avoid potential dangling pointers.
BUG=chromium:757705
Change-Id: Ide83a1b85b754166d298fd50e655ca331ba4f942
Reviewed-on: https://pdfium-review.googlesource.com/11670
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: If038850c745ac26e50c313bdbe630483434caedc
Reviewed-on: https://pdfium-review.googlesource.com/11390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:749610
Change-Id: Ia83558568293398c72b7215e9b3fe4e4df6f969a
Reviewed-on: https://pdfium-review.googlesource.com/11931
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:738711
Change-Id: I4a308694c3e6fcd17431515b7897969d54486071
Reviewed-on: https://pdfium-review.googlesource.com/11870
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:749610.
Change-Id: I4de7855aec552e6c143e7a8be6b90e44945a0fcb
Reviewed-on: https://pdfium-review.googlesource.com/11930
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Merge CPDF_SyntaxParser::GetObject and CPDF_SyntaxParser::GetObjectForStrict.
Change-Id: Ic9ff51e24ee981c268239847e3cca1c6f6a6f269
Reviewed-on: https://pdfium-review.googlesource.com/10511
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL creates a global font loader for use in XFA tests. This is
needed because the CFGAS_FontMangaer takes a linearly increasing amount
of time to load fonts each time it's loaded. This can get excessively
slow for test suites which run a lot of tests.
Change-Id: Ie389844b56598ce414f4f761654fa4ed465955fd
Reviewed-on: https://pdfium-review.googlesource.com/12090
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This code will just add 0 to x and subtract 0 from y. Doing nothing.
Remove.
Change-Id: I6e0aa91d088acd49cb83d4bded29908b544b692b
Reviewed-on: https://pdfium-review.googlesource.com/12110
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The various string classes, CFX_ByteString, CFX_ByteStringC,
CFX_WideString, and CFX_WideStringC, have many conditionals that are
effectively determining if a value is a valid index or length. This CL
refactors the logic into one place per class, so it only needs to be
changed once if its behaviour needs to change. It also make the some
of the methods stricter on the inputs they will accept.
BUG=pdfium:828
Change-Id: Iadcdaa34a6d862a2804485770027179c89dc6956
Reviewed-on: https://pdfium-review.googlesource.com/12030
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
In this CL, the flag CMS_DONT_USE_FAST_FLOOR is set to true because quickfloor
could cause heap-buffer-overflow due to flooring errors. In the testcase for
the bug, Input[2] is a number very close but smaller than 1 such that
quickfloor returned 1 (whereas Input[2] >= 1.0 was false).
Bug: chromium:752725
Change-Id: Ibb1763aa120a600e86602f1a46c4cd6d0d6bebd5
Reviewed-on: https://pdfium-review.googlesource.com/11310
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: Ia9738e14d90a813b6ec7abd72843248fd3a3bff0
Reviewed-on: https://pdfium-review.googlesource.com/11910
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
cherry-pick of https://github.com/glennrp/libpng/commit/92a7c79db2c962d04006b35e2603ba9d5ce75541
BUG=chromium:729673
Change-Id: I907b4920ed6d276a075a30269be1744aff678069
Reviewed-on: https://pdfium-review.googlesource.com/11690
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The crash was caused by a dangling pointer in CPWL_ListCtrl to
the font map owned by CFF_TextObject. The order of events was:
1. ~CFFL_ListBox runs and calls parent destructor ~CFFL_TextObject.
2. ~CFFL_TextObject runs and deletes its member m_pFontMap. m_FontMap
was referenced by CPWL_ListCtrl which is now dangling.
3. ~CFFL_TextObject calls parent destructor ~CFFL_FormFiller.
4. ~CFFL_FormFiller calls DestroyWindows().
5. CFFL_FormFiller::DestroyWindows() deletes widgets, among them
CPWL_ListBox.
6. ~CPWL_ListBox deletes its member CPWL_ListCtrl.
7. ~CPWL_ListCtrl sees a dangling pointer to the map and crashes.
Making the DestroyWindows() call earlier in the destructor of
CFFL_TextObject, we execute steps 5-7 before freeing m_pFontMap.
An extra DestroyWindows() is still made in ~CFFL_FormFiller, but
it is then non-op if the derived CFFL_TextObject already called it.
Bug: chromium:757506
Change-Id: Ib8dce04f1dd0bcf8e10701f6cf7ea500bfb5ba84
Reviewed-on: https://pdfium-review.googlesource.com/11651
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The current limit of 2000 is still causing occassional ASAN issues,
reducing to 1250.
BUG=chromium:757711
Change-Id: Idb07f97b01230afabcceaa23b29495432193ec64
Reviewed-on: https://pdfium-review.googlesource.com/11750
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL updates the text edit engine to load and unload the page
directly instead of calling through the edit widget.
Change-Id: I636c8e8b0e635968222430098d3d268c75224b42
Reviewed-on: https://pdfium-review.googlesource.com/11590
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up the GetPre* methods in CFDE_TextEdtEngine. In
particular:
* GetPreDeleteText was inlined as it was very simple
* GetPreReplaceText was removed as unused
* GetPreInsertText was renamed to InsertIntoTextCopy to make clear
that this was doing the insert into a copy of the text.
Change-Id: Icde0126b6ddb0ec9d4956238ebff53c9fe51c051
Reviewed-on: https://pdfium-review.googlesource.com/11531
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Previously text break was a unique_ptr inside the CFDE_TxtEdtEngine.
This CL converts it to be a member instead of a unique_ptr. We never
replace the pointer after it's created.
Change-Id: I89ab73e81c63c24abfacd38a1141db6473d77640
Reviewed-on: https://pdfium-review.googlesource.com/11530
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The Find and ReverseFind methods for WideString, WideStringC,
ByteString, and ByteStringC have been converted from returning a raw
FX_STRSIZE, to returning Optional<FX_STRSIZE>, so that success/failure
can be indicated without using FX_STRNPOS.
This allows for removing FX_STRNPOS and by association makes the
conversion of FX_STRSIZE to size_t easier, since it forces checking
the return value of Find to be explictly done as well as taking the
error value out of the range of FX_STRSIZE.
New Contains methods have been added for cases where the success or
failure is all the call site to Find cared about, and the actual
position was ignored.
BUG=pdfium:828
Change-Id: Id827e508c8660affa68cc08a13d96121369364b7
Reviewed-on: https://pdfium-review.googlesource.com/11350
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL converts the return value to be an enum class and updates the
usages to use the names instead of values.
Change-Id: I8b6927551679ac4103775a04187daad2e0d6c569
Reviewed-on: https://pdfium-review.googlesource.com/11512
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Ie1fa04cdcdd426cf76413e7e5fe714ba7922458c
Reviewed-on: https://pdfium-review.googlesource.com/11713
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Use read validator to check "startxref" availability.
Change-Id: I258a707e4269fe768898d74db0955302b34ccf34
Reviewed-on: https://pdfium-review.googlesource.com/11711
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Use read validator to check header availability.
Change-Id: Ib482347cb2f112e27a6bcc4e8da865d0ecf1a630
Reviewed-on: https://pdfium-review.googlesource.com/11710
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Do not store non main trailers in memory.
Improve readability.
Change-Id: I2eab5d31a5be056871e7e5953e4b38662b91f5ae
Reviewed-on: https://pdfium-review.googlesource.com/10750
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The ::AddImage call can return a nullptr if there is no stream provided.
This CL adds the missing null check on the returned object when lookikng
at the image.
Bug: chromium:756418, chromium:753700
Change-Id: I48032c0f421c8889827540ae91f404ef0f503bfe
Reviewed-on: https://pdfium-review.googlesource.com/11532
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This was pulled in via DEPS to make the Skia build work, but it no
longer appears to be needed.
Change-Id: Ib83aa56cd08f1a0abcc0388ce881ec35c41788be
Reviewed-on: https://pdfium-review.googlesource.com/11333
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
The previous behaviour of [] on an empty string was to return 0
regardless of the index. We wanted to make this more strict, hence the
current behaviour. This has led to a number of crashes due to code
depending on the old behaviour. Reverting to the old behaviour until
we have time to correct the call sites using empty strings.
Bug=chromium:752480, pdfium:828
Change-Id: I511eea4148de85bf7f4694351e7a030b1a37f0de
Reviewed-on: https://pdfium-review.googlesource.com/11630
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Currently, if FPDF_LoadDocument() is called on a nonexistent file, the
returned FPDF_DOCUMENT will be null, but FPDF_GetLastError() will return
an error of FPDF_ERR_SUCCESS, i.e. no error.
This CL corrects this behavior by updating the error to be FPDF_ERR_FILE
when the file doesn't exist.
Bug=pdfium:452
Change-Id: I3c3ec3a64e049636ddfb2ba5cb5f2745a0e19b6b
Reviewed-on: https://pdfium-review.googlesource.com/11650
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
It is intended to use this class instead of the std::pair<bool, Foo*>
pattern that has been used for guarded pointer returns in PDFium.
Change-Id: Id3e305d6cdb329c84e1d827c855423d3efae42c0
Reviewed-on: https://pdfium-review.googlesource.com/11610
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: Ic0849cce80e1797637fd875bdedd7cc560b98f22
Reviewed-on: https://pdfium-review.googlesource.com/11210
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Added FPDFAnnot_GetLinkedAnnot() to retrieve annotations linked to other
annotations through a specified key.
Bug=pdfium:863,pdfium:737
Change-Id: If81f41178fb4c40f6561bd392215c709722c4000
Reviewed-on: https://pdfium-review.googlesource.com/11491
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
Currently, all three of CFX_Matrix::TransformRect() take in rect values
and modify them in place.
This CL converts them to take in constant values and return the
transformed values instead, and fixes all the call sites.
Bug=pdfium:874
Change-Id: I9c274df3b14e9d88c100ba0530068e06e8fec32b
Reviewed-on: https://pdfium-review.googlesource.com/11550
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
This CL is a tentative fix for the bug below. The last method in the
stack trace is FontEnumProc, which calls AddInstalledFont. This problem
was introduced by
https://pdfium-review.googlesource.com/c/pdfium/+/10651
Bug: chromium:757388
Change-Id: If089a43367f1106a79276f6b09b6d0546b863e35
Reviewed-on: https://pdfium-review.googlesource.com/11611
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
- Add --no-color option.
- Fix exit code ambiguity (2 means bad usage)
Change-Id: I04be9c3f21b5a71857b7847b3cc32bf595084994
Reviewed-on: https://pdfium-review.googlesource.com/11490
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
BUG=chromium:718503
Change-Id: I6ff332c2ab5320d1b5f39a9aa1564e7e3e243cbe
Reviewed-on: https://pdfium-review.googlesource.com/11570
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I7c68d0f5a668019d23bbeebc66373f9b245f91a2
Reviewed-on: https://pdfium-review.googlesource.com/9551
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
This CL converts the enum to an enum class and updates the usage as
needed.
Change-Id: I7ba883e7d1debee00d3d9baafe941620109df8b8
Reviewed-on: https://pdfium-review.googlesource.com/11511
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up nits in CFDE_TxtEdtBuf and simplifies some of the
methods.
Change-Id: I2092da8e27281a577752fc331fec0612a349dfd6
Reviewed-on: https://pdfium-review.googlesource.com/11335
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Currently, annotation popups are placed at a fixed location relative to
the annotation. If an annotation is too much on the right or the bottom
of the page, then its popup will be clipped at the edge of the page.
This CL translates the popups appropriately to avoid getting clipped at
page edges. Also, if an annotation is at the bottom-right corner of the
page, then the popup is placed above and to the left of the annotation,
instead of below and to the right of it.
See a set of comparison screenshots here:
https://drive.google.com/drive/folders/0B7Fvv7JszRyGZXZXR05yVEFWSlE?usp=sharing
Bug=chromium:645367,pdfium:750
Change-Id: Ie048281e965523c292dcc704b51188d794f8877b
Reviewed-on: https://pdfium-review.googlesource.com/11470
Commit-Queue: Jane Liu <janeliulwq@google.com>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Idd656dcf372c0b8ed515a4e0635b5098c0781d76
Reviewed-on: https://pdfium-review.googlesource.com/10991
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Converted CFDE_TxtEdtBuf::Insert(), CFDE_TxtEdtEngine::Insert(), and
CFDE_TxtEdtEngine::Inner_Insert() to take in CFX_WideString instead of
a wchar_t* and length.
Bug=pdfium:757
Change-Id: I6097e9b0d4e584b920b2117b4c5489eedef37767
Reviewed-on: https://pdfium-review.googlesource.com/11411
Commit-Queue: Jane Liu <janeliulwq@google.com>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Converted CFX_FloatRect::Init() and CFX_FloatRect::UpdateRect() to take
in a CFX_PointF object instead of two coordinates.
Bug=pdfium:770
Change-Id: Ibcb620f192d6c086158c39f23c411777286005d0
Reviewed-on: https://pdfium-review.googlesource.com/11450
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up formatting and simplifies logic in CFDE_TextOut.
Change-Id: Ib675a35da79df77854f51e86bf24e5dc90b33b06
Reviewed-on: https://pdfium-review.googlesource.com/11334
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Converted CFX_RenderDevice::DrawCosmeticLine() and IFX_RenderDeviceDriver::
DrawCosmeticLine() to take in CFX_PointF objects instead of two coordinates
per point.
Bug=pdfium:769
Change-Id: I6116e4106a61487184a71e79c1dca3a85e8c7c27
Reviewed-on: https://pdfium-review.googlesource.com/11410
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:872
Change-Id: Ib7f0e3708cea2d16d7536ae26777ddc48d7e2c1d
Reviewed-on: https://pdfium-review.googlesource.com/11370
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This basically copies https://chromium-review.googlesource.com/608869
Change-Id: I95acc3018e99a7822b9aaee7f83bc6080c0b3ec0
Reviewed-on: https://pdfium-review.googlesource.com/11336
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Idc9dfcafe6727c1689443ce8f9568567e55d51c8
Reviewed-on: https://pdfium-review.googlesource.com/11114
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|