Age | Commit message (Collapse) | Author |
|
Change-Id: I6df7e7d1283541ea2e6b9bcf3de172f6a886054a
Reviewed-on: https://pdfium-review.googlesource.com/12731
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the BIDI code from fx_arabic to fx_bidi and conditionally
compiles based on XFA.
Change-Id: Iaba60486f03e48f0816d60e365a58a8622bc8254
Reviewed-on: https://pdfium-review.googlesource.com/12713
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:875
Change-Id: I3cc29990f0a3398ae903bc14417ec695cca30c6c
Reviewed-on: https://pdfium-review.googlesource.com/12391
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Wei Li <weili@chromium.org>
|
|
This CL removes the fx_basic.h header and fixes up includes as needed.
Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040
Reviewed-on: https://pdfium-review.googlesource.com/12670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
When parsing if there is a loop in the data being parsed, the
recursions will just keep cycling until it exhausts memory and
crashes. This CL introduces a parsed set, which a reference to is
passed down the descent. If the data being parsed at a specific stage
of the descent is already in the parsed set, then the parse returns at
that point.
BUG=chromium:759224
Change-Id: I1dca73d81020099dec03fd49aaa44cdcdf38e17e
Reviewed-on: https://pdfium-review.googlesource.com/12470
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: Ic54e0491d9b33a06b5f85963f8127bfa4263f4d6
Reviewed-on: https://pdfium-review.googlesource.com/12450
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Add a new ParseContent() method as a convenience to call
ParseContentWithParams() with the default parameters.
Change-Id: I274682845a72e125c3fc6299289edb760104ac4d
Reviewed-on: https://pdfium-review.googlesource.com/12250
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
rename
m_linearized_first_page_cross_ref_start_obj_num
-->
m_dwLinearizedFirstPageXRefStartObjNum
Change-Id: I12194169f10df445d7c81305491775c15c400fad
Reviewed-on: https://pdfium-review.googlesource.com/12630
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL moves IFX_Pause out to its own class from fx_basic and updates
includes as needed.
Change-Id: Iebdd183d8c85aa17570f190f1a7d1602c0af3c8b
Reviewed-on: https://pdfium-review.googlesource.com/12491
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Instead of only having CPDF_Dictionary* GetRoot() const, provide
const CPDF_Dictionary* GetRoot() const and CPDF_Dictionary* GetRoot().
Do the same for GetInfo().
Change-Id: I6eae1208d38327fcdc7d0cd75069a01c95f4a92a
Reviewed-on: https://pdfium-review.googlesource.com/11671
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL moves CFX_FixedBufGrow to its own files and updates includes as
needed.
Change-Id: Ia0cb70569b30acdb3ba9f23d8937ab8f9c17d6e6
Reviewed-on: https://pdfium-review.googlesource.com/12490
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves CFX_WideTextBuf to its own files and updates includes as
needed.
Change-Id: Ibe66ecf3e66f8f01dd8e9eaf6b467588be86ad4f
Reviewed-on: https://pdfium-review.googlesource.com/12413
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL splits the CFX_BinaryBuf out of fx_basic into its own files. The
various includes have been updated.
Change-Id: I0fa616eeb4df6dd229c02dc3a0597b3dced59425
Reviewed-on: https://pdfium-review.googlesource.com/12412
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves CFX_UTF8Decoder out of fx_basic and includes where needed.
Change-Id: I1a093a8a77bbefcc90fbb2f81b1da65bfc0512bf
Reviewed-on: https://pdfium-review.googlesource.com/12411
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The CFX_UTF8Encoder is only used in FX_UTF8Encode(). This CL moves the
class to the anonymous namespace with that method. The unused AppendStr
method has been removed.
Change-Id: Ie514686c4b4489bb0b0df83b7eeec14bb1876fcd
Reviewed-on: https://pdfium-review.googlesource.com/12410
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug: chromium:755532
Change-Id: Ib04426fab52d0ca1d2544a21fd2ce4faaa57123f
Reviewed-on: https://pdfium-review.googlesource.com/12430
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL moves CFX_AutoRestorer into its own file, separate from
fx_basic.h.
Change-Id: I415cb9207416bd4744b8ac8e2d7466852db53f0a
Reviewed-on: https://pdfium-review.googlesource.com/12390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL moves the CFX_BitStream code out of fx_basic and into
cfx_bitstream.
Bug: pdfium:867
Change-Id: I5b7e6190a7db1fe1d24feb6bd676035a5c73ee92
Reviewed-on: https://pdfium-review.googlesource.com/12350
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Through out the code base there are numerous places where variables
are declared using a signed integer type when interacting with the
string classes, since they assume that FX_STRSIZE is 'int'. As part of
changing the underling type of FX_STRSIZE to be unsigned, these
locations are being changed to use FX_STRSIZE. This is necessary as
part of converting the type, but has been broken off into a separate CL,
since it should be low risk.
Some related cleanups that are low risk are included as part of
this CL.
BUG=pdfium:828
Change-Id: Ifaae54ad195ccde0fe8672f71271d29a6ebd65fd
Reviewed-on: https://pdfium-review.googlesource.com/12210
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Clean up being done in preperation for removal of negative length
strings. This means that FX_STRSIZE will become unsigned so the return
methods cannot return -1. Other cleanup suggested by reviewers is
included.
BUG=pdfium:828
Change-Id: I2cfb78c8ab7738516e0c9f8a99caec6f6cb12cde
Reviewed-on: https://pdfium-review.googlesource.com/12170
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This is non recursive replacement for CPDF_DataAvail::AreObjectsAvailable.
Also added tests.
Change-Id: I546289fc0963d2343253755850f55af8c0bd8e4c
Reviewed-on: https://pdfium-review.googlesource.com/11430
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Make all pages dictionary are not inlined.
Original fix:
https://codereview.chromium.org/2491583002
Change-Id: Ie3aa662182a70ef6ef1d6121c0576c171e0060dd
Reviewed-on: https://pdfium-review.googlesource.com/11810
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
For methods that are only exposed for testing. Once they are static,
there is no need for dummy CPDF_StreamContentParser constructor calls in
the unit tests. Adjust the CPDF_StreamContentParser constructor now that
one of the parameters can no longer be a nullptr.
Change-Id: If29b02ea216002a7bb325b1913281f58b70382aa
Reviewed-on: https://pdfium-review.googlesource.com/12230
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Use read validator to check trailer availability
Change-Id: Id8c62a6c746f136c05cfa8d646268322e2543b52
Reviewed-on: https://pdfium-review.googlesource.com/11770
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Use read validator to check whole file availability.
Change-Id: Ic118ccee38557d124ecde3893ee3c18c98c674d5
Reviewed-on: https://pdfium-review.googlesource.com/11712
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Use read validator to check cross ref table availability
Change-Id: I050c366a255598ca6d8bcd353afa94c4a09c33a9
Reviewed-on: https://pdfium-review.googlesource.com/11730
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Avoid pushing nullptrs into the orphans list.
Change-Id: I2d52c83e6f20e89be101365d3cca0960b4941a4f
Reviewed-on: https://pdfium-review.googlesource.com/12190
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
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>
|
|
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: 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>
|
|
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>
|
|
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>
|
|
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>
|
|
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, 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>
|
|
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>
|
|
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 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>
|
|
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>
|