Age | Commit message (Collapse) | Author |
|
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 CL converts the use of CPVT_Color to CFX_Color and removes the
CPVT_Color class.
Change-Id: I86a2d06524cd8f0fbce2335f0185426cc41dbe84
Reviewed-on: https://pdfium-review.googlesource.com/16030
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug: 756427
Change-Id: I8e31d96c6f3b83a6464ed69c95225362c50386d1
Reviewed-on: https://pdfium-review.googlesource.com/15870
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
BUG=chromium:756427
Change-Id: I90c7065ec5a467cb954cdf3e1d6954a0b0655d4e
Reviewed-on: https://pdfium-review.googlesource.com/15630
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL moves CFX_UnownedPtr to UnownedPtr and places in the fxcrt
namespace.
Bug: pdfium:898
Change-Id: I6d1fa463f365e5cb3aafa8c8a7a5f7eff62ed8e0
Reviewed-on: https://pdfium-review.googlesource.com/14620
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL renames CFX_AutoRestorer to just AutoRestorer and places in the
fxcrt namespace.
Bug: pdfium:898
Change-Id: Id9f36df94e95f3b2a55054bc198ca1bfd249ee3d
Reviewed-on: https://pdfium-review.googlesource.com/14450
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ice5ef31af6e32b6a02072e2a4445b19d4f801d3c
Reviewed-on: https://pdfium-review.googlesource.com/14330
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@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>
|
|
Then if they roll over, it doesn't matter, since we only check for change.
And then we can pull a silly check. Then remove some no-op calls where we
didn't use the result.
Change-Id: I35ba470b42fb8c32a6984999e0311b21729791ca
Reviewed-on: https://pdfium-review.googlesource.com/14210
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
First step in passing ownership of this memory to the CPWL_Wnd.
In turn, nest two other classes that also require PrivateData to
satisfy nesting rules.
Move one stray #define to the appropriate file while at it.
Change-Id: I565934565421f5843a3b792b3bdc21b5e8839eb8
Reviewed-on: https://pdfium-review.googlesource.com/14170
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This nesting makes so much more sense when I read the code.
Fix member naming for this in CPWL_Wnd.
Pass in/out CreateParams arg as pointer.
Kill Reset() method, only called during destroy and nothing needs
explicit cleanup.
Change-Id: If50e403e11c131e7656da09c0cb36866223d64c6
Reviewed-on: https://pdfium-review.googlesource.com/14070
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
And along with it any data that the window may have been carrying.
Tidy some return codes while we're at it.
Bug: 765384
Change-Id: Id16ec5f82b3d9273ba8f2edb1e4645a9145df4f6
Reviewed-on: https://pdfium-review.googlesource.com/14050
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The event was changed to behave in the same way as when reacting to a
mouse click event.
R=thestig@chromium.org
Bug: pdfium:897
Change-Id: I14366d69ad309e00cb1dd78672870d1ee95007a9
Reviewed-on: https://pdfium-review.googlesource.com/13990
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Instead of only having CPDF_Dictionary* GetRoot() const, provide
const CPDF_Dictionary* GetRoot() const and CPDF_Dictionary* GetRoot().
Do the same for GetInfo().
Change-Id: I6eae1208d38327fcdc7d0cd75069a01c95f4a92a
Reviewed-on: https://pdfium-review.googlesource.com/11671
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL moves CFX_AutoRestorer into its own file, separate from
fx_basic.h.
Change-Id: I415cb9207416bd4744b8ac8e2d7466852db53f0a
Reviewed-on: https://pdfium-review.googlesource.com/12390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Instead of using CFX_FloatRect::ToFxRect(), which always rounds down,
use GetOuterRect() which correctly rounds up / down depending on the
side of the rectangle.
Change-Id: I7abd3a65e8c0467ed4303292f26a72737a5d553b
Reviewed-on: https://pdfium-review.googlesource.com/12312
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Remove some useless overrides.
Change-Id: Icf4d8bfcca6358ef3f59f768c2d60759d4b05243
Reviewed-on: https://pdfium-review.googlesource.com/10854
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: If038850c745ac26e50c313bdbe630483434caedc
Reviewed-on: https://pdfium-review.googlesource.com/11390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The crash was caused by a dangling pointer in CPWL_ListCtrl to
the font map owned by CFF_TextObject. The order of events was:
1. ~CFFL_ListBox runs and calls parent destructor ~CFFL_TextObject.
2. ~CFFL_TextObject runs and deletes its member m_pFontMap. m_FontMap
was referenced by CPWL_ListCtrl which is now dangling.
3. ~CFFL_TextObject calls parent destructor ~CFFL_FormFiller.
4. ~CFFL_FormFiller calls DestroyWindows().
5. CFFL_FormFiller::DestroyWindows() deletes widgets, among them
CPWL_ListBox.
6. ~CPWL_ListBox deletes its member CPWL_ListCtrl.
7. ~CPWL_ListCtrl sees a dangling pointer to the map and crashes.
Making the DestroyWindows() call earlier in the destructor of
CFFL_TextObject, we execute steps 5-7 before freeing m_pFontMap.
An extra DestroyWindows() is still made in ~CFFL_FormFiller, but
it is then non-op if the derived CFFL_TextObject already called it.
Bug: chromium:757506
Change-Id: Ib8dce04f1dd0bcf8e10701f6cf7ea500bfb5ba84
Reviewed-on: https://pdfium-review.googlesource.com/11651
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Currently, all three of CFX_Matrix::TransformRect() take in rect values
and modify them in place.
This CL converts them to take in constant values and return the
transformed values instead, and fixes all the call sites.
Bug=pdfium:874
Change-Id: I9c274df3b14e9d88c100ba0530068e06e8fec32b
Reviewed-on: https://pdfium-review.googlesource.com/11550
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
Simplify some code along the way.
Change-Id: I0022c8a82188192c63b9ac0bc87e9b9dbf983040
Reviewed-on: https://pdfium-review.googlesource.com/10852
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This class implements common code used by several CFFL_FormFiller
sub-classes. Make those sub-classes inherit from CFFL_TextField, instead
of inheriting from CFFL_FormFiller directly and then implementing the
same functionality multiple times.
Change-Id: Iad8a735b6d6e18e89d617636b753805d3f77a286
Reviewed-on: https://pdfium-review.googlesource.com/9850
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This method replaces the selected text in a user-editable form text
area with another text string (which can be empty or non-empty). If
there is no selected text, FORM_ReplaceSelection() will append the
replacement text after the current caret position.
BUG=chromium:59266
Change-Id: I76448ef757d107888c33ebd5656457ebac93b952
Reviewed-on: https://pdfium-review.googlesource.com/8812
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Diana Gage <drgage@google.com>
|
|
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>
|
|
This makes it clearer what the directory contains.
Change-Id: I34fc38dd30b8e0f6e057052ea33c8b5a10f1b9c3
Reviewed-on: https://pdfium-review.googlesource.com/8791
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This method deletes the current text selection in a form text field or
user-editable form combobox text field. If there is no selection, this
method does nothing.
BUG=chromium:59266
Change-Id: I3229ffad990c62beac1cf769cd366458b9ee5daa
Reviewed-on: https://pdfium-review.googlesource.com/8370
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Diana Gage <drgage@google.com>
|
|
This makes various IsFooKeyDown() methods static.
Transitively apply that to callers too.
Change-Id: Ia43b1fd62889c1943e0d8407e9696225b05125a8
Reviewed-on: https://pdfium-review.googlesource.com/7190
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL changes SetSel() and GetSel() to SetSelection() and GetSelection()
in CFX_Edit and CPWL_EditCtrl, and SetEditSel() and GetEditSel() to
SetEditSelection() and GetEditSelection() in CPWL_ComboBox.
Change-Id: Idd984932bda139a04e99193e519756980b7d4397
Reviewed-on: https://pdfium-review.googlesource.com/8610
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This is another case where JS may lead to destruction of
an object far away from where we are holding it.
Bug: 737023
Change-Id: I994d5425184b8c00b5cfaeb95dbb5032a6e09edb
Reviewed-on: https://pdfium-review.googlesource.com/8350
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This CL moves the remaining appearance stream code to CPWL_AppStream.
The unused GetThisAppearanceStream methods have been removed.
Change-Id: I0bdfbb11962ee7975394a40a1ea45d076ee9151d
Reviewed-on: https://pdfium-review.googlesource.com/8312
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL moves fpdfsdk/pdfwindow/cpwl_color to core/fxge/cfx_color.
Change-Id: Ia95b7fba2c76a1b9a438014d3598c7aa55bbb2ab
Reviewed-on: https://pdfium-review.googlesource.com/7753
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the custom InflateRect and Deflate rect code in CPWL_Utils in
favour of calling the CFX_FloatRect version. This required inlining some extra
code at each callsite to check the rect size and normalize.
Change-Id: I7f60e5de03fc1db0c1d8e51eaa1d0e0700ebf157
Reviewed-on: https://pdfium-review.googlesource.com/7710
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Cleanup nits in CFFL_FormFiller. Split CFFL_Button into own files.
Change-Id: I41fa7118a46aa1f495c15f90a4c4b77b309a10d3
Reviewed-on: https://pdfium-review.googlesource.com/7339
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The parameter is a CPWL_Wnd* but the only caller passes in a CPWL_Edit*,
so change it to CPWL_Edit* and remove the type checks / casting.
Change-Id: Ic2c85427bea5bf3d257b63c1e2ce9db5bee22136
Reviewed-on: https://pdfium-review.googlesource.com/7430
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the in-out params from OnBeforeKeyStroke and instead
returns a std::pair<bool, bool>.
Change-Id: I246cf51652da7e05ea71f582b523aa428cbbd3b8
Reviewed-on: https://pdfium-review.googlesource.com/7337
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the in-out param from OnButtonUp in favour of a single
bool return.
Change-Id: I2d91466677adcb366ed1c2d0721ce5e2949ed074
Reviewed-on: https://pdfium-review.googlesource.com/7333
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the bExit param from OnPopup{Pre|Post}Open in favour of
using a return value.
Change-Id: Icc99b137455343482fc1f60947c3b1f4246aeda1
Reviewed-on: https://pdfium-review.googlesource.com/7332
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes some in-out params which are always initialized with the
same value and we only case if either is true afterwards.
Change-Id: If164b1b50963958b931fb64d0f62f9170b27475b
Reviewed-on: https://pdfium-review.googlesource.com/7330
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the bExit and bReset in-out params from
CFFL_InteractiveFormFiller and switches to using returns.
Change-Id: I1617afa3598c02fe56ef02adfb0b1443b5fd0e4a
Reviewed-on: https://pdfium-review.googlesource.com/7311
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Also just call CFX_FloatRect() instead of explicitly writing out all
zeros.
Change-Id: I7574e64791d0c9ba613b14d0a613737dfbf39b12
Reviewed-on: https://pdfium-review.googlesource.com/7172
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Ib7062d46c74d1e2fcfa3699a9db50bc3c930b674
Reviewed-on: https://pdfium-review.googlesource.com/7192
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
CFX_Matrix::GetInverse is much clearer.
Change-Id: Id10ab1723735332e1a78de853f28415ec3a4d834
Reviewed-on: https://pdfium-review.googlesource.com/7090
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Same for CFFL_InteractiveFormFiller.
Fix other nits in both classes and in related code.
Change-Id: I9901c48794358889cc20638455ffd7fcb3344574
Reviewed-on: https://pdfium-review.googlesource.com/6652
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@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>
|
|
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>
|
|
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: I4c8ce920a4802b5b2ce3dc684cef271fc185feb0
Reviewed-on: https://pdfium-review.googlesource.com/6554
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I7ed0ba0acbbee291e285555974ebf50c0073668f
Reviewed-on: https://pdfium-review.googlesource.com/6250
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|