Age | Commit message (Collapse) | Author |
|
Change-Id: I7fe8dcd8854e2f08b7b0ee53bde6c864108142ff
Reviewed-on: https://pdfium-review.googlesource.com/9571
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The xfa/fde/css code has no other links into xfa/. This CL moves the css
code to core/fxcrt/css and sets to only build when pdf_enable_xfa is
enabled.
Change-Id: Iefd208e1f83a28b80b567c574e841e87bce310be
Reviewed-on: https://pdfium-review.googlesource.com/9251
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Single no-op callback.
pdfium::clamp() where appropriate.
Use post-increment where appropriate.
Add helper functions for image type.
Change-Id: I1584a1c90b46bd87f6ee983b78b6a2119212d0fb
Reviewed-on: https://pdfium-review.googlesource.com/10270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Mechanical change to bring into conformance with style guide.
Change-Id: I80d06708ed5c40af7e797ea5dc6279a0b4f3cf6a
Reviewed-on: https://pdfium-review.googlesource.com/10250
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Apply patch suggestions from reporter. Move all FX_Alloc'd memory
into unique_ptrs so that no bare FX_Alloc/Free_Free calls remain.
Fix a realloc / opj_realloc mismatch. Remove unused functions
color_apply_icc_profile() and color_apply_conversion(). Tidy along
the way, add some missing statics, and fix a confusing (but not quite
member shadowing) local name.
Bug: 752829
Change-Id: Ibf2d108a857e3de39e752c2c553a31e002a07caf
Reviewed-on: https://pdfium-review.googlesource.com/10230
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
New version of the CL that include fpdf_parser_utility.cpp where
there is an overload for CFX_ByteTextBuf << CPDF_Object* used by
CFDF_Document.
Bug: pdfium:731
Change-Id: I54f4e9ee7e10e94388f6f6584f3999f43689e84c
Reviewed-on: https://pdfium-review.googlesource.com/10170
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Remove ifdef'd code for versions we know will no longer work.
Change-Id: I036c80168f846df1b98e9df4972f84655e8418fb
Reviewed-on: https://pdfium-review.googlesource.com/10051
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit aea80dcc0abc0c310316fa502f91a359bc684758.
Reason for revert: WriteBuf's behavior was altered
Original change's description:
> Remove CFX_ByteTextBuf from cpdfsdk_interform.cpp and others.
>
> Bug: pdfium:731
> Change-Id: I61d38ab3f2b0ac68b8479ade25bab50f3a73c27b
> Reviewed-on: https://pdfium-review.googlesource.com/9770
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
TBR=tsepez@chromium.org,hnakashima@chromium.org,rharrison@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: pdfium:731
Change-Id: Ic66a2641c259173fb3792f7a4206e19ee4707fc9
Reviewed-on: https://pdfium-review.googlesource.com/10150
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I95d7c16e6c30e6675a17505359b5b7ae1dd5ff12
Reviewed-on: https://pdfium-review.googlesource.com/9950
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Added FPDFImageObj_GetImageDataDecoded() for retrieving the uncompressed
data of an image, and FPDFImageObj_GetImageDataRaw() for retrieving the
raw data of an image.
* Refactored out DecodeStreamMaybeCopyAndReturnLength(), which is
used to decode both attachment data and image data.
* Within DecodeStreamMaybeCopyAndReturnLength(), used a different
decoder function which takes care of multiple filters if exist. As
a result, CPDF_StreamParser::DecodeInlineStream() which was made
static previously is now moved back into namespace.
Bug=pdfium:677
Change-Id: I22a22c99acaca98ef8c15f88911f2646a2c854d5
Reviewed-on: https://pdfium-review.googlesource.com/9811
Commit-Queue: Jane Liu <janeliulwq@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Added FPDFImageObj_GetBitmap() that returns the bitmap of an image
object, and a FPDFBitmap_GetFormat() that returns the format of a
bitmap.
* Fixed a small bitmap conversion bug in cfx_dibsource.cpp.
* Enabled EmbedderTest::CompareBitmap() to support different formats
of bitmaps.
* Added an embedder test and a test PDF file with images of many
different formats.
Bug=pdfium:677
Change-Id: I6a72f9d969cf5f3577db9400ca33197c213622ed
Reviewed-on: https://pdfium-review.googlesource.com/9690
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
There isn't any work to NaCl PDFium at the moment, and it would
take a lot more than these few changes.
Change-Id: I6c4bf5f38bbfb9cf4f5a5688128c7720c38a8ce4
Reviewed-on: https://pdfium-review.googlesource.com/10050
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The only non-test caller is gone.
Change-Id: I261bc6d97c3047b2935d7b663c1a5f7d15670714
Reviewed-on: https://pdfium-review.googlesource.com/10010
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
It is not needed to fix https://crbug.com/552046 and it causes different
bug.
BUG=chromium:750993
Change-Id: I11627045bd3e73fb439884c3362ab1c26eb95fe3
Reviewed-on: https://pdfium-review.googlesource.com/9990
Reviewed-by: Oliver Chang <ochang@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
CPDF_Parser::StartLinearizedParse() calls StartParse(), but already
knows the PDF header offset. Refactor StartParse() so it does not have
to look for the header again.
Change-Id: Id8cc39301ae72da868dafc53921622d5b28ce26e
Reviewed-on: https://pdfium-review.googlesource.com/9830
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
|
|
Bug: pdfium:731
Change-Id: Iac887a8d3485b5511ec7f3d809efeb8af6ea9ce7
Reviewed-on: https://pdfium-review.googlesource.com/9930
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I63532e06aa2c135f34a6adda24ae1cfbc5922ac9
Reviewed-on: https://pdfium-review.googlesource.com/9871
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
A helper method for FromUnicode existed that converted wchar_t* to
CFX_WideString before calling the remaining FromUnicode. This method
is not used in the code base, so it has been removed. This simplifies
converting FX_STRSIZE to be unsigned, since one of parameters to this
method was of type FX_STRSIZE.
BUG=pdfium:828
Change-Id: I3da677b84ac3b82ba48497e26d2ac80dd14302e6
Reviewed-on: https://pdfium-review.googlesource.com/9910
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: I7e3d45263a0bae61fd86fd4c3710de7fc0b9347d
Reviewed-on: https://pdfium-review.googlesource.com/9290
Reviewed-by: Wei Li <weili@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
All of the call sites for this method used the default value, so it
has been removed. This simplifies converting FX_STRSIZE to be
unsigned, since the removed parameter was of this type.
BUG=pdfium:828
Change-Id: I369285aed561731ab34ec6d30de0d21fb3431492
Reviewed-on: https://pdfium-review.googlesource.com/9891
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
The existing implementation of Delete on the string classes handles
some cases where the range being deleted is out of bounds by clipping
it to the valid range. This behaviour can lead to programming problems
in the calling code being masked by the fact the Delete method still
does something. The new version of these methods does an early return
if the parameters are invalid.
This change also effectively removes support for negative string sizes
from the Delete method, so converting FX_STRSIZE to be unsigned will
be easier.
BUG=pdfium:828
Change-Id: Idbb4a62f70a75eba06e7809e011b25da2d7404c4
Reviewed-on: https://pdfium-review.googlesource.com/9890
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
The existing behaviour was to clamp the provided index to the valid
bounds. This would lead to programming errors being hidden, since
inserting would still do something even if the index calculation was
wrong. The behaviour of these methods has been changed to instead
early return when this occurs, returning the old length value. The
caller can check if the call to Insert actually did anything by
comparing the returned value to the length before calling insert.
All of the existing calls to Insert have been tested by running all of
the tests with asserts in the Insert method to check the index is in
bounds. Additionally the call sites have been manually inspected. The
majority of them are of the form Insert(0, foo) and the rest tend to
be in a loop advancing from 0 to length.
Convenience methods InsertAtFront/InsertAtBack have been added to
handle calling Insert when the intent is for the character to be added
to the beginning or end of the string. Existing call sites to Insert
that do this have been converted.
This work was originally being performed to check if there would be
any issues in these methods with making FX_STRSIZE unsigned.
BUG=pdfium:828
Change-Id: I60cee5ad45338aa8ed46569de7bcc78a76db18f7
Reviewed-on: https://pdfium-review.googlesource.com/9870
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Instead of passing in a CPDF_PageObject* and then converting it to an
image, which is always what it is.
Change-Id: I146a476147f4b344417982b5ace002b9bd7b3d80
Reviewed-on: https://pdfium-review.googlesource.com/9810
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Callers removed in commit 4b78b18.
Change-Id: I6eec6ba18712040180b12d56b59c6a8379de4379
Reviewed-on: https://pdfium-review.googlesource.com/9750
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I61d38ab3f2b0ac68b8479ade25bab50f3a73c27b
Reviewed-on: https://pdfium-review.googlesource.com/9770
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: I5deb6049db41387ac030a6ba5296ee6187120190
Reviewed-on: https://pdfium-review.googlesource.com/9470
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Make CPDF_Parser::ObjectInfo::pos a union, since the data is used as an
object number when the object is compressed.
Change-Id: Id7c32759f7411cc80285bb7f3088b5aa6ff5bf05
Reviewed-on: https://pdfium-review.googlesource.com/9570
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Helper for validate read problems locally,
Change-Id: I2bfbbaab8a67c0fd0cee3dadcd0f9cad5953101c
Reviewed-on: https://pdfium-review.googlesource.com/9552
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Fixes potential leaks in CPDF_Creator::WriteOldIndirectObject(), the
only caller.
Change-Id: I8a20da8a555c8d28f3bcd467a193a6a81c9f91d9
Reviewed-on: https://pdfium-review.googlesource.com/9751
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Iab34de5858ae06582023be220ef7dd0d1d0a91c9
Reviewed-on: https://pdfium-review.googlesource.com/9530
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL removes the default param value for this method, which was
negative. It also adds in a method to get buffer lengths, so that the
callsites can explictly passing in the length of the buffer if they
were using the default value previously.
BUG=pdfium:828
Change-Id: I0170771ee81970b8b601631015ab3e6e39fea8ea
Reviewed-on: https://pdfium-review.googlesource.com/9790
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Currently Find() and other methods that return a FX_STRSIZE return -1
to indicate error/failure. This means that there is a lot of magic
numbers and magic checks floating around. The standard library for
similar operations uses a npos constant. This CL implements
FX_STRNPOS, and replaces usages of magic number checking. It also does
some type cleanup along the way where it was obvious that FX_STRSIZE
should be being used.
Removing the magic numbers should make eventually changing FX_STRSIZE
to be unsigned easier in the future.
BUG=pdfium:828
Change-Id: I67e481e44cf2f75a1698afa8fbee4f375a74c490
Reviewed-on: https://pdfium-review.googlesource.com/9651
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I52e668ca410a0c6b96a789ecc18c993152047ead
Reviewed-on: https://pdfium-review.googlesource.com/9550
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:839
Change-Id: I3a069bf7d8a75f32cf9bcc9e9926ad19aa006795
Reviewed-on: https://pdfium-review.googlesource.com/9650
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Instead of accessing the raw kTextLayoutCodeProperties data.
Change-Id: Ie39cf5c098e1564ae2f18d76b234af42f24db4ca
Reviewed-on: https://pdfium-review.googlesource.com/9451
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: I94b2e8f6fd522b97c917037e32fb3bcbeea0cbeb
Reviewed-on: https://pdfium-review.googlesource.com/8911
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The various string/byte classes support Mid(), Left(), and Right() for
extracting substrings. Mid() can handle all possible cases, but Left()
and Right() are useful for common cases and more explicit about what
is going on.
Calls like Mid(offset, length - offset) can be converted to
Right(length - offset). Calls like Mid(0, length) can be converted to
Left(length).
If the substring being extracted does not extend all the way to one of
the edges of the string, then Mid() still needs to be used.
BUG=pdfium:828
Change-Id: I2ec46ad3d71aac0f7b513e103c69cbe8c854cf62
Reviewed-on: https://pdfium-review.googlesource.com/9510
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I218179565cd991b71fd9c909b94f967bbf80c74d
Reviewed-on: https://pdfium-review.googlesource.com/8912
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The wrapper for IFX_SeekableReadStream.
Which allow us to check data availability on read request
and request downloading of non available data on fly.
Change-Id: I27c66cd58f43f8432f73104cc3f4c980515a9b56
Reviewed-on: https://pdfium-review.googlesource.com/9050
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: (OOO Jul 28 - Aug 8) dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I43ec0d4a3b60d51c59ba5a540dfe24803e725089
Reviewed-on: https://pdfium-review.googlesource.com/9170
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL uses sizeof to calculate sizes in tiffconf. It adds SIZEOF_VOIDP
to allow LibTIFF to take codepaths reducing OOMs. Finally, it gets rid
of _FX_WIN32_MOBILE_ since it's never defined.
Bug: chromium:718494
Change-Id: I9e6fb2812487ccd7d08e56fd1954c716ddccd07b
Reviewed-on: https://pdfium-review.googlesource.com/9410
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This support is being removed from CFX_ByteString, CFX_ByteStringC,
CFX_WideString, and CFX_WideStringC. This standardizes all of these
classes to only have one Mid method that takes in 2 params, offset and
count. Count now must be positive. The old behaviour of calculating
the length for the user if -1 is passed in for the count has been
removed. This work is in preperation for converting these classes to
not accept negative lengths anywhere and thus make the underlying size
type unsigned.
BUG=pdfium:828
Change-Id: I5f15e7b7b00b264231817f143e2da88ee6f69e7b
Reviewed-on: https://pdfium-review.googlesource.com/9430
Reviewed-by: (OOO Jul 28 - Aug 8) dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
The base level is always 0 in much of the code.
Change-Id: I70b8342e0f6cf1dc366ff9f1d5d734d6f55ead0e
Reviewed-on: https://pdfium-review.googlesource.com/9254
Reviewed-by: (OOO Jul 28 - Aug 8) dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
1. Added CPDF_NameTree::DeleteValueAndName() for deleting new name and
value pairs from a nametree. This function will be used for the API for
deleting embedded files.
* Added an anonymous helper function for updating the tree nodes
and limits upon deletion.
* Added a unit test.
Bug=pdfium:174
Change-Id: I3ee4c27af637f721ee0ccda26fbae3d3a5e58f5e
Reviewed-on: https://pdfium-review.googlesource.com/8931
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
CLRF characters seem to still work with label printer drivers, and some
users want to preserve these characters when printing. We cannot
distinguish new lines due to CLRF characters in the original text from
new lines created during layout, so just add the characters to all new
lines.
Bug: chromium:734850
Change-Id: I4d032a311c33e20a27b2cc1d5d0ba3eb9ef2fd41
Reviewed-on: https://pdfium-review.googlesource.com/9110
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This CL adds a CFX_RTemplate constuctor which accepts a CFX_FloatRect
and converts to the correct type. It also adds a ToFloatRect() method
which returns a CFX_FloatRect. The CFX_FloatRect::FromCFXRect is
removed.
Change-Id: I6827345300c6c4dee02c4e5dfa5590f3c8088748
Reviewed-on: https://pdfium-review.googlesource.com/9114
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL updates some of the fx_coordinates methods to use std::min/max
as appropriate.
Change-Id: I12af519bfcbf97969da6fcc9e1bf978beb2d00e8
Reviewed-on: https://pdfium-review.googlesource.com/9113
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The CFX_FloatRect params are Left,Bottom,Right,Top. Update comment to
match.
Change-Id: If4d8559e1f2693cfe0f7fcbe649add4c9a5bc303
Reviewed-on: https://pdfium-review.googlesource.com/9112
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Iacac67bce99b4b4bcc303fb388aaf03f2f99e4f3
Reviewed-on: https://pdfium-review.googlesource.com/9070
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Ibb7e33dddd79d6266961ebdf56600fc5a091dcb8
Reviewed-on: https://pdfium-review.googlesource.com/9071
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|