Age | Commit message (Collapse) | Author |
|
Change-Id: Ide4a972337afaf346e46edc4ede48140cd4544c1
Reviewed-on: https://pdfium-review.googlesource.com/40390
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Conformity with standards.
Change-Id: Ia718700526477fd1826eb4900ab333ebf4c8a517
Reviewed-on: https://pdfium-review.googlesource.com/40353
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The way it was working before is:
Look at the width and height provided for the barcode. If the maximum
number of codewords to fit in that space was within the spec limits
(1 <= cols <= 30 and 3 <= rows <= 90), cram as many codewords as
possible. The unused space was filled with padding.
With this CL, instead look at the amount of content that needs to fit
into the barcode and favor fewer codewords rather than as many as
possible.
Bug: pdfium:1135
Change-Id: Ia96be82ec7c5f4f920cff58def1a44000bf04761
Reviewed-on: https://pdfium-review.googlesource.com/40350
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
This is useful for debugging and validation purposes. The hashes that
are in BarcodeTest are not necessarily for valid outputs.
This CL refactors the code in embedder_test.png that already does this,
moving it to testing/utils where unit tests can access it too.
Bug: pdfium:1135
Change-Id: I6f1d70a4e133f8f04dbe52646087f99c448e95f8
Reviewed-on: https://pdfium-review.googlesource.com/40152
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Reduce the logical size of the barcode by removing unnecessary
region duplication.
As far as I can tell, the line thickness is useless and the aspect
ratio causes arbitrary changes in rounding, but ultimately the
dimensions of a barcode are defined by its width and height, rather
than by this ratio.
The improvement with this CL is from ~580ms to ~390ms per barcode,
so about 1.5x. Combined with
https://pdfium-review.googlesource.com/c/pdfium/+/40010
the improvement is to ~15ms, which is about 39x.
This also fixes the rendering of the barcode in the pixel and
corpus tests. You can verify this pointing a barcode reader app at
the screen. It does not however fix every case, as the unit test is
still unreadable.
Bug: 872907, pdfium:1135
Change-Id: Ic28e60f54719552cfe69ace7ebc3f730c338a129
Reviewed-on: https://pdfium-review.googlesource.com/40030
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Setting these to anything outside of [1, 10] is non-op. Not sure why
the test did that, but these lines have no effect.
Bug: pdfium:1135
Change-Id: I175d07137674ab1b6b9c86b3bc68b4a128601b9f
Reviewed-on: https://pdfium-review.googlesource.com/40250
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Callers always want one form or the other, so split into separate
methods. This may save some branching.
Remove forms that are not used.
Put more helpful helper function in .cpp file.
Change-Id: I4e025de7f69ce3f323cd290a5dc8202dd4f8ca07
Reviewed-on: https://pdfium-review.googlesource.com/40270
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Non-consecutive mode has questionable correctness and is not an obvious
performance win.
Change-Id: Idaa66e5ee5c4604628a0f55b67d5a04ab47ea5ec
Reviewed-on: https://pdfium-review.googlesource.com/40050
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Replace it with CFX_ReadOnlyMemoryStream, which does the same thing.
Take some checks from CFX_BufferSeekableReadStream and add them
CFX_ReadOnlyMemoryStream.
Change-Id: I25554c3aec3ec96967f8df16ca68a64dba121b6f
Reviewed-on: https://pdfium-review.googlesource.com/40070
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Bring in line with standards.
Remove argument entirely for mac code that is always nullptr.
Change-Id: I0710bdbd51fc0bc2e1d428ef44976be39a631147
Reviewed-on: https://pdfium-review.googlesource.com/40091
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
It is always true now.
BUG=pdfium:263
Change-Id: I74fd0091f5815701718e8cd5acc6e7a0de772a85
Reviewed-on: https://pdfium-review.googlesource.com/40031
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Id097320ab2d9b5d1579582e5797e29c701499501
Reviewed-on: https://pdfium-review.googlesource.com/39991
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
More const pointers, less const_casts.
BUG=pdfium:263
Change-Id: I47fc6d8f2f837390e40ad22d8b67946065294eaa
Reviewed-on: https://pdfium-review.googlesource.com/39879
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
No need to even bring any .cpp files in line with these headers.
Change-Id: I934169d77ae09adc11f02e5ea92b1f8b078c9477
Reviewed-on: https://pdfium-review.googlesource.com/39876
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Introduce const/non-const versions of method where required.
Part of the war on const_cast<>. Tidy one expression to use []
instead of .data().
Change-Id: I41e45669c79eee242ff2244c7dc3afcf6386a433
Reviewed-on: https://pdfium-review.googlesource.com/39852
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Turns out that "FromUnicode" is misleading in that, on linux, it simply
removes any characters beyond 0xFF and passes the rest unchanged, so
no unicode decoding actually takes place. On Windows, it passes it into
the system function specifying FX_CODEPAGE_DefANSI, converting it into
the so-called "default ANSI code plane", passing some characters,
converting others to '?' and still others to 'A'. Either way, nothing
resembling UTF8 comes out of this, so pick a better name.
These now immediately look suspicious, so a follow-up CL will see
which ones should really be WideString::UTF8Encode() instead.
Making this a normal method on a widestring rather than a static
method on a bytestring feels more natural; this is parallel to
the UTF8Encode and UTF16LE_Encode functions.
Add a test that shows these conversions.
Change-Id: Ia7551b47199eba61b5c328a97bfe9176ac8e583c
Reviewed-on: https://pdfium-review.googlesource.com/39690
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Limits the number of elements that can be added to the expressions
list in the FormCalc parser. This handles cases like long strings of !
repeated, since ! is a valid identifier and identifiers are valid
expression, even though it will be no-op. This is another case of
something that is valid, but stupid.
BUG=chromium:870385
Change-Id: I8e34ce00bcbe4499e0a45bd5dc38541793144481
Reviewed-on: https://pdfium-review.googlesource.com/39630
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Simpler, faster, and avoids platform idiosyncracies of wprintf().
Change-Id: I91676bc38199ca2c30936094ca145239f915bc53
Reviewed-on: https://pdfium-review.googlesource.com/39610
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: If3eb4396232daed28f2b63ffe1d110075c9299de
Reviewed-on: https://pdfium-review.googlesource.com/39230
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Provides consistency with the naming of other traverse strategies.
Fix dubious casting inside the strategy.
Change-Id: Ic96b1922ae1dc601a37c8c3b3dd0f118ab6b2eea
Reviewed-on: https://pdfium-review.googlesource.com/39210
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Add more checks for |m_pLocaleMgr| before dereferencing it.
Change-Id: I39ab44d652364f5530266d2b724fa6703d1b51f1
Reviewed-on: https://pdfium-review.googlesource.com/39114
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: I7809f2648d24b4ae0dd1a5a0d4fd98a0bd4d8939
Reviewed-on: https://pdfium-review.googlesource.com/39113
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Fix some nits as well.
BUG=chromium:868271
Change-Id: Ia3231fde98c3e16e41b092a9833402cedc8e828d
Reviewed-on: https://pdfium-review.googlesource.com/39112
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
We don't need anything that the parent class can't provide, so
avoid dubious casting.
Change-Id: I9f3d9735f3bfbcf005865772af31817c2b8addef
Reviewed-on: https://pdfium-review.googlesource.com/39270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Because bools are bogus.
Change-Id: I54a2627443784cec40912288230e657c63a35408
Reviewed-on: https://pdfium-review.googlesource.com/39190
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Instead, move the methods to the subclass where they belong.
Fix IWYU in CJX_Object.h to fix compilation.
Change-Id: I4c71f28235b9cf5000e9ddaf33d6602baf22205f
Reviewed-on: https://pdfium-review.googlesource.com/39170
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
... and then immediately release it, but it is a step in the right
direction.
Change-Id: Ib52972c6789d8f98a576d1c69f8019541c96ac51
Reviewed-on: https://pdfium-review.googlesource.com/39152
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
We'll get a nice safe segv should this somehow happen in the wild
instead of a type confusion error. We'll assert later on in the
debug builds when the null is seen, as well.
Change-Id: Iabd8468adcbacaa0acdc7c68f27cc8f94e0e68cc
Reviewed-on: https://pdfium-review.googlesource.com/39151
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
There's no reason that every CXFA_LayoutItem must be a
CXFA_ContentLayout item, so use checked conversions. The
code may already be arranging things so the constraint is
already satisfied, but this adds an additional layer of
safety.
Tidy some long expressions with pre-existing typedef for node
iterator while we're at it.
Change-Id: If1448131ca73bfedb2266b070f1a913688598e64
Reviewed-on: https://pdfium-review.googlesource.com/39051
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I3fdc6d473f08835b6caeacbbd583bb651a9c5678
Reviewed-on: https://pdfium-review.googlesource.com/39111
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
It is reachable, and the action is currently a no-op, so let it be. Also
change FormValueNode_SetChildContent() to return void since no caller
checks the return value. Remove its default argument, since all the
callers set it.
Change-Id: I742ca2d936872a3b3d609c178321199abc06546c
Reviewed-on: https://pdfium-review.googlesource.com/39115
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This cache is never read.
Change-Id: Iaa4dcf8debf01ab783c2e757a19b18c0317d6fe1
Reviewed-on: https://pdfium-review.googlesource.com/39150
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
It makes illegal casts and requires its callers to double-check the
type validity of results before use. Instead, use the parent
class iterator and perform checked casts.
No functional difference, since it looks like the requisite checks
were being made in all places.
Make one "using" visible to other files to save some verbosity.
Change-Id: I894ca15b4bdddd4723b787663950a58bc58b7f06
Reviewed-on: https://pdfium-review.googlesource.com/39030
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
All usages were previously checked correctly, but this consolidates
some code as well.
Change-Id: I63711748b31b698a3f21f98fdb536db1e9e0b1cf
Reviewed-on: https://pdfium-review.googlesource.com/39010
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Introduces checks in a few new places, but mainly just consolidates
checking/casting logic.
Change-Id: I634a03060d254db099972c6978249992367e146c
Reviewed-on: https://pdfium-review.googlesource.com/38900
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The cache is never accessed and retains fonts in memory that will
not be used anymore.
Change-Id: Ia763499dc88a99741a85afc4ddd09257e8e1119c
Reviewed-on: https://pdfium-review.googlesource.com/38898
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Replace with CFX_BufferSeekableReadStream, which allows for spans and
const inputs.
Change CXFA_DocumentParser to take IFX_SeekableReadStream instead of
IFX_SeekableStream in the process.
Change-Id: I0168451350c9fc250231f0414c38738a4d86ca42
Reviewed-on: https://pdfium-review.googlesource.com/38852
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Bug: chromium:842503
Change-Id: If411815d8324929f482e3cad0fda54f24d370c2a
Reviewed-on: https://pdfium-review.googlesource.com/37830
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
And use it in place of ASSERT() that the type was correct. Since we
can check it, doing so at runtime may help avoid type confusion, and
we'll get a nice safe SEGV if the asserted condition ever fails.
Change-Id: I46b65a4b70e819a670d7cad7966e0d100f0d9a63
Reviewed-on: https://pdfium-review.googlesource.com/38810
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Because the other helpers are declared here.
Rename VariablesThis to ThisProxy in a few places; VariablesThis is
a slightly different concept (see GetVariablesThis()).
Then introduce helper for CXFA_List subclass as well.
Remove unused const version of some helpers.
Change-Id: Ia328d8cd170a8b97015e98c1c770fa8a44810455
Reviewed-on: https://pdfium-review.googlesource.com/38670
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Do not allow instanceManager methods to run in Foreground XFA forms.
They are static, and their widgets should not be inserted or removed.
See "XML Forms Architecture (XFA) Specification Version 3.3", page 272.
Bug: chromium:860697
Change-Id: Ia96834e085ee508618ca4dcb2bd5271466369ede
Reviewed-on: https://pdfium-review.googlesource.com/38751
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Previous CLs have shown that the "lpClass" checks aren't sufficient
here, so ensure we are always checking C++ enum value before
downcasting this type.
Change-Id: I418127c5e7131e0a3363363a60d1976719d6837c
Reviewed-on: https://pdfium-review.googlesource.com/38550
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Do the same thing for N other similar files.
Change-Id: If9bb7f6335287441206083c3512fc8a788e9d39b
Reviewed-on: https://pdfium-review.googlesource.com/38532
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
More foolproof technique, and saves one word in every instance at a
cost of two pointers in every subclass vtable.
Change-Id: Ied4f91d4d203b5e6d83abe751159eb7e55489bb5
Reviewed-on: https://pdfium-review.googlesource.com/38530
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Part of the effort to not trust downcasts in the CFXA_Node hierarchy.
The number of subclasses is small enough here that the O(n^2) space
overhead for the vtables is not significant.
Put all sub-classes in same top-level namespace as the parent, just
because we avoid jumping in and out of anonymous namespace.
Change-Id: I32b80a93c75f8a09eb17c01fe1e29d04b4053fa1
Reviewed-on: https://pdfium-review.googlesource.com/38510
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This is a cleaner way of getting the required argument. Add helper
function and anonymous namespace as misc. cleanups along the way.
Change-Id: I600074b7f6597ffd9b451a21ee374f937a8e9940
Reviewed-on: https://pdfium-review.googlesource.com/38310
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Bug: chromium:849143
Change-Id: I973bb3be6151ac3afad850533cb735c03e9f3d2c
Reviewed-on: https://pdfium-review.googlesource.com/38210
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Introduce cfxa_layoutcontext.cpp to satisfy chromium style ctor check.
Fix typo in class forward declaration in cfxa_layoutcontext.h
Change-Id: I2b29bf61a21be0f895faf8984897c5655a4f0e89
Reviewed-on: https://pdfium-review.googlesource.com/37950
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The root of the issue is that CXFA_FFDateTimeEdit inherits from
CXFA_FFTextEdit and methods in the former treat its widget as a
CFWL_Edit, while it can be a CFWL_DateTimePicker.
Bug: chromium:857521
Change-Id: I764b6c03095b16f6a9cf72ff36768ca4c57c4070
Reviewed-on: https://pdfium-review.googlesource.com/37910
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
UI elements in XFA can have two different <picture> clauses with
different meanings. One is a formatting statement that dictates the
format the underlying data should appear in. The other <picture>
occurs within an <validate> block and specificies what format the
underlying should be. If it doesn't fit this <picture> the <validate>
block indicates what should occur.
In the existing code actually running the second <picture> type was
being conditionally guarded on whether of not the formatting of the
first type succeeded. This CL moves the calls related to data changing
earlier, to before the formatting and UI updating occurs.
BUG=pdfium:1065
Change-Id: Ib525c490074187c3272f4263ab451bf347b74f9c
Reviewed-on: https://pdfium-review.googlesource.com/37250
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|