Age | Commit message (Collapse) | Author |
|
I don't think this is valid anymore, removing TODO.
Change-Id: I69cfbf499fe9f259f664d30be850604a246ed6dd
Reviewed-on: https://pdfium-review.googlesource.com/14531
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL adds two mouse selection tests for CFWL_Edit. In order to do so
the needed selection code was added to the XFA widget handler and
plumbed down to the CFWL_Edit field as needed.
Bug: pdfium:840
Change-Id: Ia3b5f5d191494a4579c01524df8fb35b24cc0085
Reviewed-on: https://pdfium-review.googlesource.com/14530
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes the Text Edit Engine code to use a count instead of an
end index for the selection range. Using count lets us differentiate a
selection at the beginning of 1 character and an empty selection.
A few new tests were added to test unicode word break behaviour, some are not
working yet and are commented out.
Change-Id: Icce8f5003102ef0a850151ccdf16d3c2226d94bf
Reviewed-on: https://pdfium-review.googlesource.com/13491
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: 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>
|
|
Change-Id: I51fb7b9df8bdb557e9dca6d1be91736fe124e16a
Reviewed-on: https://pdfium-review.googlesource.com/13630
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: I2a750c8e46b68dc4870e2dadd2ed3429008e1562
Reviewed-on: https://pdfium-review.googlesource.com/13551
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: I0be113b5515a95829566938c84e2f74c7c1c75a3
Reviewed-on: https://pdfium-review.googlesource.com/13552
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL implements the needed logic in CFDE_TextEditEngine to handle
word selection.
Change-Id: I6b388c23655037fec107d68ec07d33638b959374
Reviewed-on: https://pdfium-review.googlesource.com/13211
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
isDevice is currently false in tests and fuzzers and true in real
usage. This CL changes it all to true.
Change-Id: Idea14795d7f0bb70031e04e5c58e248de72fd39e
Reviewed-on: https://pdfium-review.googlesource.com/13130
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the fx_basic.h header and fixes up includes as needed.
Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040
Reviewed-on: https://pdfium-review.googlesource.com/12670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL rebuilds the text edit engine in a simpler fashion. Instead of
depending on multiple pages, paragraphs and buffer fields there is a
single text edit engine which contains a gap buffer.
This makes the code easier to understand and follow.
Change-Id: I10fe85603fa9ed15a647eaac2d931f113cd0c7b0
Reviewed-on: https://pdfium-review.googlesource.com/11990
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
CFX_Point and CFX_PointF are derived from CFX_PTemplate.
Add a helper function to replace the rarely used method where its used.
Change-Id: I28448d44bbae9aa6773d1ad5fd7daf342b67c84c
Reviewed-on: https://pdfium-review.googlesource.com/12071
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL updates the text edit engine to load and unload the page
directly instead of calling through the edit widget.
Change-Id: I636c8e8b0e635968222430098d3d268c75224b42
Reviewed-on: https://pdfium-review.googlesource.com/11590
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@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 CL converts the return value to be an enum class and updates the
usages to use the names instead of values.
Change-Id: I8b6927551679ac4103775a04187daad2e0d6c569
Reviewed-on: https://pdfium-review.googlesource.com/11512
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: 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>
|
|
This CL cleans up formatting and simplifies logic in CFDE_TextOut.
Change-Id: Ib675a35da79df77854f51e86bf24e5dc90b33b06
Reviewed-on: https://pdfium-review.googlesource.com/11334
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Idc9dfcafe6727c1689443ce8f9568567e55d51c8
Reviewed-on: https://pdfium-review.googlesource.com/11114
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Constify parameters as well.
Change-Id: I7e87b11cc73b133b04d49ceed1c46f5afcb89d1a
Reviewed-on: https://pdfium-review.googlesource.com/11111
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL removes a bunch of redundant members from the text edit engine.
The change information tracking was removed as most of it was unused or
was used inconsistently.
Change-Id: I92460594e46accff0b78e1183c8574fc83ce728a
Reviewed-on: https://pdfium-review.googlesource.com/11275
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes caret movement into an enum class and removes the
MoveNone flag.
Change-Id: I8a01b057942d45ceae9a6c3b95cfe3b8dc9ce9a5
Reviewed-on: https://pdfium-review.googlesource.com/11274
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up CFDE_TxtEdtEngine::{Insert|Delete} to cleanup return
values, input params and other unused bits.
Change-Id: I53c4475ce3dc6518058bc130e9710842df841032
Reviewed-on: https://pdfium-review.googlesource.com/11273
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL fixes the visibility of some methods in xfa/fde along with
removing unused methods. Unused params are also removed.
Change-Id: Ic6e6d2ac8d07dc4bdabb3e0121831e4bf3fbb8ec
Reviewed-on: https://pdfium-review.googlesource.com/11271
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Remove friendship.
De-virtualize.
Nest enum inside class.
Make copy-assignable and pass by const ref.
Make pack better on 64-bits.
Change-Id: I1ae3b6d03756fa5780e9023795db6648e8b8299a
Reviewed-on: https://pdfium-review.googlesource.com/11290
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This CL moves several methods from the CFDE_TxtEdt* classes from the
.cpp to .h files. As well, the GetCaretRect method is updated to return
the rect instead of using an out param.
Change-Id: I1288701f47d9ac1c413fbf06627f20b295b18b86
Reviewed-on: https://pdfium-review.googlesource.com/11270
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
The three CFDE_TxtEdtEngine layout methods are always called in
sequence. Update to only have a single Layout() method. Simplify the
layout code to use existing helpers.
Change-Id: I0f4d9714f231ca3cebf43579d215d97bd2fe525a
Reviewed-on: https://pdfium-review.googlesource.com/11231
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This class is actually an accidentally renamed interface. There is only
one concrete class so fold the interface back into the concrete class.
Change-Id: If921a34595fad85750389f071ffdc9a5eae09f8e
Reviewed-on: https://pdfium-review.googlesource.com/11150
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the implementation of the records which handle undo/redo
in the text edit engine into an anonymous namespace in the engine.
Change-Id: I299b9738b72e3eccbbec972fd3ea956c491859fa
Reviewed-on: https://pdfium-review.googlesource.com/11010
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the default params from methods in xfa/fde.
Change-Id: Ide93a51430c62753656b9e9c0bcd842d8179aa3c
Reviewed-on: https://pdfium-review.googlesource.com/10952
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes CFDE_RenderDevice. For most of the proxy'd calls we call
the CFX_RenderDevice directly now. To set the clip rect an overload was
added to accept a CFX_RectF and handle the casting to FX_RECT. The one
needed method, DrawString, is move to a static on CFDE_TextOut.
Change-Id: I95ea7e1fa1fd4702074b797c06423c9c9cb51db9
Reviewed-on: https://pdfium-review.googlesource.com/10951
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes CFDE_RenderContext and moves the ::Render method to be
::RenderText on the CFWL_Edit class which was the only caller.
Change-Id: Ic940a3f0d10cfce169f5e491de90803fc8a7940d
Reviewed-on: https://pdfium-review.googlesource.com/10950
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL starts cleaning up the visual set iterator code.
Change-Id: I643dc9edeeb0c7ff06ccd34a1977f811675413d8
Reviewed-on: https://pdfium-review.googlesource.com/10615
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up more defines and shuffles some fde code around to
better locations.
Change-Id: I6af0e991d9fa489ca45d1d0f9d041657beef3b7e
Reviewed-on: https://pdfium-review.googlesource.com/10613
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL replaceds FDE_TTOSTYLE defines with a FDE_TextStyle struct which
is used to set the needed flags. The FDE_TTOALIGNMENT defines are
replaced with an enum class and unused members have been removed.
Change-Id: Ib0e2818a82e7f1961de57f8d15703477f8235a03
Reviewed-on: https://pdfium-review.googlesource.com/10530
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the unused FDE_TTOSTYLE_ flags and their supporting
code.
Change-Id: Ib5ff1af77ceab5a526a845c1fc316a3742ab810a
Reviewed-on: https://pdfium-review.googlesource.com/10455
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@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>
|
|
There currently exists a weird split where some files exist in xfa/fxfa
and some files exist in xfa/fxfa/app. This CL removes the app/ folder
and moves all files up to the parent directory.
Change-Id: I00c87851a1ebc5a7a636eb9a17b58ba3f1708a84
Reviewed-on: https://pdfium-review.googlesource.com/8810
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves GetPDFWordString to be a method on CFX_Edit. The
FX_EDIT_ISLATINWORD define is moved into fx_edit.h.
CFWL_Edit::FX_EDIT_ISLATINWORD is renamed to FxEditIsLatinWord to make
less confusing with the define.
Change-Id: I47d12d41447b268894a1d0376ac4b2bdb409e2df
Reviewed-on: https://pdfium-review.googlesource.com/8531
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Since there is no guarantee of termination if the StringC was
extracted from a snippet of another string. Make it more obvious
that things like
strlen(str.unterminated_c_str())
might be a bad idea.
Change-Id: I7832248ed89ebbddf5c0bcd402aac7d40ec2adc2
Reviewed-on: https://pdfium-review.googlesource.com/8170
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
These files were originally renamed thinking they'd move with the
colour class up to core/. It was decided that CPWL_Color was a better
core colour class the the xfa colour so these are being renamed back to
XFA based names to make it clear where they live.
Change-Id: Ie89f2306be0609add29bd445e719567e7b439211
Reviewed-on: https://pdfium-review.googlesource.com/7754
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL renames CFX_Color to CXFA_Color. The class has some XFA specific
things like shadings and patterns in it and doesn't make sense as the
colour base class.
Change-Id: I1d2230b9f03a1017777ce673419926429b769e7c
Reviewed-on: https://pdfium-review.googlesource.com/7752
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
- Simplify if (cond) return true; return false; pattern.
- Use size_t in CXFA_FFDocView::RunCalculateRecursive().
Change-Id: I1c426556bc927a118cb062999812ab06bbfcfec7
Reviewed-on: https://pdfium-review.googlesource.com/7130
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@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>
|
|
Change-Id: I96c3429dbe2c572ed409706adfe3707b8b9bf51b
Reviewed-on: https://pdfium-review.googlesource.com/6176
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL splits the remaining files in xfa/fxfa/app into individual files
named after the classes.
Change-Id: I84bd8938937641bb6897614ed15558a2682f456c
Reviewed-on: https://pdfium-review.googlesource.com/6010
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Sed + minimal conversions to compile, including moving some
constructors into the .cpp file. Any that caused ASAN issues
during the tests were omitted rather than trying to resolve
the underlying issue.
Change-Id: I00a421f33b253eb4071ffd9af3f2922c7443b335
Reviewed-on: https://pdfium-review.googlesource.com/5891
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
So remove it.
But they probably wanted it to be true in one place, because
it looks like a leak. So find a better way to own the object.
Change-Id: I15937e29da5ce8b380f82cb20ee3ecc3f49b8ca3
Reviewed-on: https://pdfium-review.googlesource.com/5473
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
There are places where an object "child" has a raw pointer
back to object "owner" with the understanding that owner will
always outlive child.
Violating this constraint can lead to use after free, but this
requires finding two paths: one that frees the objects in the
wrong order, and one that uses the object after the free. The
purpose of this patch is to detect the constraint violation
even when the second path is not hit.
We create a template that is used in place of TYPE*. It's dtor,
when a memory tool is present, goes out and probes the first
byte of the object to which it points. Used in "child", this
allows the memory tool to prove that the "owner" is still alive
at the time the child is destroyed, and hence the constraint is
never violated.
Change-Id: I2a6d696d51dda4a79ee2f00a6752965e058a6417
Reviewed-on: https://pdfium-review.googlesource.com/5475
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This Cl renames the CFX_RenderDevice subclasses to make their usage
clearer.
Change-Id: Ie820b57df9a3743ce8c6893fb483b398a1f1bdbe
Reviewed-on: https://pdfium-review.googlesource.com/5390
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Remove more IFX_Pause parameters which are not used.
Change-Id: I9d10bb6b28d6d4d94ec3c4241b1c5a8a0709264c
Reviewed-on: https://pdfium-review.googlesource.com/4875
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|