Age | Commit message (Collapse) | Author |
|
This CL fixes some nits in fpdf_parser_decode, especially avoiding non-const
reference parameters.
Change-Id: Ibb914850afd924bb398f886ac862f7589519ef7e
Reviewed-on: https://pdfium-review.googlesource.com/6750
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This function copies the selected text from a form text field or
form combobox text field into the buffer parameter and returns the
length of the selected text string. When buffer is a nullptr or
buflen is less than the length of the selected text, this function
does not modify the buffer and only returns the selected text length.
BUG=chromium:59266
Change-Id: Ie77de38e45bbe6f9ea033826c961435304eedfc7
Reviewed-on: https://pdfium-review.googlesource.com/6413
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
There are three comboboxes:
1) Normal combobox with pre-selected value.
2) User editable combobox.
3) Read-only combobox, which is actually invisible.
Change-Id: I6bc7955459a11bf043ace7002393c2d7ee8471e9
Reviewed-on: https://pdfium-review.googlesource.com/6770
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Simple wrapper class for annotation + its path parsing form object. This
will be used in APIs for extracting and setting annotation paths.
Bug=pdfium:737
Change-Id: I2e8131672d087613213735295c6d01e377b956e7
Reviewed-on: https://pdfium-review.googlesource.com/6730
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I8a17739538a9ecd63d713007550177579c0b72f0
Reviewed-on: https://pdfium-review.googlesource.com/6731
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
When a Shading is created we have both a ShadingPattern and a
ShadingObject. The ShadingPattern is a ref-counted object that is stored
in the CPDF_DocPageData. The ShadingObject, when we have a tiling
pattern parent, is stored in the CPDF_Form of the tiling pattern.
Currently during destruction it is possible for the ShadingPattern to
get cleaned up before the ShadingObject which causes the UnownedPtr
probe to fire. This CL loops over all patterns and for each Tiling
pattern forces the CPDF_Form to get cleared. This then removes the
ShadingObject before we remove the ShadingPattern.
Bug: chromium:728992
Change-Id: Ife65607aa97f69440b03028981b5575b1e297093
Reviewed-on: https://pdfium-review.googlesource.com/6651
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL uses the following algorithm for improving substitute font spacing (we
are assuming the text layout is horizontal):
* Calculate PDFWidth, the width that the PDF says the glyph should have.
* Calculate FTWidth, the width calculated by freetype for the glyph, using the
substitute font that we'll use to render it. Note that some embedded fonts have
PDFWidth == FTWidth + 1, so we consider that to be matching widths.
* If PDFWidth > FTWidth + 1 , move the x coordinate by the difference / 2 so
that the glyph is rendered in a more centered spot and the text looks better.
* If PDFWidth < FTWidth, transform the glyph horizontally by PDFWidth / FTWidth
so that the glyph gets compressed and does not overlap with surrounding glyphs.
Bug: chromium:431507
Change-Id: Ia378344253fabe44d93af4daab98bb3b7bca22de
Reviewed-on: https://pdfium-review.googlesource.com/6630
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This still won't work if the info dict is not on the first page
without first calling FPDFAvail_IsFormAvail or FPDFAvail_IsPageAvail,
as these are the methods that trigger parsing the rest of the data.
Bug: pdfium:664
Change-Id: I0b0193e415a1153dcfb8bfba0e0482da6b6ba53c
Reviewed-on: https://pdfium-review.googlesource.com/6610
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Fix some nits and simplify code as well.
Change-Id: I77c88f211b9ce32f38221d04c067f73818e0e970
Reviewed-on: https://pdfium-review.googlesource.com/6674
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Instead of using EXPECT_EQ() and constructing a std::string.
Change-Id: I7f349f49a03b1ebbad15865f9783568f4d025d91
Reviewed-on: https://pdfium-review.googlesource.com/6670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I8926f3a3b5c41b144a1f890b6892b67d25bcf5ac
Reviewed-on: https://pdfium-review.googlesource.com/6690
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The out_row_buffer of BMPDecompressor is made a vector. This forces the
class to have constructor/destructor. Some other members were changed
to be of size_t instead of int32_t.
Change-Id: I3f70b0322dcee2ddf9a00da7962b43f3415ba545
Reviewed-on: https://pdfium-review.googlesource.com/6691
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Currently, in embedder tests, pages can only be rendered with no flags
specified. With the addition of annotation APIs and corresponding
embedder tests, it is helpful to add a test method to allow flags to be
passed in when rendering pages in embedder tests.
This CL adds such a method.
Bug=pdfium:737
Change-Id: I277831cb2e228154e9a65b078a241b8e61220664
Reviewed-on: https://pdfium-review.googlesource.com/6711
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
There is already public APIs for SetFillColor, GetFillColor, and
SetStrokeColor; this is the only one missing.
This function is helpful to have when extracting path information from
annotations.
Change-Id: I2bf80a1dc5433e65bbb1d005c0e609d01c9133be
Reviewed-on: https://pdfium-review.googlesource.com/6710
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: I1b31217c756620873f59527768464aec02a82900
Reviewed-on: https://pdfium-review.googlesource.com/6677
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:731
Change-Id: Ic492e8900c4a69082ff9c2384006a4e6bfa3313e
Reviewed-on: https://pdfium-review.googlesource.com/6592
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:731
Change-Id: Id4cb57aaf1d045d5052869477a8c5082cab8961c
Reviewed-on: https://pdfium-review.googlesource.com/6675
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Ie7bd4ec567ce932c8010bae744ba42cf40706b79
Reviewed-on: https://pdfium-review.googlesource.com/6678
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: Idcbff7db2f9cf0d6698702ca007be5a8b44c7760
Reviewed-on: https://pdfium-review.googlesource.com/6673
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:733245
Change-Id: Ic9347e2cc245831c0b71fac1d531c33c5646ab3f
Reviewed-on: https://pdfium-review.googlesource.com/6671
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: Iec6749044796945e77cee57e74ab6611f82fa813
Reviewed-on: https://pdfium-review.googlesource.com/6672
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Also switch C-style casts to the appropriate C++ casts, and add helper
functions in some cases.
Change-Id: I73f1ab36c6c89ced9d2b7b98393805142661dcac
Reviewed-on: https://pdfium-review.googlesource.com/6650
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:732322
Change-Id: I479f3edf48fcb2cac32d7fcb76651f9ad1246483
Reviewed-on: https://pdfium-review.googlesource.com/6553
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
BUG=chromium:732039
Change-Id: I0bc6b24cb41f093eae7bd0a96bcdd441ec8322d7
Reviewed-on: https://pdfium-review.googlesource.com/6531
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
CFFL_FormFiller::CommitData() should check more rigorously and so should
its callers.
BUG=chromium:732051
Change-Id: If0cee8fb61de10dc7678dad89c330d75bee55aa4
Reviewed-on: https://pdfium-review.googlesource.com/6530
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I64e32fc9226f57e1c9adff7809fabc6cd56e7a8f
Reviewed-on: https://pdfium-review.googlesource.com/6611
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL creates BMPDecompressor from a struct and moves into this class
many methods which naturally belong to it.
Change-Id: I042fac9b48d0b732ee9e43fbeb0eec6b52007dab
Reviewed-on: https://pdfium-review.googlesource.com/6511
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Reenabling since can't reproduce failure any more.
Bug=pdfium:747
Change-Id: I347a994e0a6b389d39162075f7d5d94ae0048984
Reviewed-on: https://pdfium-review.googlesource.com/6590
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The path creation method begins with an open MoveTo point. If nothing
else is added, CFX_PathData::GetBoundingBox will try an OOB access in
its m_Points. This CL adds a check similar to the one in
CPDF_StreamContentParser::AddPathObject.
Change-Id: Iec7cfe3379253c021ba7d5f276306a66009f84e2
Reviewed-on: https://pdfium-review.googlesource.com/6593
Commit-Queue: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
CL [1] added the ability to set the blend mode for a page object. This
CL adds the corresponding component to GraphicsData since the blend
mode is part of ExtGSState. In addition, a test using the SetBlendMode
method is added.
[1] https://pdfium-review.googlesource.com/c/5953/
Bug: pdfium:720
Change-Id: I49120284345185c200a45cc3b37ec59f0658e2dc
Reviewed-on: https://pdfium-review.googlesource.com/6510
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:732661
Change-Id: Ie11a7d97db97ac969fb6230956efbf21c2ed3d87
Reviewed-on: https://pdfium-review.googlesource.com/6555
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I4c8ce920a4802b5b2ce3dc684cef271fc185feb0
Reviewed-on: https://pdfium-review.googlesource.com/6554
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
It has been deprecated for 2 years now.
Use FPDFPage_HasFormFieldAtPoint() instead.
Change-Id: I1a5f88b404fbda40f491f9d2001ef3e7788e95a0
Reviewed-on: https://pdfium-review.googlesource.com/6551
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
PDFium's vswprintf() is based on the win32 version to be consistent
across platforms. On Windows, %s has different meanings depending on
whether the printf() variant is wide or not.
BUG=chromium:732533
Change-Id: I7437ecd253da1234728c1e0897f02b7f907aada8
Reviewed-on: https://pdfium-review.googlesource.com/6550
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
It's possible to create a stream of length 0 in a PDF document.
Currently the code will early exit and return a nullptr. This causes
issues when you want to print the given PDF as the FPDF_ImportPages code
ends up only generating up to the zero length object.
This CL allows creating streams with length 0 and updates the PDF saving
code to output a blank stream.
Bug: chromium:732380
Change-Id: I44182ba4aaac7c51284b002ba01bbc34b6bcf9e0
Reviewed-on: https://pdfium-review.googlesource.com/6490
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The pal_num member of bmp_ptr indicates the number of color indices
used by the bitmap. This CL returns an error when an invalid index is
found, since otherwise a heap-buffer-overflow can occur since the size
of m_pSrcPalette is calculated based on pal_num.
Bug: chromium:616670
Change-Id: I397958704bed1aa1ae259016ffd5033c07a801ee
Reviewed-on: https://pdfium-review.googlesource.com/6470
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
CPWL_ComboBox's unowned pointers to other CPWL_Wnds need to be released
at the right time. Also release the unowned pointer for CPWL_Wnd's
vertical scroll bar at the right time.
BUG=729041
Change-Id: I06a1da35fcb18dae8faf9cd4fbc0b75d38f115b0
Reviewed-on: https://pdfium-review.googlesource.com/6418
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL adds ExtractCountDigits and ExtractCountDigitsWithOptional to
cleanup the digit extraction code.
Change-Id: I6c3f4b435ec41b429b18cd9af9be46551a7fa391
Reviewed-on: https://pdfium-review.googlesource.com/6391
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Bug: pdfium:731
Change-Id: If606359bd9264a6f440871ab824ab54a4efae901
Reviewed-on: https://pdfium-review.googlesource.com/6450
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I6d1f59318cd63539ddce3fbdd3f0a375060b6476
Reviewed-on: https://pdfium-review.googlesource.com/6435
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Commit 5f597db5 accidentally changed this. Probably due to copy/pasting.
Change-Id: I41f6876da28d5d744d6d169c67b33399893e3585
Reviewed-on: https://pdfium-review.googlesource.com/6416
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:655
Change-Id: Ibf4217b35b613d21d3e8e060608b502ef79acd9e
Reviewed-on: https://pdfium-review.googlesource.com/6392
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
FXFT_Get_First(Next)_Char can return large unsigned values. This CL avoids
integer overflow and adds some missing checks regarding the ranges of the
values returned by those methods.
Bug: chromium:727086
Change-Id: Ice7bbb3759e384b7174680a82a2a9380c3611382
Reviewed-on: https://pdfium-review.googlesource.com/6436
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I20c3d87dba91d1489794abb77afcd2d7e9db88fe
Reviewed-on: https://pdfium-review.googlesource.com/6393
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
As per Lei's comments while looking back at annotation API CLs to
attempt to fix Bug 747.
Bug=pdfium:737
Change-Id: I96369bf8dcc7afdf49e9a137e7bcba4ff1aeef67
Reviewed-on: https://pdfium-review.googlesource.com/6431
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Instead of one general RemoveAt() method, split it into:
- RemoveAt(index)
- Truncate(nNewSize)
- Clear()
Update callers, which are now easier to understand.
Update existing unit tests and add new tests.
Change-Id: I38fe40146ce8f2479677b2caadd20a1756678768
Reviewed-on: https://pdfium-review.googlesource.com/6417
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
std::ostringstream.""
This reverts commit 53827cbbfebae66dd31f7aa30d3ee5c88716897a.
Reason for revert: Rollforward of original CL - test failures were flakes.
Original change's description:
> Revert "Adding constructor of CFX_ByteString that takes a std::ostringstream."
>
> This reverts commit 4633d52736c4b926eceb1e18c4b379ff57fd31fa.
>
> Reason for revert: windows_xfa_clang broke?
>
> Original change's description:
> > Adding constructor of CFX_ByteString that takes a std::ostringstream.
> >
> > Bug: pdfium:731
> > Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a
> > Reviewed-on: https://pdfium-review.googlesource.com/6394
> > Reviewed-by: dsinclair <dsinclair@chromium.org>
> > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
>
> TBR=dsinclair@chromium.org,hnakashima@chromium.org
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: pdfium:731
>
> Change-Id: I674aa1be12d6777c4d565d3131910ac5a11d8dc0
> Reviewed-on: https://pdfium-review.googlesource.com/6395
> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
TBR=dsinclair@chromium.org,pdfium-reviews@googlegroups.com,hnakashima@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: pdfium:731
Change-Id: I4a31a1a6bdb128016183c1059f0bfe1fa559a89e
Reviewed-on: https://pdfium-review.googlesource.com/6434
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug=pdfium:747
Change-Id: I51656750e5e5e7f7cecefc5244a66333a0213f19
Reviewed-on: https://pdfium-review.googlesource.com/6433
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
This reverts commit 4633d52736c4b926eceb1e18c4b379ff57fd31fa.
Reason for revert: windows_xfa_clang broke?
Original change's description:
> Adding constructor of CFX_ByteString that takes a std::ostringstream.
>
> Bug: pdfium:731
> Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a
> Reviewed-on: https://pdfium-review.googlesource.com/6394
> Reviewed-by: dsinclair <dsinclair@chromium.org>
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
TBR=dsinclair@chromium.org,hnakashima@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: pdfium:731
Change-Id: I674aa1be12d6777c4d565d3131910ac5a11d8dc0
Reviewed-on: https://pdfium-review.googlesource.com/6395
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:731
Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a
Reviewed-on: https://pdfium-review.googlesource.com/6394
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|