summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-06-09Fix types for FT_ULong chars in fpdfedittextchromium/3128chromium/3127Nicolas Pena
FXFT_Get_First(Next)_Char can return large unsigned values. This CL avoids integer overflow and adds some missing checks regarding the ranges of the values returned by those methods. Bug: chromium:727086 Change-Id: Ice7bbb3759e384b7174680a82a2a9380c3611382 Reviewed-on: https://pdfium-review.googlesource.com/6436 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-06-09Converting CFX_ByteTextBuf to ostringstream in fdpf_parser_decode.cpp.chromium/3126Henrique Nakashima
Bug: pdfium:731 Change-Id: I20c3d87dba91d1489794abb77afcd2d7e9db88fe Reviewed-on: https://pdfium-review.googlesource.com/6393 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-09Minor changes/addons for annotation APIsJane Liu
As per Lei's comments while looking back at annotation API CLs to attempt to fix Bug 747. Bug=pdfium:737 Change-Id: I96369bf8dcc7afdf49e9a137e7bcba4ff1aeef67 Reviewed-on: https://pdfium-review.googlesource.com/6431 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-06-09Simplify CPDF_Array::RemoveAt(index, size).Lei Zhang
Instead of one general RemoveAt() method, split it into: - RemoveAt(index) - Truncate(nNewSize) - Clear() Update callers, which are now easier to understand. Update existing unit tests and add new tests. Change-Id: I38fe40146ce8f2479677b2caadd20a1756678768 Reviewed-on: https://pdfium-review.googlesource.com/6417 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-06-09Revert "Revert "Adding constructor of CFX_ByteString that takes a ↵Henrique Nakashima
std::ostringstream."" This reverts commit 53827cbbfebae66dd31f7aa30d3ee5c88716897a. Reason for revert: Rollforward of original CL - test failures were flakes. Original change's description: > Revert "Adding constructor of CFX_ByteString that takes a std::ostringstream." > > This reverts commit 4633d52736c4b926eceb1e18c4b379ff57fd31fa. > > Reason for revert: windows_xfa_clang broke? > > Original change's description: > > Adding constructor of CFX_ByteString that takes a std::ostringstream. > > > > Bug: pdfium:731 > > Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a > > Reviewed-on: https://pdfium-review.googlesource.com/6394 > > Reviewed-by: dsinclair <dsinclair@chromium.org> > > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> > > TBR=dsinclair@chromium.org,hnakashima@chromium.org > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: pdfium:731 > > Change-Id: I674aa1be12d6777c4d565d3131910ac5a11d8dc0 > Reviewed-on: https://pdfium-review.googlesource.com/6395 > Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> TBR=dsinclair@chromium.org,pdfium-reviews@googlegroups.com,hnakashima@chromium.org No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:731 Change-Id: I4a31a1a6bdb128016183c1059f0bfe1fa559a89e Reviewed-on: https://pdfium-review.googlesource.com/6434 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-06-09Disable a new flaky testJane Liu
Bug=pdfium:747 Change-Id: I51656750e5e5e7f7cecefc5244a66333a0213f19 Reviewed-on: https://pdfium-review.googlesource.com/6433 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-06-08Revert "Adding constructor of CFX_ByteString that takes a std::ostringstream."Henrique Nakashima
This reverts commit 4633d52736c4b926eceb1e18c4b379ff57fd31fa. Reason for revert: windows_xfa_clang broke? Original change's description: > Adding constructor of CFX_ByteString that takes a std::ostringstream. > > Bug: pdfium:731 > Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a > Reviewed-on: https://pdfium-review.googlesource.com/6394 > Reviewed-by: dsinclair <dsinclair@chromium.org> > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> TBR=dsinclair@chromium.org,hnakashima@chromium.org No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:731 Change-Id: I674aa1be12d6777c4d565d3131910ac5a11d8dc0 Reviewed-on: https://pdfium-review.googlesource.com/6395 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-06-08Adding constructor of CFX_ByteString that takes a std::ostringstream.Henrique Nakashima
Bug: pdfium:731 Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a Reviewed-on: https://pdfium-review.googlesource.com/6394 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-06-08Guard against undefined shifting in JPX decoderDan Sinclair
If the prec value in syncc444_to_rgb is more then 30 then when we shift left we'll go negative. The subsequent -1 will cause an overflow. This CL early returns if the prec value is > 30. Bug: chromium:728321 Change-Id: I4d25e9bab840bc6d46f8db3490c9484392cd7a32 Reviewed-on: https://pdfium-review.googlesource.com/6414 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-08Replacing CFX_ByteTextBuf with stringstream in cpdf_streamparser.cpp.Henrique Nakashima
Loaded PDF Reference 1-7.pdf 10 times to test performance, no apparent changes. All measurements between 62s and 65s in all cases. Bug: pdfium:731 Change-Id: I0a39bae45fc19a6bae0c634c5c8ef1d952ded26a Reviewed-on: https://pdfium-review.googlesource.com/6390 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-06-08Fixing click area for links with a URL with prepended text.chromium/3125Henrique Nakashima
Bug: pdfium:655 Change-Id: Idd90be487d390f066a76140800096feead6b9e55 Reviewed-on: https://pdfium-review.googlesource.com/6310 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-06-08CFGAS_FormatString use helper to convert char to intDan Sinclair
This CL updates CFGAS_FormatString to use the FXSYS_DecimalCharToInt helper instead of doing the conversion itself. Change-Id: Ia5b0f0c008a815b4cf25e59281357285005a7ab0 Reviewed-on: https://pdfium-review.googlesource.com/6412 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-06-08Add CFGAS_FormatString Number to String helperDan Sinclair
This CL adds a small helper to convert a number to a string with a given number of leading digits. Change-Id: I689c0d1ab9d35341f923ac7b72ed5a96bce6b868 Reviewed-on: https://pdfium-review.googlesource.com/6411 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-08Combine more CFGAS_FormatString codeDan Sinclair
This CL continues combining CFGAS_FormatString code chunks which are very similar. Change-Id: Ie2d41ce4c9cc82716daafbe346d0e71ba971f2bc Reviewed-on: https://pdfium-review.googlesource.com/6410 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-07Remove use of FXBSTR_ID from CFGAS_FormatStringchromium/3124Dan Sinclair
This CL removes the use of FXBSTR_ID and uses CFX_WideString comparisons instead. This makes the code a bit clearer as to what is being compared. Change-Id: I933bd1d7c98800ac80849d6f4d3179dd342f6270 Reviewed-on: https://pdfium-review.googlesource.com/6371 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-07Simplify some CFGAS_FormatString methodsDan Sinclair
This CL combines the similar format strings together and checks for the ' 's conditionally where needed. Change-Id: I46b2227c9d76ba66c8526c6597684e4b47301bde Reviewed-on: https://pdfium-review.googlesource.com/6370 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-07Fix some CFGAS_FormatString issuesDan Sinclair
This CL fixes the solar days calculation for months after August. Simplifies the minute rounding method. Change-Id: I5f335338ecac911ef0ab57602f41bb98c6f9fa6c Reviewed-on: https://pdfium-review.googlesource.com/6331 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-06-07Fixing FPDFPage_TransformAnnotsJane Liu
Came across this error in FPDFPage_TransformAnnots, where SetNewAt() would fail on a bound assertion when a newly created array calls it. This CL contains a fix in the function and adds an embedder test for this. Bug=pdfium:745 Change-Id: I569f225598d956d270ef8f11ee3225acf48aadc7 Reviewed-on: https://pdfium-review.googlesource.com/6353 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-06-07Basic APIs and tests for creating annotationsJane Liu
1. Added API for adding annotations and modifying common annotation properties * Added three embedder tests covering all of the API functions. Bug=pdfium:737 Change-Id: I369d9e17f589f896f9e8c672382f082e524ae534 Reviewed-on: https://pdfium-review.googlesource.com/6351 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-07Even more CFGAS_FormatString tests.Dan Sinclair
Change-Id: Ied2a169a3e7e9b178d746b04c67286d7a51fa635 Reviewed-on: https://pdfium-review.googlesource.com/6330 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-06-07Fix EmptyCreation testNicolas Pena
The Contents stream of a page is optional per PDF spec 1.7 Table 3.27. This CL fixes the empty creation test to acknowledge that. Change-Id: I1e59a1fedbf00eafabe87962830d62d8883a5e1f Reviewed-on: https://pdfium-review.googlesource.com/6311 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-06-06Convert CFGAS_FormatString to pointer out parameterschromium/3123Dan Sinclair
This CL changes all CFGAS_FormatString methods to use pointer out paramters instead of reference out parameters. Change-Id: Ic5b57f30e4be09233898b8f4e06f908a96afedc8 Reviewed-on: https://pdfium-review.googlesource.com/6272 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-06-06More CFGAS_FormatString testsDan Sinclair
This CL adds tests for the numeric, text, null and zero parsing and formatting methods. Change-Id: I0a35de105fd631598a7885c4bbbd1c2abbbd4260 Reviewed-on: https://pdfium-review.googlesource.com/6271 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-06Add more CFGAS_FormatString tests.Dan Sinclair
This CL adds some more time tests for CFGAS_FormatString. Change-Id: Ida7d9e665f304b984508ff3b404e7ea9c38ef415 Reviewed-on: https://pdfium-review.googlesource.com/6270 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-05Add missing static asserts for line cap and line join values.chromium/3122chromium/3121wileyrya
Change-Id: Idd04530986a78370459c4361197a5500ae5347f3 Reviewed-on: https://pdfium-review.googlesource.com/6210 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-05More CFGAS_FormatString testsDan Sinclair
This CL adds more tests for various CFGAS_FormatString methods. A few bugs are fixed up along the way. Change-Id: Ida1f2792d1bd72f4f52b3c7cc1ff0022b6f45fda Reviewed-on: https://pdfium-review.googlesource.com/6179 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-05Add start of CFGAS_FormatString testsDan Sinclair
This CL adds tests for the date parsing and formatting code in CFGAS_FormatString. Change-Id: I9989cdd1b3f92c90d46ee2c3f7838fe1de255be2 Reviewed-on: https://pdfium-review.googlesource.com/6178 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-05Cleaning up some XFA locale related codeDan Sinclair
This CL removes some unused locale related code and formats other bits. Change-Id: I172fc16a634a8982c00bfaf84fdcd4cd277eb36d Reviewed-on: https://pdfium-review.googlesource.com/6077 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-03Add a basic embedder test for CPWL_Edit.Lei Zhang
Change-Id: Ib381423b81e718410cb1d199aadbf396ee08b29a Reviewed-on: https://pdfium-review.googlesource.com/6251 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-02Rename PWL_FooBar files to cpwl_foo_bar.Lei Zhang
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>
2017-06-02Remove unused bits from PWL_Edit headers.chromium/3120Lei Zhang
Change-Id: Ic2e1639ab003f0a4981be0c61714ca9cd0b04c5f Reviewed-on: https://pdfium-review.googlesource.com/6230 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-02Split timer classes out of PWL_Wnd.hLei Zhang
Rename CPWL_TimerHandler and simplify CPWL_Wnd. Change-Id: Ib3850570fc5afdc2fa30f47a5b8754fea3cbf3e6 Reviewed-on: https://pdfium-review.googlesource.com/6175 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-02Prevent OOB access in CXFA_FM2JSContext::IsIsoTimeFormat().Lei Zhang
Change-Id: I3fe0460f3a4cfd7d48ccfc79d0256fc83d7fbac8 Reviewed-on: https://pdfium-review.googlesource.com/6235 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-02Remove dead CPDFSDK_Annot code.chromium/3119Lei Zhang
Change-Id: Ied77912f0f657ebc8e36469365de230e552e4956 Reviewed-on: https://pdfium-review.googlesource.com/6233 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-02Clean up CFFL formfiller classes.Lei Zhang
- Consolidate assertions for m_pFormFillEnv. - Remove check for m_pFormFillEnv being NULL. - Pass in a CPDFSDK_Widget* instead of an Annot* and then casting. - Remove unused LoadPopupMenuString() method. Change-Id: Ic22e75c9e41eb54002be812945a3ee80debeca8b Reviewed-on: https://pdfium-review.googlesource.com/6232 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-02Remove unused parameter from CFFL_FormFiller::NewPDFWindow().Lei Zhang
Change-Id: I27164e023c622d5c0d9490aa2b09ac4e66dda0fb Reviewed-on: https://pdfium-review.googlesource.com/6231 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-02Remove explicit CFX_Matrix identity matrix instantiations.Lei Zhang
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>
2017-06-02Roll V8 to 539f7ab3.Lei Zhang
Just a routine roll. TBR=jochen@chromium.org Change-Id: Idecd349cf952b9fa381751eebde60a3bff3d103e Reviewed-on: https://pdfium-review.googlesource.com/6234 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-01Document bindings implementaionTom Sepez
Change-Id: Ic2690fa09f35284fcb96050e8d6ce16b724e45dc Reviewed-on: https://pdfium-review.googlesource.com/6212 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-06-01Basic APIs and tests for extracting annotationsJane Liu
1. Added API for extracting annotation properties: * Added testing flag "--annot" that outputs the annotation properties into a .txt file. * Added two embedder tests covering all the API functions. Bug=pdfium:737 Change-Id: I95943a9b2b3d5d431bc8a74a31b27b4f4b521026 Reviewed-on: https://pdfium-review.googlesource.com/6092 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-01Tag CFXJSE_HostObject sub-classes.Tom Sepez
CXFA_FM2JSContext and CXFA_Object both subclass CFXJSE_HostObject. When a CFXJSE_HostObject is obtained from an opaque pointer inside a V8 object internal slot, there is no way to distinguish one from the other. Bug: 728158 Change-Id: Iabc648e8b7226e2819d8795227442c3f6c61a793 Reviewed-on: https://pdfium-review.googlesource.com/6211 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-06-01Use unique_ptrs for codec contexts in ccodec_progressivedecoder.chromium/3118Tom Sepez
Change-Id: I4deaf8ca946c2dcb6842c5702b02eed1c22b1201 Reviewed-on: https://pdfium-review.googlesource.com/6191 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-06-01Move CCodec_GifModule state to CGifContextTom Sepez
Introduce a base CCodec_GifModule::Context class with a virtual destructor so holders of unique_ptr's to these can delete them without actually having any knowledge of the implementation details of the context. Bug: 728669 Change-Id: Ia50f94300924a1053c326984eac3b03f25f1b83c Reviewed-on: https://pdfium-review.googlesource.com/6190 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-06-01Simplify code in fpdfformfill.cpp.Lei Zhang
Change-Id: I934150415e5ba515fddd37dab6e028d016052ab8 Reviewed-on: https://pdfium-review.googlesource.com/6173 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-01Clarify IPWL_Filler_Notify::QueryWherePopup() parameters.Lei Zhang
Update implementation and caller, and clean up surrounding code. Change-Id: I40975f79a5d4f560d6a7ee0d327b2e97241d29bd Reviewed-on: https://pdfium-review.googlesource.com/6172 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-06-01Replace some repeated code with existing CFXJS_Engine::NewString() helper.Tom Sepez
In turn, fix type information for New*() return values. In turn, resolve some ambiguity in a ? operator expression. Change-Id: I45c31d81f815b11590b46dacc8060d8e489dde5c Reviewed-on: https://pdfium-review.googlesource.com/6131 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-01Remove unused Locale codeDan Sinclair
This CL removes unused code from CFGAS_FormatString and CXFA_LocaleValue. Change-Id: I87a996231b3ad3770508be362456c435034b229c Reviewed-on: https://pdfium-review.googlesource.com/6177 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-01Be less trusting of MaybeLocal<> return types from V8 To* methods.Tom Sepez
Calling ToLocalChecked() will crash otherwise. Bug: 707673 Change-Id: I66a5b36d8cf1710a725e30c2d14a195d08ef25a4 Reviewed-on: https://pdfium-review.googlesource.com/6130 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-06-01Missing one unowned_ptr in ccodec_progressivedecoder.hTom Sepez
Change-Id: Ief386ce0d3887cc2876ce4b430f657b7462e3277 Reviewed-on: https://pdfium-review.googlesource.com/6170 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-06-01Fix content generation to only generate dirty page objects.wileyrya
BUG=pdfium:717 R=dsinclair@chromium.org,thestig@chromium.org Change-Id: I7e0e6fd301d40f9b5341d40cf11167b7748af243 Reviewed-on: https://pdfium-review.googlesource.com/6071 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>