summaryrefslogtreecommitdiff
path: root/xfa
AgeCommit message (Collapse)Author
2018-04-25Fix behavior of Delete key in XFA edit.Henrique Nakashima
Delete had two issues: it acted as a backspace that did not move the caret; delete was considered a valid char to insert in the character buffer. Bug: chromium:820104 Change-Id: I869eedcbf369b9b1df79f16285d991b8e630cd05 Reviewed-on: https://pdfium-review.googlesource.com/31291 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-04-24Switch declaration order to prevent UAFRyan Harrison
This is occuring when the variables go out of scope, due to C++s first in, last out destruction policy. BUG=chromium:808333 Change-Id: I44f37520a22720bc23df4c8a72ff73994c37eea1 Reviewed-on: https://pdfium-review.googlesource.com/31278 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-24Fix edit text rendered with wrong offsets after deletion.Henrique Nakashima
Bug: chromium:835924 Change-Id: I3d6a3d1947cb1b8cda246cc74ef0b79a482b7997 Reviewed-on: https://pdfium-review.googlesource.com/31276 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-24Fix caret moving to next line on click in multiline XFA edit.Henrique Nakashima
On a mouse click after the end of a line (except for the last line) in an XFA text edit, the caret was moved to the beginning of the next line, as the position after the space was actually in the next line. This CL changes the behavior so that the caret is positioned before the space in this case. Note it's possible to click directly to that position by clicking on the beginning of the next line. Bug: chromium:832293 Change-Id: Ib376e4cca7b32a87d478d3346cb3d8f3bd825daa Reviewed-on: https://pdfium-review.googlesource.com/31110 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-23Revert "Change CFX_XML Save to take a write stream"dsinclair
This reverts commit 9a3a7709103a872037dcea1f3cf0b7785a3da191. Reason for revert: Gerrit did not do what I expected.... Original change's description: > Change CFX_XML Save to take a write stream > > This CL changes CFX_XML to use an IFX_SeekableWriteStream instead of the more > generic IFX_SeekableStream. > > Change-Id: I6e4def380c43eca755d91ad5cb6146c2dfdaee10 > Reviewed-on: https://pdfium-review.googlesource.com/30877 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: Tom Sepez <tsepez@chromium.org> TBR=tsepez@chromium.org,dsinclair@chromium.org,hnakashima@chromium.org Change-Id: I137e53bf93285b88ade6832dedefca66e3b61e13 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/31211 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-23Change CFX_XML Save to take a write streamDan Sinclair
This CL changes CFX_XML to use an IFX_SeekableWriteStream instead of the more generic IFX_SeekableStream. Change-Id: I6e4def380c43eca755d91ad5cb6146c2dfdaee10 Reviewed-on: https://pdfium-review.googlesource.com/30877 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-19Caret moves after clicked char if closer to its right rect boundary.chromium/3401Henrique Nakashima
Bug: chromium:832293 Change-Id: Idd240010a5ec99b836d9cb90c4c2aa3027ff5f67 Reviewed-on: https://pdfium-review.googlesource.com/31013 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-19Fix duplicated text in each line in XFA widgets.Henrique Nakashima
When calculating the characters to display, the run offset was not added to the offset inside the run, so characters from the first run were always used instead of from the run that the line should display. Bug: chromium:832909 Change-Id: I4d1d284894ce6ac9c7a49976aa6a6d0cf21f1382 Reviewed-on: https://pdfium-review.googlesource.com/30993 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-19Fix caret moving to start of edit on click after the text.Henrique Nakashima
It now moves to the end of the edit text instead. In a multiline edit, clicking after the end of a line in the middle of the text moves the caret to the beginning of the next line. This is a known issue to be addressed later. Bug: chromium:832293 Change-Id: I55ca1f7eebf935fbb7d9526f115489bdfbd8ba1c Reviewed-on: https://pdfium-review.googlesource.com/31012 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-04-19Add public APIs for undo / redo in forms.Lei Zhang
Add FORM_CanUndo(), FORM_CanRedo(), FORM_Undo(), and FORM_Redo(). BUG=chromium:764260 Change-Id: I1d9ea67152d9b35d9b8e1d7ef7d019706fdfa30a Reviewed-on: https://pdfium-review.googlesource.com/30872 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-19Fix caret not moving to click target in XFA edit.Henrique Nakashima
Bug: chromium:832293 Change-Id: Id7b90f7958e71350ecde31ef8891541eb4767ecf Reviewed-on: https://pdfium-review.googlesource.com/31010 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-04-18Do not show validation errors if PDF not yet loadedchromium/3400Ryan Harrison
This prevents display of confusing popups during the loading/initialization of the XFA document. The spec explicitly states that validation should be run at this point, but other viewers like Acrobat do not fire this spurious pop ups. BUG=pdfium:975 Change-Id: Ic00d8c767ae94f95c7455a58b77e0b7283e3307c Reviewed-on: https://pdfium-review.googlesource.com/30930 Commit-Queue: Lei Zhang <thestig@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-04-17XFA_XPDPacket_MergeRootNode is dead code, too.Tom Sepez
Change-Id: I8a842bbd770ce8ae740d4bad8fba00ce6a5801c9 Reviewed-on: https://pdfium-review.googlesource.com/30874 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-17Base64 stuff is all dead code in cxfa_ffdoc.cppTom Sepez
Change-Id: I6b0d46d913c55de592f10de5bd31a6520b16cd2f Reviewed-on: https://pdfium-review.googlesource.com/30873 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-17CFX_XML Cleanupdan sinclair
Cleanup formatting and unused variables in the CFX_XML classes. Change-Id: I1aff6317a3da38a141a071ba69c7893d0f669732 Reviewed-on: https://pdfium-review.googlesource.com/30730 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-17Add ownership to CFX_XMLNode childrendan sinclair
This CL sets the CFX_XML tree ownership. The pointers set into the tree must be unique_ptrs and the CFX_XMLNode children are set to be either unique_ptrs or UnownedPtrs. Change-Id: Ib0db495c81471e40f5b4533503f7bbe5a784fd77 Reviewed-on: https://pdfium-review.googlesource.com/30711 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-17Remove unimplemented CXFA_DataExporter private headerdan sinclair
The Export which takes a CFX_SeekableStreamProxy is never implemented. Removed. Change-Id: I130baeaf2bea7e5ebb0738330fa5de7152304367 Reviewed-on: https://pdfium-review.googlesource.com/30857 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-17Convert CFX_XMLParser to take a IFX_SeekableStreamdan sinclair
This CL changes the CFX_XMLParser to accept an IFX_SeekableStream intead of a CFX_SeekableStreamProxy. Change-Id: I3534288a8a00095acd78a60bf6b925c6a0357892 Reviewed-on: https://pdfium-review.googlesource.com/30856 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-17Remove unused CFX_SeekableStreamProxy From CFGAS_GEFontdan sinclair
The CFGAS_GEFont::LoadFontInternal which takesa a CFX_SeekableStreamProxy was never implemented. The stream member is never used. Change-Id: Ia9c5434c55f6ff2f709bb3ad49ecd9ee3fd3b122 Reviewed-on: https://pdfium-review.googlesource.com/30855 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-17Cleanup some seekablestreamproxy codedan sinclair
This CL fixes up some cfx_seekablestreamproxy includes and adds a helper to the xmlparser tests. Change-Id: If1b67dee51b49fa39527274f6c68da5ec673704f Reviewed-on: https://pdfium-review.googlesource.com/30854 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-17Remove write abilities from CFX_SeekableStreamProxydan sinclair
This CL removes the abliity to write to the seekable stream proxy class. Change-Id: I0eda2619714df190d326c23dfdcd4527d4312779 Reviewed-on: https://pdfium-review.googlesource.com/30853 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-17Use IFX_SeekableStream in xfa_utilsdan sinclair
This CL converts xfa_utils to use an IFX_SeekableStream instead of a CFX_SeekableStreamProxy. Change-Id: I824b477351ac29d54118df2f3c5442c503aa3671 Reviewed-on: https://pdfium-review.googlesource.com/30852 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-17Use an IFX_SeekableStream for XML savingdan sinclair
This CL converts the CFX_XML Save methods to take an IFX_SeekableStream instead of a CFX_SeekableStreamProxy. Change-Id: I6b3f6acc9f51e73b3c863b965b4dcdcbd25ba949 Reviewed-on: https://pdfium-review.googlesource.com/30850 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-17Use span in CXFA_LocaleValue::GetDoubleNum()chromium/3399Tom Sepez
Get runtime checks instead of just asserts. Use early return while at it to save some indentation. Fix one out-of-bounds case noted by inspection. Add tests, and fix bugs that gave the wrong answers. This should be removed at our earliest convenience. Its likely to still be wrong. Change-Id: I2a68edc854c8b28c434fe28397b7834e5c9c3670 Reviewed-on: https://pdfium-review.googlesource.com/30530 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-17Reland "Return pdfium::span<wchar_t> from WideString::GetBuffer().""Tom Sepez
This reverts commit 0d32b8fda53e02c1036d39f7290d4f59f2b58ca4. Restore behaviour on trunk. TBR: dsinclair@chromium.org Change-Id: Ia867f09ae9d2885595c4d9b300a058431dfd84f2 Reviewed-on: https://pdfium-review.googlesource.com/30811 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-17Implement FORM_GetFocusedText() API.Lei Zhang
If there is a focused form field, get its text. BUG=chromium:753216 Change-Id: I05294f14d05c1c86769055f6c9eaf9177787d9fd Reviewed-on: https://pdfium-review.googlesource.com/12072 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-16Merge CFX_XMLElement and CFX_XMLAttributeNodedan sinclair
CFX_XMLElement is the only subclass of CFX_XMLAttributeNode. This CL merges the two classes together. The {Set|Get}String method has been renamed to {Set|Get}Attribute to make it clearer what you're retrieving. Change-Id: I158c961d4d8c5f563d937a3e7a35321a33622562 Reviewed-on: https://pdfium-review.googlesource.com/30710 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-16Revert "Return pdfium::span<wchar_t> from WideString::GetBuffer()."Tom Sepez
This reverts commit 154e18f9a862975abecebe77b8f5fb418418d14c. Reason for revert: Generate CL to merge to beta branch Original change's description: > Return pdfium::span<wchar_t> from WideString::GetBuffer(). > > Adds bounds checking "for free", but beware of span outliving > a ReleaseBuffer() call. Scoping as such avoids the possibility > of using an invalid span (and it is flagged as a lifetime issue). > > Change-Id: Ica63f4b1429823d0254ec6951aeaeb08160cb93c > Reviewed-on: https://pdfium-review.googlesource.com/30310 > Reviewed-by: dsinclair <dsinclair@chromium.org> > Commit-Queue: Tom Sepez <tsepez@chromium.org> TBR=tsepez@chromium.org,dsinclair@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Ie1ec9434215584a024538ca8edeb59dea555af48 Reviewed-on: https://pdfium-review.googlesource.com/30830 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-16Split GetNumbericSymbol into individual methodsdan sinclair
This CL removes the GetNumbericSymbol method and adds individual methods for each symbol we retrieve. Change-Id: Id14108e5ea43a76250e18a1aa13bdbb05e928cdc Reviewed-on: https://pdfium-review.googlesource.com/30695 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-16Convert CXFA_XMLLocale to CFX_XMLdan sinclair
This CL converts CXFA_XMLLocale to use CFX_XML instead of CXML. Change-Id: I1db617a658548ae5979f2f38d72c5b3000998663 Reviewed-on: https://pdfium-review.googlesource.com/30693 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-16Add CXFA_XMLLocale unittestsdan sinclair
This CL adds unittests for the CXFA_XMLLocale class. Change-Id: I1a610754933e5f33e87cb4c13b9bf540e366e6ed Reviewed-on: https://pdfium-review.googlesource.com/30692 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-16Fix UAF in CFGAS_FontMgr::FindFontchromium/3398Ke Liu
Fix an use-after-free issue which was introduced by commit 53279b1dcabae4913f7f0a58e741942e82ab7d59. Bug: chromium:832589 Change-Id: Id7da791c3aa2d71d0a9e56d062069f41b7eb48d1 Reviewed-on: https://pdfium-review.googlesource.com/30570 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-04-13Hide XML parsing inside CXFA_XMLLocaledan sinclair
This CL moves the parsing of the XML document into a static method of CXFA_XMLLocale. This removes the need for CXFA_LocaleMgr to care about the XML parser used. Change-Id: I04d14d78f458bfb37f0370fac2eb752e9840bfd6 Reviewed-on: https://pdfium-review.googlesource.com/30390 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-13Move SharedForm check to CPDF_Metadata classdan sinclair
This CL moves code related to shared form detection into the CPDF_Metadata class. This allows us to hide the usage of CXML inside CPDF_Metadata. Change-Id: I547471a2bcc119221565c415a58211c1500cbb3c Reviewed-on: https://pdfium-review.googlesource.com/30370 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-13Make CFX_XMLInstruction a subclass of CFX_XMLNodedan sinclair
The CFX_XMLInstruction handles the <?blah?> blocks at the top of an XML file. It was inheriting from CFX_XMLAttributeNode in order to store the tag name. This CL moves the tag name into CFX_XMLInstruction and subclasses from CFX_XMLNode. Change-Id: I8f7ff0dde19ed43b46d095b0d45df4bf06875af5 Reviewed-on: https://pdfium-review.googlesource.com/30490 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-12Return pdfium::span<wchar_t> from WideString::GetBuffer().Tom Sepez
Adds bounds checking "for free", but beware of span outliving a ReleaseBuffer() call. Scoping as such avoids the possibility of using an invalid span (and it is flagged as a lifetime issue). Change-Id: Ica63f4b1429823d0254ec6951aeaeb08160cb93c Reviewed-on: https://pdfium-review.googlesource.com/30310 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-12Make CFX_Font take FX_RECT out params by pointer.Lei Zhang
Change-Id: I6643aaf66bf3e9d53d5afab5c99a5cb7deab3661 Reviewed-on: https://pdfium-review.googlesource.com/30054 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-12Remove CXFA_DocumentParser::m_bDocumentParser flagDan Sinclair
This CL removes the import data behaviour as it was never called and cleans up the m_bDocumentParser flag as it will always be used in the true case. Change-Id: If90a0a55cc76f406e9987aa71580e90edeaa01ba Reviewed-on: https://pdfium-review.googlesource.com/30292 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Remove CFX_XMLDoc and call the parser directlyDan Sinclair
This CL removes the CFX_XMLDoc and calls the CFX_XMLParser directly from CXFA_DocumentParser. Change-Id: I4d715cca90cd15b5e1d79827e0bb2781e873e371 Reviewed-on: https://pdfium-review.googlesource.com/30251 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Cleanup CXFA_FFDocDan Sinclair
This CL changes CXFA_FFDoc to no longer use the CXFA_FFApp to create the document, it does it directly. The stream data is not stored in the FFDoc anymore as it is only used once. Change-Id: I8247d2fb0324e554250ff0a03c67f067ef46e437 Reviewed-on: https://pdfium-review.googlesource.com/30270 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Rename CXFA_SimpleParser to CXFA_DocumentParserDan Sinclair
The CXFA_SimpleParser is handling the XFA document parsing. This CL renames the class to make it clearer that this is the XFA document parser. Change-Id: Ia290df2671fba9efa221ae997156ee4846749b02 Reviewed-on: https://pdfium-review.googlesource.com/30231 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Fold CXFA_DocumentParser into CXFA_FFDocDan Sinclair
The CXFA_DocumentParser is a thin wrapper around CXFA_SimpleParser. This CL folds CXFA_DocumentParser into a ParseDoc method of CXFA_FFDoc. Change-Id: I7e7073899436f0435c4ebfd548241ae842a2a276 Reviewed-on: https://pdfium-review.googlesource.com/30213 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Retrieve the XML tree in the DocumentParserDan Sinclair
This CL changes the document parser to store the parsed XML tree. That way we no longer need to store the pointer to the CXFA_SimpleParser in the CXFA_DocumentParser. Change-Id: I9272150e73613411cb1bb59c3cf77c7af6cc799d Reviewed-on: https://pdfium-review.googlesource.com/30211 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Allow retrieving the XML tree from the CFX_XMLDocDan Sinclair
This CL allows the CXFA_SimpleParser to retrieve the XML tree from the CFX_XMLDoc. This way, we don't have to keep the doc around and can store the pointer to the tree in the CXFA_SimpleParser. Change-Id: I5b478acbe61e6f1ca5fa04d03133a2b327a0cb1c Reviewed-on: https://pdfium-review.googlesource.com/30210 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Cleanup some CFX_XMLParser codeDan Sinclair
This CL cleans up minor nits in the CFX_XMLParser code. Change-Id: Ie19d12d3dcce16c9ce6088160ecdec3d9855c11f Reviewed-on: https://pdfium-review.googlesource.com/30170 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12[xfa] Remove form checksum abilitiesDan Sinclair
This CL removes the code for verifying and creating checksums associated with form elements in XFA documents. This was the only code requiring the SAXReader which has also been removed. According to the XFA spec and application can decide which parts of the signatures are supported. This feature is being removed until we determine if/when it is needed. Bug: pdfium:1063 Change-Id: Iec2261282340f8fc72a1225d2e0d3e6ddf05edcb Reviewed-on: https://pdfium-review.googlesource.com/30150 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-11Remove use of GetBuffer()/ReleaseBuffer() when c_str() is sufficient.Tom Sepez
Greatly simplify the code which was neither changing allocations nor doing any actual work. Eventually GetBuffer() will return a span, and this makes fewer places to change. Comment AsFPDFWideString() as a place where we may want a redundant copy, and make available outside the .cpp file. Fix one "const" along the way. Change-Id: I187758b69a0ba3501b3622f6c06280793cd5d464 Reviewed-on: https://pdfium-review.googlesource.com/30011 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-11Make cxfa_fmlexer.cpp resilient to null stringsTom Sepez
As currently written, the calculation of m_end will underflow when passed a {nullptr, 0} pair as input, and m_end becomes essentially unbounded. Change-Id: Id3249b201c446555d9aa4fa04e6a3c94a357cd99 Reviewed-on: https://pdfium-review.googlesource.com/30230 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-10Remove CFX_Rect.Lei Zhang
It is rarely used and FX_RECT is the more common integer rect type. Change-Id: I7c5b875321c2d587becedcd058bb3a57fd1f0b61 Reviewed-on: https://pdfium-review.googlesource.com/30053 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-10Change CFX_RenderDevice::FillRect() to take FX_RECT by const-ref.Lei Zhang
It currently takes const FX_RECT*, but the pointer is never nullptr. Change-Id: I571e9e8dd04756bc4daa25a61a5af8d1f902914b Reviewed-on: https://pdfium-review.googlesource.com/30052 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>