Age | Commit message (Collapse) | Author |
|
The current implementation of text extraction was difficult to
understand, duplicated logic that existed in other methods, and wasn't
clear about the units the inputs were in. It also didn't handle
control characters correctly.
The new implementation leans on the methods for converting indices
between the text buffer index and character list index spaces to avoid
duplication of code. It also makes it clear to the reader that inputs
are in the character list index space. Finally, it fixes issues being
seen in Chrome with respect of ranges being slightly off.
This CL also adds a test for extracting text that has control
characters.
BUG=pdfium:942,chromium:654578
Change-Id: Id9d1f360c2d7492c7b5a48d6c9ae29f530892742
Reviewed-on: https://pdfium-review.googlesource.com/20014
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
The data used is clearly a CID Range, but the code was interpreting it
as single CID values.
Change-Id: Ibb68f5ca2150d74b007a64ef5daa412fd542cecd
Reviewed-on: https://pdfium-review.googlesource.com/17650
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Or initialize members in the header. Also make m_dwFileLen member const.
Change-Id: Iaaeab9a93e18e4ab313437362c0012d729b01647
Reviewed-on: https://pdfium-review.googlesource.com/9970
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
The original fix to https://crbug.com/641333 was too strict. Relax the
checks and use a std::tuple for the path map key, instead of trying to
"hash" a key.
BUG=chromium:788864
Change-Id: I6e6a96691bce2834c2e95baa16ebd39e6aa03140
Reviewed-on: https://pdfium-review.googlesource.com/19950
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
In this CL we prevent integer overflow by checking that the integers are
in the appropriate range before casting from unsigned to signed.
Bug: 789524
Change-Id: I41572849f18ffb0f0739c80130ee6b5061845d29
Reviewed-on: https://pdfium-review.googlesource.com/20011
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8
This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md
Bug: chromium:776257
Change-Id: Iebab34f3ee97a6249e4517d1f5dec1971c36fcba
Reviewed-on: https://pdfium-review.googlesource.com/19973
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8
This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md
Bug: chromium:776257
Change-Id: I1f6637cde8b3e41825993a736bed6763dd7beacb
Reviewed-on: https://pdfium-review.googlesource.com/19971
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8
This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md
In some cases the the tool leaves behind a string of commas where it
replaced a member initializer list
(https://bugs.llvm.org/show_bug.cgi?id=35051). They were cleaned up
with:
git diff --name-only | \
xargs sed -E -i 's/(^\s*|\)\s*):[ ,]*= default/\1 = default/'
Bug: chromium:778959, chromium:778957
Change-Id: I23e60d3d6c8bc9e8574d425710a0441cb5510d6b
Reviewed-on: https://pdfium-review.googlesource.com/19970
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug:
Change-Id: I0c930ca30637f58af3b60ed8f1383bd9234a1723
Reviewed-on: https://pdfium-review.googlesource.com/19850
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:774
Change-Id: I2056583c270f1bb0046250ce2ec53a2cbe46b893
Reviewed-on: https://pdfium-review.googlesource.com/19672
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes some useless structs from CFX_CTTGSUBTable.
Change-Id: Iaf8b58d70b36d77fea73946c6b4279b15f5726e8
Reviewed-on: https://pdfium-review.googlesource.com/19710
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Bug: pdfium:774
Change-Id: Id993864c4ae009e686c62e7be13e2db5d8cb4170
Reviewed-on: https://pdfium-review.googlesource.com/19572
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Bug: pdfium:774
Change-Id: Ie7674ac55dea6284a0d974cef107ef357197a06b
Reviewed-on: https://pdfium-review.googlesource.com/19610
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL makes the helper methods 'ConvertBuffer_'* in CFX_DIBSource void
since they always succeed.
Change-Id: I55dd714bec5ccc3695cd0bbebcf978d767acc53a
Reviewed-on: https://pdfium-review.googlesource.com/19650
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the CollectionSize and updates call locations as needed.
Bug: pdfium:774
Change-Id: I813c500b3a17a194407ceb1304252b9b16fe1779
Reviewed-on: https://pdfium-review.googlesource.com/19590
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL removes the use of CollectionSize from CPDF_StructTree and uses
size_t in the callers.
Bug: pdfium:774
Change-Id: I860a51a533642c949c497ca26e74ba064a8aa9ba
Reviewed-on: https://pdfium-review.googlesource.com/19530
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
BUG=chromium:788103
Change-Id: I8ebdbc78eb14c358d7ac019b96de4828e6071b79
Reviewed-on: https://pdfium-review.googlesource.com/19350
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
In this CL, we do some nit cleanup and change many var++ to ++var in
CFX_DIBSource.
Change-Id: I2379e6e15688cbde68415adc47b01114ad0785c1
Reviewed-on: https://pdfium-review.googlesource.com/19570
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
This CL changes CountKids to not used CollectionSize and returns size_t
directly. Callers updated as needed.
Bug: pdfium:774
Change-Id: I8862218e62cd13be9473fa8116afd29cd3afde04
Reviewed-on: https://pdfium-review.googlesource.com/19510
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:774
Change-Id: I4996f5526884c33d92df964045bd5467c392df5e
Reviewed-on: https://pdfium-review.googlesource.com/19490
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:774
Change-Id: I7ebbcb17374b4117f92b94edbd8bcba18efe6313
Reviewed-on: https://pdfium-review.googlesource.com/19470
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:774
Change-Id: I3fcde6fba46d21affa63d79fab2d83f47c9c5f84
Reviewed-on: https://pdfium-review.googlesource.com/19450
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL updates various methods in CPDF_TextObject to return or received
size_t values. Callers have been updated as needed.
Bug: pdfium:774
Change-Id: Id72511bc74637c6261add39f5414c9a4b8390b82
Reviewed-on: https://pdfium-review.googlesource.com/19430
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL updates the various call sites to use size_t instead of other
types.
Bug: pdfium:774
Change-Id: Id8b75728b61c0ca1b15bc815831c885d33374f7b
Reviewed-on: https://pdfium-review.googlesource.com/19410
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Bug: pdfium:774
Change-Id: Ie24d0741f8c8d7988166aeb4b9ce87491993d30c
Reviewed-on: https://pdfium-review.googlesource.com/19390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:939
Change-Id: I4204965bd8b81bea3c485fcb27adfa212cce4e69
Reviewed-on: https://pdfium-review.googlesource.com/19190
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I45468fa7944290fbbe3d2e67f884164ae8d84160
Reviewed-on: https://pdfium-review.googlesource.com/19171
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Ic552a652856ca231f3d2077c76a20d5916adb3c1
Reviewed-on: https://pdfium-review.googlesource.com/19170
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Or change them to clear().
Change-Id: Ia9e3e1f0d74b948cec3f8df85d205f830ac9216c
Reviewed-on: https://pdfium-review.googlesource.com/19172
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This gets rid of most core/ non-const ref passing, either by passing by
pointer-to-pointer instead, or by returning std::pair.
Change-Id: Id7bdc355a1a725a05f9fa2f1e982ca8c975beef1
Reviewed-on: https://pdfium-review.googlesource.com/19030
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
So callers no longer have to call str.TrimLeft(); str.TrimRight();
Change-Id: If931eaa8d891f487b9618ebbeee5ee294e807846
Reviewed-on: https://pdfium-review.googlesource.com/18990
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL converts the CFX_DateTime::Now method to be a static and updates
the callers.
Change-Id: I26052c6194ed2d43bca5fee2542787ce166eda85
Reviewed-on: https://pdfium-review.googlesource.com/18670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL moves the Format and FormatV methods of ByteString to be static.
Bug: pdfium:934
Change-Id: I9c30455a789aff9f619b9d5bf89c0712644f2d9a
Reviewed-on: https://pdfium-review.googlesource.com/18650
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL moves the Format and FormatV methods from WideString to be
static.
Bug: pdfium:934
Change-Id: I9941d6a2a5bbf0a82087cd0ea5d0f8fc42eecd3e
Reviewed-on: https://pdfium-review.googlesource.com/18630
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL unifies a bit the public methods of CFGAS_FontMgr. It does so by
replacing the multiple maps on the Windows implementation to a single
map from hash to font. Also, cloning CFX_Fonts is avoided with the use
of SetLogicalFontStyle. These Windows changes are just mimicking other
OS's. As a side-effect, some members of CFX_Fonts are now owned so the
raw pointers are replaced with unique_ptrs.
Change-Id: I576d438572ccbe6c48f8f5cc434d66fc6adba372
Reviewed-on: https://pdfium-review.googlesource.com/18131
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
This code doesn't depend on XFA, but is only used by it. Moving it
out, so it will be easier for me to write some tools for extracting
data out of PDFs.
Bug:
Change-Id: Ic18613b46abed5124c47f539833b01b12c1c6e56
Reviewed-on: https://pdfium-review.googlesource.com/18410
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This should allow https://pdfium-review.googlesource.com/15770 to safely
reland.
BUG=chromium:781529
Change-Id: Id0c1bde3280fb72125d8e74751b9a1cb35302b6f
Reviewed-on: https://pdfium-review.googlesource.com/18170
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL adds checks in CJBig2_GRRDProc to verify if the decoder is
completed before trying to decode. This is currently done in all
decoding calls in CJBig2_GRDProc.
Bug: chromium:782826
Change-Id: Ifb4ee4d09e8357e969aefa107b4dafbc2284324b
Reviewed-on: https://pdfium-review.googlesource.com/18333
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Change-Id: Id53f57085fecfe331c8cbfa6bb372b5ea5044442
Reviewed-on: https://pdfium-review.googlesource.com/18332
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL improves some method names and does other basic cleanup.
Change-Id: I32ea88ff29383e9685d4c686625088c96f73f035
Reviewed-on: https://pdfium-review.googlesource.com/18210
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Change-Id: I82907ad725861b9ccd6299f5dfe20ddb9d238178
Reviewed-on: https://pdfium-review.googlesource.com/17796
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL changes the type of |m_dwOffset| to safe unsigned integer to
prevent the offset from cycling from MAX_UINT32 back to 0.
Bug: chromium:778912
Change-Id: Ib93a8392e52eecf2cc223438ac85e9dc529b0f43
Reviewed-on: https://pdfium-review.googlesource.com/18130
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Only the last trailer was written to the new PDF. In linearized PDFs,
this means Info and Root were not copied to the newly written PDF.
This CL makes CPDF_Parser remember the Root and provide that to
CPDF_Creator.
Bug: pdfium:614
Change-Id: Ia61f5f6a337f7de3010ee0ed39b022c1b2732ea2
Reviewed-on: https://pdfium-review.googlesource.com/17987
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=chromium:782596,chromium:781804
Change-Id: I020be3cf813221bb8314f045d83014a25cb9a950
Reviewed-on: https://pdfium-review.googlesource.com/18070
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I7e5daeafd70ef29bcc9bdebbae004fa4b946b83d
Reviewed-on: https://pdfium-review.googlesource.com/18019
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
The original version of this code was landed in
https://pdfium-review.googlesource.com/c/pdfium/+/13690/. A corner
case has been found that breaks.
In this CL I have reverted the changes in IsHyphen and implemented a
less aggressive cleanup that I have tested works as expected.
BUG=chromium:781804
Change-Id: I3b36f420834081fdd9e1ae17efc234b561b4df41
Reviewed-on: https://pdfium-review.googlesource.com/17950
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Id53cbb8c95f6eb929f6e4eb57333daa24f1b776f
Reviewed-on: https://pdfium-review.googlesource.com/18010
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
This CL removes the single use case from |m_bFlagExact|. This flag
allows the PDF viewer to treat a substitute font with a matching name as
if it was actually an embedded font, which is wrong. For all substitute
fonts, it is important to follow the longer process of first obtaining
the unicode from the charcode to then obtain the glyph in the substitute
font that corresponds to that unicode.
Bug: chromium:781785
Change-Id: Ie5958b43914e0e46334b89b7c2c55c02d0da0c11
Reviewed-on: https://pdfium-review.googlesource.com/17859
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Do more work in the ctor instead of a separate Start() method. Adjust
callers and member variables accordingly.
Change-Id: I310f27b3102a89e8e7b7ad31affd174f1fbbe500
Reviewed-on: https://pdfium-review.googlesource.com/17793
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: chromium:781780
Change-Id: Ie92d8b570c37e9b3364d1ff4502f444a275ee6c2
Reviewed-on: https://pdfium-review.googlesource.com/17910
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|