Age | Commit message (Collapse) | Author |
|
The SetFlag method has a signature of (flag, bool) which, looking at the
callsites makes you think it will set the flag to the boolean. This
isn't what happens, the flag is always set to true and the boolean
decides if we execute some notification code.
This CL splits SetFlag into SetFlag(flag) and SetFlagAndNotify(flag) to
make it a lot clearer what is happening.
Change-Id: I3e067c87532cce10b94bda10cc88feb62b948eb0
Reviewed-on: https://pdfium-review.googlesource.com/26750
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL marks methods const where possible and removes redundant
methods from CXFA_Document.
Change-Id: I34804425469dfd52469daba68f64a4b511e5d4d0
Reviewed-on: https://pdfium-review.googlesource.com/26730
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL replaces XFA_ItemLayoutProcessor_IsTakingSpace with a
PresenceRequiresSpace call on CXFA_Node.
Change-Id: Ibf570f25eeb3404d72e87cb62e06a7ad70f0916f
Reviewed-on: https://pdfium-review.googlesource.com/24850
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Including cjx_node.h pulls in v8 headers for many XFA files.
Change-Id: I80a32d0a56b8de5787db5275db48c568da6d0144
Reviewed-on: https://pdfium-review.googlesource.com/22890
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL makes it explicit that GetTemplateNodeIfExists can return
nullptr. Various call sites are updated as needed.
Change-Id: If6edd5962b59e7e4ce3dbe9bbdc957783cf76abe
Reviewed-on: https://pdfium-review.googlesource.com/22678
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL updates users of the GetOrCreate* methods to verify that the
value returned is not null before accessing.
Change-Id: I4a9fd29a26d5e4ec792ca3671c9868828e53d46e
Reviewed-on: https://pdfium-review.googlesource.com/22652
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the CXFA_Node::GetNodeItem(kind, object_type) method in
favour of explicit methods. All of the callers passed in a
XFA_ObjectType::ContainerNode.
Change-Id: I713184d3fa188a122284f50ac2a6b0fd3d7aed26
Reviewed-on: https://pdfium-review.googlesource.com/22651
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the generic CXFA_Node::GetNodeItem(type) method for
specific calls to get the parent, child or siblings.
Change-Id: Ief68284ac7b954aaa4ed7120dd82a39f8b52656a
Reviewed-on: https://pdfium-review.googlesource.com/22650
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts the various methods Get methods which take a boolean
value to explicit Get* and GetOrCreate* methods to make the usage
clearer.
Change-Id: I2af68448b1b69b95713e739bf7fe14a4336d2b65
Reviewed-on: https://pdfium-review.googlesource.com/22590
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL splits CXFA_FFNotify::OnCreateLayoutItem into a Content and
Container variant. This removes the need for casting at the two call
sites.
Change-Id: Ic19bf4398f0ea32099c270f3bb585a18004ccb5d
Reviewed-on: https://pdfium-review.googlesource.com/22412
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I29769f78eaad10c6a8b79e27524336c4f330377e
Reviewed-on: https://pdfium-review.googlesource.com/22258
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL adds a type template to the CJX_Object::GetProperty method so we
can have the correct types returned.
Change-Id: Ieda8ec4bd31d26a1e71af30f08b48eb826f5993d
Reviewed-on: https://pdfium-review.googlesource.com/21250
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL templates the various Get methods in CXFA_Node in order to
return the correct node type.
Change-Id: I4f50df6dd9213873deb8f8f262eaf579c6c4ca7d
Reviewed-on: https://pdfium-review.googlesource.com/21230
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Currently CXFA_Node::GetChild always returns a CXFA_Node* object. We
know the type we want when we call GetChild, so this CL changes the code
to add a template parameter to GetChild and return the correct CXFA_Node
subtype for the desired element.
Change-Id: I5aecf2e840504235dc246483abee48e0564841fe
Reviewed-on: https://pdfium-review.googlesource.com/21210
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the CXFA_ScriptData wrapper and uses CXFA_Script
directly.
Change-Id: I1f1932ef96ee4a24407de7eb1d68b8631a5a67ea
Reviewed-on: https://pdfium-review.googlesource.com/21173
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL converts all of the JSNode() to JSObject() calls as all of the
original CJX_Node methods have been moved to CJX_Object. This fixes
potential bad casts from things like CJX_Content which do not inhert
from CJX_Node.
Bug: pdfium:793372
Change-Id: I6c7f63a78f3d47bb6bad74faed3fd8c535bf095e
Reviewed-on: https://pdfium-review.googlesource.com/21090
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the XFA SOM JS Method information out of the c-array and
into individual CJX class files.
Change-Id: I401046a06aacaf1f04e5a51eb899e479de012e15
Reviewed-on: https://pdfium-review.googlesource.com/20450
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The return value of ResolveObjects is always used as a boolean, so
change from int32_t. The XFA_RESOLVENODE_RS object was made a pointer
from a ref.
Change-Id: I030036c01101680e36f4ddf524b468354a2e6850
Reviewed-on: https://pdfium-review.googlesource.com/20331
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I3efc57cd7325d16e3ca8ebdeeaec06012b2c56e3
Reviewed-on: https://pdfium-review.googlesource.com/20110
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL changes the enum XFA_ATTRIBUTEENUM to an enum class
XFA_AttributeEnum. Methods expecting an int32 have been updated to take
or return the XFA_AttrbuteEnum type.
Change-Id: I268453949545fe2dd3eae707be4d9cc7edeff763
Reviewed-on: https://pdfium-review.googlesource.com/20070
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
When a CXFA_Node is created it's created as part of a specific packet.
Previously the code would accept an XFA_XDPPACKET which was stored
internally. This had the potential to allow a node to exist in multiple
packets.
This CL changes the XFA_XDPPacket to the XFA_PacketType enum class and
cleans up a lot of uses to use the more specific packet type.
Change-Id: I7fc8c843bfa6bd32295ae58a26bcec311e43c4b0
Reviewed-on: https://pdfium-review.googlesource.com/20012
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the attribute information out of the xfa basic data array
and stores in the generated nodes.
Change-Id: Id8e280324bf0f75a1da9c937c2734d161324242d
Reviewed-on: https://pdfium-review.googlesource.com/19271
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@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 moves the XFA_CalcData and XFA_LayoutItem out of the map'd data
for a CJX_Node and stores directly on the node. This makes the object a
bit bigger but makes the code a lot more understandable.
Change-Id: I8897a52d61d37595181960c23928984aa5d67efc
Reviewed-on: https://pdfium-review.googlesource.com/18590
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The CJX_Node::{Set|Get|Try}Object methods are used to set
CXFA_WidgetData and CXFA_Node objects into the CJX_Node. This is stored
in the node as void* data and custom delete methods are passed when
needed.
Instead, this CL just stores the two types of things we need on the
CJX_Node and returns the correct types. This uses a bit more space on
the CJX_Node, but it makes the code a lot clearer and simpler.
Change-Id: I8546ea6456a1c1f5f8b602a6a420a0e85f3fac29
Reviewed-on: https://pdfium-review.googlesource.com/18570
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts CJX_Node::TryEnum to return a pdfium::Optional instead
of a bool with an out parameter.
Change-Id: Icc1b063ce51656cc5e467aba358eb9e7d6754fea
Reviewed-on: https://pdfium-review.googlesource.com/18512
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This Cl changes CJX_Node::TryInteger to return a
pdfium::Optional<int32_t> instead of a boolean with an out param.
Change-Id: I4675e08d3b132041f7d87e4639efa1d555089dc2
Reviewed-on: https://pdfium-review.googlesource.com/18511
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes the TryCData and TryContent to return
pdfium::Optional<WideString> values instead of returning a bool and
taking an out WideString.
Change-Id: I9c9d877803f9f1977191e12d6a907c29784c10b2
Reviewed-on: https://pdfium-review.googlesource.com/18510
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL splits the node template out of xfa_utils into its own file. The
XFA_ByteStringToDouble method was moved to the only calling file.
Change-Id: I85fb2dfa3afc4a675ec69574e32d643c0dca731f
Reviewed-on: https://pdfium-review.googlesource.com/18490
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL adds helper methods to CXFA_Node to retrieve the default values
for attributes with the correct data types.
Change-Id: I644435b4b430819f1060a95fa4fffe4ba2826cfe
Reviewed-on: https://pdfium-review.googlesource.com/18450
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts the XFA_UNIT enum to the XFA_Unit enum class.
Change-Id: I6e0588f265e45b863ff1ecc170279f558fb6bd67
Reviewed-on: https://pdfium-review.googlesource.com/18090
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL converts the XFA_ATTRIBUTE enum to an enum class and fixes up
various usages.
Change-Id: I3dd17cc412d97eb212a65ce63bb9fa19605e1e91
Reviewed-on: https://pdfium-review.googlesource.com/18050
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the default values and inlines in the call sites as
needed.
Change-Id: I68925d57b6230400429421ce728dd5524e5fc9a1
Reviewed-on: https://pdfium-review.googlesource.com/17710
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the default values and inlines into the call sites as
needed.
Change-Id: I554e9d5ac781003695f90522f9c6c3160653eb59
Reviewed-on: https://pdfium-review.googlesource.com/17572
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the default values and inlines at the call sites.
Change-Id: I47ff04a01c30af89949e9c8dd5d51f7ffaef1f98
Reviewed-on: https://pdfium-review.googlesource.com/17610
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the default values from {Set|Try}Measure and inlines
into the call sites.
Change-Id: I2356b92d419203cc1cdbea865b6e04b728430f5a
Reviewed-on: https://pdfium-review.googlesource.com/17551
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the default value and inlines into the call sites.
Change-Id: Ib6bc2b27189be3596e83a8b29b7a6a744278ed34
Reviewed-on: https://pdfium-review.googlesource.com/17570
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the default values from TryContent and inlines into the
call sites.
Change-Id: I2d3f41f77364a0b923931479a60e07eae98dd5a9
Reviewed-on: https://pdfium-review.googlesource.com/17550
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the bProto param as it was never set and inlines the
value where needed in the methods. The default value was removed from
bUseDefault and inlined into callsites as needed.
Change-Id: I773261d19aa3799bc607e7df482b5f5e5217bee6
Reviewed-on: https://pdfium-review.googlesource.com/17533
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the GetProperty default value and inlines into the
callers.
Change-Id: I0e18f27b51046fdf37ddc57f34a31154729c8db0
Reviewed-on: https://pdfium-review.googlesource.com/17510
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL moves JS code out of CXFA_Node and places it into fxjs/cjx_node.
The CXFA_Node then has a CJX_Node as a member and, currently, proxies JS
calls to the CJX_Node member.
Change-Id: Ic5b95184c8fd2347f0bdcfbccfa89bb6b52835b6
Reviewed-on: https://pdfium-review.googlesource.com/17290
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL renames cxfa_scriptcontext to cfxjse_engine and
cxfa_fm2jscontext to cfxjse_formcalc_context.
From reading the code, the script context appears to handle the v8 setup
and object code. The formcalc context code is related to handling the JS
code generated from the transpiler.
I, think, these new names make the intended usage clearer. They also
move the code into fxjs/ to keep along side the rest of the JS code.
Change-Id: I50619fbe48ca1f553a44cf0e0cb0210be8e45e4f
Reviewed-on: https://pdfium-review.googlesource.com/17130
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:828
Change-Id: I5c40237433ebabaeabdb43aec9cdf783e41dfe16
Reviewed-on: https://pdfium-review.googlesource.com/13230
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Mid(foo, 1) is equivalent to [foo], if all you want is the character. Similarly
Left(1) is [0]. It is faster also, since it does not need to create intermediate
strings.
Right(1) is a touch more tricky, since it requires something like GetLength() ?
[GetLength() - 1] : 0;. A new method, Last() has been added to perform this
character extraction.
Multiple call sites have been updated to use more efficient/simpler
syntax. There are a number of call sites that use on these patterns, but based
on the surrounding context we actually need/want a string, so they have not been
modified.
Change-Id: I485a7f9c7b34c9bdacecada610158f996816afdd
Reviewed-on: https://pdfium-review.googlesource.com/12890
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The Find and ReverseFind methods for WideString, WideStringC,
ByteString, and ByteStringC have been converted from returning a raw
FX_STRSIZE, to returning Optional<FX_STRSIZE>, so that success/failure
can be indicated without using FX_STRNPOS.
This allows for removing FX_STRNPOS and by association makes the
conversion of FX_STRSIZE to size_t easier, since it forces checking
the return value of Find to be explictly done as well as taking the
error value out of the range of FX_STRSIZE.
New Contains methods have been added for cases where the success or
failure is all the call site to Find cared about, and the actual
position was ignored.
BUG=pdfium:828
Change-Id: Id827e508c8660affa68cc08a13d96121369364b7
Reviewed-on: https://pdfium-review.googlesource.com/11350
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This method duplicates the behaviour of the const [] operator and
doesn't offer any additional safety. Folding them into one
implementation.
SetAt is retained, since implementing the non-const [] operator to
replace SetAt has potential performance concerns. Specifically many
non-obvious cases of reading an element using [] will cause a realloc
& copy.
BUG=pdfium:860
Change-Id: I3ef5e5e5a15376f040256b646eb0d90636e24b67
Reviewed-on: https://pdfium-review.googlesource.com/10870
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@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>
|
|
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>
|
|
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>
|