summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-07-24Basic APIs and tests for adding attachmentsJane Liu
1. Added APIs for adding attachments, setting attachment files, and modifying attachment dictionary entries. * Added two embedder tests covering all new APIs. Bug=pdfium:174 Change-Id: I65f43cd6ca4887b71f9f7bcee64a87ba6b7e2706 Reviewed-on: https://pdfium-review.googlesource.com/8671 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-24Remove unused m_iRef in CPDFXFA_PageTom Sepez
Refs now live in base class CFX_Retainable. Change-Id: I5ec3891af91f361c3d2090281efe76dc75c11a40 Reviewed-on: https://pdfium-review.googlesource.com/8670 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-07-24Rename FMLexer methods to be more descriptiveRyan Harrison
The existing methods had either very bare passive or in some cases misleading names, so this CL changes them active names that describe what they do. This also extracts the IsKeyword method into a helper function since it is actually static. BUG=pdfium:816 Change-Id: I47a113bc9ea8d88a77822a4441266ec56e6b4cbc Reviewed-on: https://pdfium-review.googlesource.com/8730 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-24Roll clang to 2bf5912.Lei Zhang
AKA roll clang 300839:308728. TBR=thakis@chromium.org Change-Id: I58769e193758d94560b509943d739e82b4e807ad Reviewed-on: https://pdfium-review.googlesource.com/8811 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-07-24Add FORM_DeleteSelectedText() and embedder tests.Diana Gage
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>
2017-07-24Observe Annot destruction in CPDFSDK_PageView::DeleteAnnotTom Sepez
Run test XFA-Only, since that's where the issue occurs, and the textual output is different for non-xfa. Fix a few lifetime issue in pdfium_test.cc unearthed by this test (doc must outlive pages now held in formfill info). Bug: 735912 Change-Id: Icc9e6a967c32ece67d897117896c973bb16a1515 Reviewed-on: https://pdfium-review.googlesource.com/8510 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-24Remove extracting characters from inputRyan Harrison
Throughout the lexer there is use of a pattern where a character is extracted from the location currently being pointed at in the input and tests are done on this value. This is uneeded, since normally the pointer isn't being modified while the character is stored, so the pointer can be dereferenced directly. This CL also cleans ups the implementation of string extraction from the input to be easier to read, since it did depend on the character being extracted to work. The IsFooCharacter methods are also changed to take in a character instead of a pointer, since they are only testing the character value not the pointer. BUG=pdfium:814 Change-Id: I8eda01e0af59ff1f6c6e97d6fb504856c7a08a24 Reviewed-on: https://pdfium-review.googlesource.com/8690 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-24Move xfa/fxfa/app to xfa/fxfachromium/3166Dan Sinclair
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>
2017-07-24Use named commands in CPWL_AppStream.Dan Sinclair
This Cl converts the individual letters to an enum named commands to make it easier to determine what each code chunk is doing. Change-Id: I1d23d17ea3ac9bf54b5ecfcc164ad921774d9197 Reviewed-on: https://pdfium-review.googlesource.com/8430 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-24Added CPDF_NameTree::AddValueAndName()Jane Liu
1. Added CPDF_NameTree::AddValueAndName() for inserting new name and values pairs into a nametree while following nametree order rules. This function will be used for the API for adding embedded files. * Added anonymous helper functions. * Added two unit tests. Bug=pdfium:174 Change-Id: Ic3e2f32f7147ef5c164cf5c2a28e0a652ffed74a Reviewed-on: https://pdfium-review.googlesource.com/8271 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-07-24Deprecated FPDF_RENDER_READER in favour of FPDF_RENDER_READYDan Sinclair
The use of Ready makes more sense then Reader for the constants. Rename and deprecate the old one. Bug: pdfium:830 Change-Id: I80b970f29a21068b41993c1880d81d406c3108e0 Reviewed-on: https://pdfium-review.googlesource.com/8790 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-24Remove fxedit place classes in pdfwindow/Dan Sinclair
This CL removes the fpdfsdk/fxedit folder and moves the code to fpdfsdk/pdfwindow which is the primary consumer. The classes were renamed from CFX_* to CPWL_*. Change-Id: I6c6178adccf978193bbb9685204657ebd3f438bb Reviewed-on: https://pdfium-review.googlesource.com/8552 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-24Remove fx_edit.hDan Sinclair
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>
2017-07-24Cleanup some visibility in fxet_list.hDan Sinclair
Change-Id: Ic183f9aaa4c2557d755d40c5cb753fb7d11904b9 Reviewed-on: https://pdfium-review.googlesource.com/8551 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-24Merge CFX_ListContainer into CFX_ListCtrlDan Sinclair
The CFX_ListContainer was only used in CFX_ListCtrl. This CL merges the two classes and moves simple get/set methods to the header file. Change-Id: Ie2a79ab74551aabd3b475f5d3a8a0bccbb39a851 Reviewed-on: https://pdfium-review.googlesource.com/8550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-07-22Simplify code in CPDFSDK_FormFillEnvironment.chromium/3165Lei Zhang
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>
2017-07-21Clean up pdfium_test.ccLei Zhang
- Move several blocks out of RenderPdf(). - Add an anonymous namespace. - Check fwrite() results. - Fix nits. Change-Id: Ief0ddd5e49455d68b92d40674294dc9134adf86c Reviewed-on: https://pdfium-review.googlesource.com/8650 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Jane Liu <janeliulwq@google.com> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-07-21Change Clear() to ClearSelection().Diana Gage
This CL renames Clear() in CPWL_EditCtrl, CPWL_ComboBox, and CFX_Edit to ClearSelection(), as this function's behavior is clearing text selection. Change-Id: Ia32f5347abc1960d7219684942df6a3fede9936c Reviewed-on: https://pdfium-review.googlesource.com/8611 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Diana Gage <drgage@google.com>
2017-07-21Clarify --build-dir help info in safetynet_measure.py.Lei Zhang
Change-Id: I35423437015ad9057ed862ab630c9a2f403a8e1f Reviewed-on: https://pdfium-review.googlesource.com/8710 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-07-21Fix nits from commit 67ccef7.chromium/3164Lei Zhang
Change-Id: I24b191ecfe8b65a7d0ddc4958dc117de9ed9ae83 Reviewed-on: https://pdfium-review.googlesource.com/8630 Reviewed-by: Jane Liu <janeliulwq@google.com> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-07-21Add safetynet_measure.py to measure pdfium performance.Henrique Nakashima
This is a script that measures the performance of pdfium when loading and rendering a single pdf file. Supported profilers for now are callgrind (default) and perfstat. It will be used by the compare script, which will compare measurements this script takes. Change-Id: I9c78ec879a7f4839e60f217d5dd8ee35b1e9a051 Reviewed-on: https://pdfium-review.googlesource.com/7354 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-07-21Change CFX_Edit::GetSelText() to CFX_Edit::GetSelectedText().Diana Gage
This CL renames the CFX_Edit::GetSelText() method so that it is more descriptive. Change-Id: I2086f7d036cd874aba1b7d7ec04d1cbb7e182d06 Reviewed-on: https://pdfium-review.googlesource.com/8612 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-07-21Change "Sel" abbreviation to "Selection".Diana Gage
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>
2017-07-20LibTIFF: remove a couple of patchesNicolas Pena
This CL removes two patches that correspond to non-security CF bugs. There are now only a few patches left: two patches to prevent overflow in _TIFFCheckRealloc (overflows here are dangerous as they can cause heap-buffer-overflows), one patch to prevent integer overflows which CF reported as a security issue, and one recent upstream patch (which would be removed in the next LibTIFF upgrade). Next steps: * Figure out how to reproduce the security issue from _TIFFCheckRealloc (samples from the bugs seem to just timeout on asan) and report bug upstream once it's confirmed that a change is needed. * Ditto integer overflow, except it was already reported upstream, so ping upstream once reproduction without the patch is possible again. Change-Id: I6f9096a6e69698d5ded6a59c4aca5e07b351e716 Reviewed-on: https://pdfium-review.googlesource.com/8532 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-07-20Add helper class to closed stream commandsDan Sinclair
This CL adds two helper class to CPWL_AppStream to make sure we correctly close stream commands. Change-Id: I017477b16951e3e32a19e6264e63c9927bea5618 Reviewed-on: https://pdfium-review.googlesource.com/8315 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-20Remove CLST_Rect and replace with CFX_FloatRect.Dan Sinclair
This CL removes the CLST_Rect and uses CFX_FloatRect directly. The constructor params for CLST_Rect were (left, top, right, bottom) and CFX_FloatRect (left, bottom, right, top) so the usages have been flipped. Change-Id: I78bb2927c4ff9d5ad6d28099dd08a5bdda7646b0 Reviewed-on: https://pdfium-review.googlesource.com/8432 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-20Convert CFX_ListItem to use CFX_FloatRectDan Sinclair
The CFX_ListItem never calls the Height() method so doesn't need to use CLST_Rect. This CL removes unused methods from CLST_Rect and CPVT_FloatRect. Change-Id: I82d4f07ec104345e9275ccd838e3c8eed1de7a50 Reviewed-on: https://pdfium-review.googlesource.com/8431 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-20Change length calculation in CFX_StringCTemplate constructorRyan Harrison
Originally this would only calculate the length of the passed in string if the passed in length was -1. This causes issues, since other negative values will be passed straight through and break the post-condition on the constructor of the length being non-negative. This leads to undefined and hard to debug behaviour later, in cases where the root cause is a mistake in calculating the proper length. The other related classes, CFX_WideString & CFX_ByteString, test for all negative length values and calculating the length when they occur. This CL changes the FooC versions to use this logic. This implicitly assumes the string is null terminated, so in the incase of an incorrect negative length and a non-null terminated string there will still be a crash, but it will now occur at construction time, instead of at some random later time. BUG=pdfium:827 Change-Id: I4d1fed746ada67c496d8e6ab10861b9332555023 Reviewed-on: https://pdfium-review.googlesource.com/8450 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-07-20Use enum for pdf object typeArtem Strygin
Replace uint8_t type to enum for ObjectType variables Change-Id: Ie33c8c9413c5082397a2c6fbf73e03f08b7d8658 Reviewed-on: https://pdfium-review.googlesource.com/8470 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-20Upgrade LibTIFF to 4.0.8Nicolas Pena
This CL upgrades LibTIFF, removing patch files that correspond to bugs that have been resolved in 4.0.8. Change-Id: Id99d2fc9b3f25993dcb60cf1558b73674eb725bf Reviewed-on: https://pdfium-review.googlesource.com/8490 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-07-20Make CPWL_Wnd classes be observable.Tom Sepez
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>
2017-07-20Cleanup CPWL_Icon AppStream generationDan Sinclair
This CL moves the AppSteam generation code for CPWL_Icon to a separate method. The CPWL_Image code is also folded directly into CPWL_Icon as it is the only subclass. Change-Id: I7936bac4af76e34d0f73d48ca00f5713c5f20095 Reviewed-on: https://pdfium-review.googlesource.com/8314 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-20Consolidate Appearance Stream code in CPWL_AppStream.Dan Sinclair
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>
2017-07-20Create helper method in CJBig2_HTRDProcNicolas Pena
This CL creates CJBig2_HTRDProc::decode_image to reduce duplicated code in the class. Change-Id: Ie348179c96ff534f95cba401c4b9bd46e1c4e6ac Reviewed-on: https://pdfium-review.googlesource.com/8410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-07-20Add FPDFAnnot_GetFormFieldAtPoint() and embedder tests.Diana Gage
Given a point on a page, this method returns the interactive form annotation whose rectangle contains that point. If there is no such annotation, nullptr is returned. FPDFPage_CloseAnnot() must be called after the annotation this method returns is no longer needed. The tests for this method use the returned annotation to check its interactive form annotation flags via FPDFAnnot_GetFormFieldFlags(). BUG=chromium:59266 Change-Id: I8728792bea5367c172e08fdb6bae83eafb70eb68 Reviewed-on: https://pdfium-review.googlesource.com/7970 Commit-Queue: Diana Gage <drgage@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-07-20Add FPDFAnnot_GetFormFieldFlags() and associated embedder tests.Diana Gage
Given an interactive form annotation, this method returns its annotation flags. The flags returned are dependent upon the "Ff" field, and are specific to interactive form annotations, such as FPDF_FORMFLAG_MULTILINE, FPDF_FORMFLAG_COMBO, FPDF_FORMFLAG_EDIT, and others. To test this method more thoroughly, text_form_multiple.pdf has been added, which is similar to text_form.pdf, but includes a read-only text field. BUG=chromium:59266 Change-Id: Ie66046de273f69a1be6f04a433351ebaa271f60c Reviewed-on: https://pdfium-review.googlesource.com/7851 Commit-Queue: Diana Gage <drgage@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-19Rename StringCs c_str() to unterminated_c_str().Tom Sepez
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>
2017-07-19fix continue skia cache flushCary Clark
copy and pasted code does not always work out for the best. This makes the code compile. R=dsinclair@chromium.org Bug:736695 Change-Id: I41474fef629813fd21a5f52e5c7954329b7b2a64 Reviewed-on: https://pdfium-review.googlesource.com/8330 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-19Remove unused GetThisAppearanceStreamDan Sinclair
This method is never called. Removed. Change-Id: Iff366d68b4865d195d50a6c37376e81a5a4408b2 Reviewed-on: https://pdfium-review.googlesource.com/8313 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-19Create CPWL_AppStream.Dan Sinclair
This CL creates a CPWL_AppStream and consolidates app stream generation code from CPDFSDK_Widget, CPDFSDK_BAAnnot and CPWL_Utils. The remaining app stream code from CPWL_Utils will be cleaned up in a future CL. Change-Id: I20cfdec09a351bd509241d2c667a182fba84b0c1 Reviewed-on: https://pdfium-review.googlesource.com/8310 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-07-19Use CFX_WideString in CPDF_NameTree functions to strip BOMchromium/3162Jane Liu
PDFium doesn't strip BOMs during parsing, but we should strip BOMs when retrieving parsed strings in CPDF_NameTree to ensure consistency and appropriate function behavior. See the bug for more info. As outlined in Bug=pdfium:593, the solution is to call GetUnicodeText() instead of GetString(). I added a GetUnicodeTextAt() function in CPDF_Array, which is symmetrical to GetUnicodeTextFor() in CPDF_Dictionary. I then changed the input variable types to CPDF_NameTree functions to be CFX_WideString instead of CFX_ByteString, and modified all the calls to them. I also added a unit test for nametree, which would fail prior to this change. Nametrees with non-unicode names are already tested by embedder tests. Bug=pdfium:820 Change-Id: Id69d7343632f83d1f5180348c0eea290f478183f Reviewed-on: https://pdfium-review.googlesource.com/8091 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-07-19Converting CFX_ByteTextBuf to ostringstream in SAX.Henrique Nakashima
Respin of https://pdfium-review.googlesource.com/c/6592 with fixes that avoid invalid reads. Bug: pdfium:731 Change-Id: I9395063505ba1a5c610e21b089ab8aa1a0a5b86f Reviewed-on: https://pdfium-review.googlesource.com/8290 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-07-19flush skia cache in progressive renderingCary Clark
If Skia has cached some drawing, flush it when progressive rendering at the same point in the pipeline as the non-progressive state. R=dsinclair@chromium.org Bug:736695 Change-Id: Ie24544a4be541ac8a5165dc064171772dd8893da Reviewed-on: https://pdfium-review.googlesource.com/8270 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-19Revert "Converting CFX_ByteTextBuf to ostringstream in SAX."Henrique Nakashima
This reverts commit 7ca47d55c9cbbec7e0a0b0beffffe348ae655086. Reason for revert: Caused pdfium:821 Original change's description: > Converting CFX_ByteTextBuf to ostringstream in SAX. > > Bug: pdfium:731 > Change-Id: Ic492e8900c4a69082ff9c2384006a4e6bfa3313e > Reviewed-on: https://pdfium-review.googlesource.com/6592 > Reviewed-by: Lei Zhang <thestig@chromium.org> > Reviewed-by: dsinclair <dsinclair@chromium.org> > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> TBR=thestig@chromium.org,dsinclair@chromium.org,hnakashima@chromium.org Bug: pdfium:731 Change-Id: Ic7390c3f53d67d6eecf7f669e329702daa16f339 Reviewed-on: https://pdfium-review.googlesource.com/8230 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-19Added testing flag --save-attachments that saves embedded attachmentsJane Liu
1. Added --save-attachments flag in pdfium_test to save embedded attachments using fpdf_attachment APIs. Bug=pdfium:174 Change-Id: I62f09aeb0ab1431f6e127da389518878a7214423 Reviewed-on: https://pdfium-review.googlesource.com/7990 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-19Removed public/ in includeJane Liu
Bug=pdfium:817 Change-Id: I97d1c306865aad78b7ed11c68cee30f968ab6a66 Reviewed-on: https://pdfium-review.googlesource.com/8051 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-19Basic APIs and tests for extracting attachmentsJane Liu
1. Added API for extracting attachment properties and data. * Expanded the embedder test to cover all the new APIs. Bug=pdfium:174 Change-Id: I09bffd412410e9aea45faca442d2b72eefafef4e Reviewed-on: https://pdfium-review.googlesource.com/7790 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-19Remove JBig2_GsidProc classNicolas Pena
This CL removes the JBig2_GsidProc since it is only used as a single instance in each of the methods in CJBig2_HTRDProc, so it is completely unnecessary. Change-Id: I69d0a4a059b9eb6ebcbbb79b92ea1cd6c22cb1cb Reviewed-on: https://pdfium-review.googlesource.com/7930 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-19Avoid unterminated string segment in cfx_saxreaderhandler.cppTom Sepez
Use the overloaded << operator, which takes length into account for StringC types, rather than a raw ptr (which gets promoted into a std::string resulting in a length call that overflows since StringCs aren't necessarily nul-terminated). Bug: 746073 Change-Id: Iffbbff53e12da8741acc7ce54000232cc66d83bc Reviewed-on: https://pdfium-review.googlesource.com/8150 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-19Prevent more crashes in wcsftime.Lei Zhang
BUG=chromium:738303 Change-Id: If36cdc0f53fc224c0c4c8cf775fd2c916f2d0add Reviewed-on: https://pdfium-review.googlesource.com/8210 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>