Age | Commit message (Collapse) | Author |
|
The current implementation of this function is problematic. It will
attempt to memcpy to NULL. It will accept obviously wrong inputs like
a negative start index. It will also accept -1 for the count, which in
theory is the amount of space the buffer has allocated to it, so
doesn't make sense, but instead an internal call will calculate the
number of characters to get if the count is -1. This will them lead to
the function attempting to call Left(-1) on a string, which is
invalid.
Ths documentation for this function mentions none of this behaviour,
so I am removing it, since it is inconsistent/bad. The implementation
should now more strictly meet defined API.
BUG=pdfium:828
Change-Id: I18afdb33e12d77c10d856b4bacd615481979c484
Reviewed-on: https://pdfium-review.googlesource.com/12733
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Since the returned data is a key, it should be a byte string and not a
wide string.
Change-Id: I9243d88586ea5b13c4b6556479d17316bf07e32e
Reviewed-on: https://pdfium-review.googlesource.com/12710
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL moves code defined in fx_system.h to be implemented in
fx_system.cpp.
Change-Id: I0c19066d4497bd208f4560fdcaf57cf04bf9f146
Reviewed-on: https://pdfium-review.googlesource.com/12674
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the GetBits32 implemenation into fx_extension.cpp. It
also moves some of the fx_basic unittests to the correct unittest files.
Change-Id: I2cf8657c228375508db0f02baa628d62a3b2ab25
Reviewed-on: https://pdfium-review.googlesource.com/12673
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves methods defined in fx_stream.h into the fx_stream.cpp
file.
Change-Id: I32147d18dd7f4a29c228f11d108ac01cb891b290
Reviewed-on: https://pdfium-review.googlesource.com/12672
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I6a588b4af4cfede922bc3756be749e9e30e3e8e5
Reviewed-on: https://pdfium-review.googlesource.com/12370
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
This CL creates an fx_string.cpp and moves any methods defined in
fx_string.h into the .cpp file.
Change-Id: I64c310b9be6d8f4c3be633a22884023c0b16fc1b
Reviewed-on: https://pdfium-review.googlesource.com/12671
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
For example, Indexed colorspace A uses ICC Based colorspace B as its
"base". B declares A as its "Alternate" fallback.
Bug: chromium:759012
Change-Id: I4b78e68b9a77456050ecae4452837495546bf93d
Reviewed-on: https://pdfium-review.googlesource.com/12471
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Remove dead code, move code to namespaces where possible, cleanup some
single use items.
Change-Id: Ia734477ceb2105a1ed272463bd8220f1205a7ce9
Reviewed-on: https://pdfium-review.googlesource.com/12732
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
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:877
Change-Id: I6aa3e53057c27700c2d3c0c1692fa86ae9b3a03c
Reviewed-on: https://pdfium-review.googlesource.com/12711
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@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>
|
|
BUG=pdfium:813
Change-Id: I4c638857bf114327dbc0344cc6d231b897f0d001
Reviewed-on: https://pdfium-review.googlesource.com/11971
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Add the component marker to the PDFium OWNERS file to help identify the
right crbug label.
Bug: chromium:761018
Change-Id: I50fb66f57efbc50de2eedaeb9786d840ca3e78a3
Reviewed-on: https://pdfium-review.googlesource.com/12712
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@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: I865a9eeb197ea2c1f5480cae32d975909495676d
Reviewed-on: https://pdfium-review.googlesource.com/12551
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Given a point, if there is an annotation at the point, give if focus if
it is not focus already. If there is no annotation at the point, then
remove the focus from the focused annotation.
BUG=chromium:754594
Change-Id: Iec3070472bbbfbad9d86e517f25da560f82efd4e
Reviewed-on: https://pdfium-review.googlesource.com/12530
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Reverts a piece of
https://pdfium-review.googlesource.com/c/pdfium/+/12210
Bug: chromium:760857
Change-Id: I290ebb7b60a6508fc3e8fba6780c837d395c1c3b
Reviewed-on: https://pdfium-review.googlesource.com/12690
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@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>
|
|
This CL rebuilds the text edit engine in a simpler fashion. Instead of
depending on multiple pages, paragraphs and buffer fields there is a
single text edit engine which contains a gap buffer.
This makes the code easier to understand and follow.
Change-Id: I10fe85603fa9ed15a647eaac2d931f113cd0c7b0
Reviewed-on: https://pdfium-review.googlesource.com/11990
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@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>
|
|
Forbid C++14 encroachment.
Add big-endian caveat.
Change-Id: I1059d3b23ada2d7db1b30ecf8a7c75b0f94e6b58
Reviewed-on: https://pdfium-review.googlesource.com/12311
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: If2a8e608498c505440405e7eff675969ac4b195a
Reviewed-on: https://pdfium-review.googlesource.com/12330
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Instead of using CFX_FloatRect::ToFxRect(), which always rounds down,
use GetOuterRect() which correctly rounds up / down depending on the
side of the rectangle.
Change-Id: I7abd3a65e8c0467ed4303292f26a72737a5d553b
Reviewed-on: https://pdfium-review.googlesource.com/12312
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:752501
Change-Id: Ie9943cd80a4afa73ad9393c8bcd2aa2656a9d932
Reviewed-on: https://pdfium-review.googlesource.com/12290
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Add helper function for commonly used coordinates and give coordinates
used in tests semantic meaning.
Also add more sanity checks to make sure the commonly used coordinates
pass the FPDFPage_HasFormFieldAtPoint() hit test.
Change-Id: If116ed5323b49bdbcbd4d857b5184f9fcd4eb908
Reviewed-on: https://pdfium-review.googlesource.com/12070
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
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>
|
|
FPDFFormFillInteractiveEmbeddertest subclasses know the type to expect.
Change-Id: I92c5fc75864330f5b1cbd392b9565b4323ce26b5
Reviewed-on: https://pdfium-review.googlesource.com/12052
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This removes a lot of repeated code that can go in SetUp()/TearDown().
This also makes the assumption that there is only 1 page used for
testing, so methods in the tests can refer to the page as a member
variable, rather than having a method parameter.
Change-Id: Ia77633ebe22f1184d2ee2fc78e88e7d33f48a86e
Reviewed-on: https://pdfium-review.googlesource.com/12051
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@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>
|
|
Change-Id: I042c5e843dcf535b2d6676d41c0037e87c59c219
Reviewed-on: https://pdfium-review.googlesource.com/12050
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@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>
|
|
Change-Id: I38ee7e59f4bf9587f43546460c87bb8539121472
Reviewed-on: https://pdfium-review.googlesource.com/12211
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|