summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-08-23Convert the CFDE_TxtEdtEngine::Insert results into an enum classDan Sinclair
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>
2017-08-23Remove useless code.Artem Strygin
Change-Id: Ie1fa04cdcdd426cf76413e7e5fe714ba7922458c Reviewed-on: https://pdfium-review.googlesource.com/11713 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-23Unify CPDF_DataAvail::CheckEnd.Artem Strygin
Use read validator to check "startxref" availability. Change-Id: I258a707e4269fe768898d74db0955302b34ccf34 Reviewed-on: https://pdfium-review.googlesource.com/11711 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-23Unify CPDF_DataAvail::CheckHeader.Artem Strygin
Use read validator to check header availability. Change-Id: Ib482347cb2f112e27a6bcc4e8da865d0ecf1a630 Reviewed-on: https://pdfium-review.googlesource.com/11710 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-23Simplify Trailers usage in CPDF_Parser.Artem Strygin
Do not store non main trailers in memory. Improve readability. Change-Id: I2eab5d31a5be056871e7e5953e4b38662b91f5ae Reviewed-on: https://pdfium-review.googlesource.com/10750 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-23Verify image returned from AddImageDan Sinclair
The ::AddImage call can return a nullptr if there is no stream provided. This CL adds the missing null check on the returned object when lookikng at the image. Bug: chromium:756418, chromium:753700 Change-Id: I48032c0f421c8889827540ae91f404ef0f503bfe Reviewed-on: https://pdfium-review.googlesource.com/11532 Reviewed-by: Rebekah Potter <rbpotter@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-23Remove tools/generate_library_loader.Lei Zhang
This was pulled in via DEPS to make the Skia build work, but it no longer appears to be needed. Change-Id: Ib83aa56cd08f1a0abcc0388ce881ec35c41788be Reviewed-on: https://pdfium-review.googlesource.com/11333 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-22Bypass asserts in string [] operator for empty stringschromium/3194Ryan Harrison
The previous behaviour of [] on an empty string was to return 0 regardless of the index. We wanted to make this more strict, hence the current behaviour. This has led to a number of crashes due to code depending on the old behaviour. Reverting to the old behaviour until we have time to correct the call sites using empty strings. Bug=chromium:752480, pdfium:828 Change-Id: I511eea4148de85bf7f4694351e7a030b1a37f0de Reviewed-on: https://pdfium-review.googlesource.com/11630 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-22Corrected the error setting after calling FPDF_LoadDocument()Jane Liu
Currently, if FPDF_LoadDocument() is called on a nonexistent file, the returned FPDF_DOCUMENT will be null, but FPDF_GetLastError() will return an error of FPDF_ERR_SUCCESS, i.e. no error. This CL corrects this behavior by updating the error to be FPDF_ERR_FILE when the file doesn't exist. Bug=pdfium:452 Change-Id: I3c3ec3a64e049636ddfb2ba5cb5f2745a0e19b6b Reviewed-on: https://pdfium-review.googlesource.com/11650 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-08-22Add pdfium::Optional to third_party/baseRyan Harrison
It is intended to use this class instead of the std::pair<bool, Foo*> pattern that has been used for guarded pointer returns in PDFium. Change-Id: Id3e305d6cdb329c84e1d827c855423d3efae42c0 Reviewed-on: https://pdfium-review.googlesource.com/11610 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-22Simplifying state of CPDFSDK_PageView.Henrique Nakashima
Change-Id: Ic0849cce80e1797637fd875bdedd7cc560b98f22 Reviewed-on: https://pdfium-review.googlesource.com/11210 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-22Added FPDFAnnot_GetLinkedAnnot()Jane Liu
Added FPDFAnnot_GetLinkedAnnot() to retrieve annotations linked to other annotations through a specified key. Bug=pdfium:863,pdfium:737 Change-Id: If81f41178fb4c40f6561bd392215c709722c4000 Reviewed-on: https://pdfium-review.googlesource.com/11491 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-08-22Converted CFX_Matrix::TransformRect() to take in constsJane Liu
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>
2017-08-22Check length in CFX_Win32FontInfo::AddInstalledFontNicolas Pena
This CL is a tentative fix for the bug below. The last method in the stack trace is FontEnumProc, which calls AddInstalledFont. This problem was introduced by https://pdfium-review.googlesource.com/c/pdfium/+/10651 Bug: chromium:757388 Change-Id: If089a43367f1106a79276f6b09b6d0546b863e35 Reviewed-on: https://pdfium-review.googlesource.com/11611 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-08-22Prepare safetynet_job.py to have its output sent in emailsHenrique Nakashima
- Add --no-color option. - Fix exit code ambiguity (2 means bad usage) Change-Id: I04be9c3f21b5a71857b7847b3cc32bf595084994 Reviewed-on: https://pdfium-review.googlesource.com/11490 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-08-22Avoid an ASSERT failure in CFX_SeekableStreamProxy.Lei Zhang
BUG=chromium:718503 Change-Id: I6ff332c2ab5320d1b5f39a9aa1564e7e3e243cbe Reviewed-on: https://pdfium-review.googlesource.com/11570 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-21Unify cross ref item check.chromium/3193Artem Strygin
Change-Id: I7c68d0f5a668019d23bbeebc66373f9b245f91a2 Reviewed-on: https://pdfium-review.googlesource.com/9551 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-08-21Convert FDE_TXTEDIT_LINEEND to a private enum classDan Sinclair
This CL converts the enum to an enum class and updates the usage as needed. Change-Id: I7ba883e7d1debee00d3d9baafe941620109df8b8 Reviewed-on: https://pdfium-review.googlesource.com/11511 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-21Cleanup CFDE_TxtEdtBuf and simplify some logic.Dan Sinclair
This CL cleans up nits in CFDE_TxtEdtBuf and simplifies some of the methods. Change-Id: I2092da8e27281a577752fc331fec0612a349dfd6 Reviewed-on: https://pdfium-review.googlesource.com/11335 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-08-21Avoid annotation popups to be clipped at page edgesJane Liu
Currently, annotation popups are placed at a fixed location relative to the annotation. If an annotation is too much on the right or the bottom of the page, then its popup will be clipped at the edge of the page. This CL translates the popups appropriately to avoid getting clipped at page edges. Also, if an annotation is at the bottom-right corner of the page, then the popup is placed above and to the left of the annotation, instead of below and to the right of it. See a set of comparison screenshots here: https://drive.google.com/drive/folders/0B7Fvv7JszRyGZXZXR05yVEFWSlE?usp=sharing Bug=chromium:645367,pdfium:750 Change-Id: Ie048281e965523c292dcc704b51188d794f8877b Reviewed-on: https://pdfium-review.googlesource.com/11470 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-21Remove useless code.Artem Strygin
Change-Id: Idd656dcf372c0b8ed515a4e0635b5098c0781d76 Reviewed-on: https://pdfium-review.googlesource.com/10991 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-21Converted CFDE_TxtEdt{Buf|Engine}::Insert() to take CFX_WideStringJane Liu
Converted CFDE_TxtEdtBuf::Insert(), CFDE_TxtEdtEngine::Insert(), and CFDE_TxtEdtEngine::Inner_Insert() to take in CFX_WideString instead of a wchar_t* and length. Bug=pdfium:757 Change-Id: I6097e9b0d4e584b920b2117b4c5489eedef37767 Reviewed-on: https://pdfium-review.googlesource.com/11411 Commit-Queue: Jane Liu <janeliulwq@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-21Converted CFX_FloatRect::{Init|Update}Rect() to take point objectsJane Liu
Converted CFX_FloatRect::Init() and CFX_FloatRect::UpdateRect() to take in a CFX_PointF object instead of two coordinates. Bug=pdfium:770 Change-Id: Ibcb620f192d6c086158c39f23c411777286005d0 Reviewed-on: https://pdfium-review.googlesource.com/11450 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-21Cleanup CFDE_TextOutDan Sinclair
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>
2017-08-21Converted DrawCosmeticLine() to take point objectsJane Liu
Converted CFX_RenderDevice::DrawCosmeticLine() and IFX_RenderDeviceDriver:: DrawCosmeticLine() to take in CFX_PointF objects instead of two coordinates per point. Bug=pdfium:769 Change-Id: I6116e4106a61487184a71e79c1dca3a85e8c7c27 Reviewed-on: https://pdfium-review.googlesource.com/11410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-21Fixing crash on delete or backspace in XFA text edit box.Henrique Nakashima
Bug: pdfium:872 Change-Id: Ib7f0e3708cea2d16d7536ae26777ddc48d7e2c1d Reviewed-on: https://pdfium-review.googlesource.com/11370 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-21Roll yasm to 1.3.0.Lei Zhang
This basically copies https://chromium-review.googlesource.com/608869 Change-Id: I95acc3018e99a7822b9aaee7f83bc6080c0b3ec0 Reviewed-on: https://pdfium-review.googlesource.com/11336 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-17Change XFA DrawWidget() code to take its CFX_Matrix by const-ref.chromium/3192chromium/3191chromium/3190chromium/3189Lei Zhang
Change-Id: Idc9dfcafe6727c1689443ce8f9568567e55d51c8 Reviewed-on: https://pdfium-review.googlesource.com/11114 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-17Change CXFA_FFWidget::RenderWidget() to take a const CFX_Matrix&.Lei Zhang
Change some related code to take a const CFX_Matrix* since it is not immediately obvious if the matrix can be made into a const-ref. Change-Id: I15c840222b575cc479b1f6f0b6d3b3c0e50d5515 Reviewed-on: https://pdfium-review.googlesource.com/11113 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-17Remove default parameters from CXFA_FFWidget methods.Lei Zhang
Also remove an unused method and move a bunch of internal methods into an anonymous namespace. Change-Id: Ic7b4a975852cc2a7384bf3f681b953a5bf7e7d29 Reviewed-on: https://pdfium-review.googlesource.com/11112 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-17Remove default parameters in CXFA_Graphics methods.Lei Zhang
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>
2017-08-17Remove default argument for CXFA_Graphics::SetLineWidth().Lei Zhang
Change-Id: I6ea062bf5def0bc5fea7c52323198209dcf4c3e9 Reviewed-on: https://pdfium-review.googlesource.com/11110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-17Remove redundant members in CFDE_TxtEdtEngineDan Sinclair
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>
2017-08-17Roll DEPS for Skia to e0e2075.Lei Zhang
TBR=caryclark@google.com Change-Id: I4766f232240acf120db5203b4ae2379bd72f1b3c Reviewed-on: https://pdfium-review.googlesource.com/11332 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-17Roll DEPS for third_party/instrumented_lib to 644afd3.Lei Zhang
Just a routine roll. TBR=thomasanderson@chromium.org Change-Id: I06dca28c88fbee163950f33274c183c467410b3c Reviewed-on: https://pdfium-review.googlesource.com/11331 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-17Roll DEPS for ICU to 08cb956.Lei Zhang
Just a routine roll. TBR=jshin@chromium.org Change-Id: I4db431888d4d3868eb7f38f9ce7045cce02baef6 Reviewed-on: https://pdfium-review.googlesource.com/11330 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-17Turn caret movement into an enum classDan Sinclair
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>
2017-08-17Cleanup CFDE_TxtEdtEngine Insert and Delete methodsDan Sinclair
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>
2017-08-17Unify GetTextLength and GetTextBufLength in CFDE_TxtEdtEngineDan Sinclair
The GetTextLength method just proxies to GetTextBufLength. This CL removes GetTextBufLength and puts the functionality into GetTextLength. Change-Id: If324fbeddd05cd63570b6942dc613e273a1fbce7 Reviewed-on: https://pdfium-review.googlesource.com/11272 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-17Cleanup visibilty and unused methods in xfa/fdeDan Sinclair
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>
2017-08-17Roll clang to a1420b8.Lei Zhang
AKA roll clang 309984:310694. Roll build to bee933a to pick up corresponding changes there. TBR=thakis@chromium.org Change-Id: I5d7fac2caaaacb6a028fbbb58a3ca1cf068639f6 Reviewed-on: https://pdfium-review.googlesource.com/11295 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-17Roll V8 to 539f7ab3.Lei Zhang
Just a routine roll to version 6.2.266. TBR=jochen@chromium.org Change-Id: I8ae0cbca4a2af045896536edaa7d23b65aaa7486 Reviewed-on: https://pdfium-review.googlesource.com/11294 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-17Roll build_revision to bff6ee8.Lei Zhang
Also roll buildtools_revision to f90f6a5 and update Android code that did not previously pass the Chromium style plugin. TBR=dsinclair@chromium.org Change-Id: Ifb1193cee8f68ac99a31c8d43195e4d7005eeafb Reviewed-on: https://pdfium-review.googlesource.com/11293 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-17Roll clang to 7770b47.Lei Zhang
AKA roll clang 308728:309984. TBR=thakis@chromium.org Change-Id: I041eb632d4d19cd3d7b4ab2a27f6a7d68a718228 Reviewed-on: https://pdfium-review.googlesource.com/11292 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-17Fix some issues with individual image mask renderingrbpotter
Re-enable individual image mask rendering to improve spool sizes, with bug fixes and improvements: - Fix bug with missing images by ensuring all masks are recorded - Fix printing to landscape paper sizes - Improve spool sizes by processing the location of the masks in the progressive renderer when rendering to the printer instead of needlessly fully rendering them (they will be rendered as bitmaps anyway). Bug: chromium:753700 Change-Id: I86bdcce9f10855274c56ba2ddae2c2522b36426d Reviewed-on: https://pdfium-review.googlesource.com/11115 Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-16Tidy CXFA_Color class and argument passing.Tom Sepez
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>
2017-08-16Move some CFDE_TxtEdt* methods to the headerschromium/3188Dan Sinclair
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>
2017-08-16Simplify CFDE_TxtEdtEngine layout codeDan Sinclair
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>
2017-08-16Fixing crash on mouse movement in XFA form.Henrique Nakashima
Bug: pdfium:868 Change-Id: Ifd39c5c7c5486560987c18e9afb6ae3d2a4b7454 Reviewed-on: https://pdfium-review.googlesource.com/11190 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-16Fix another unguarded string element accessRyan Harrison
BUG=chromium:754969 Change-Id: I4f92d301499c658c57393fde01f1252ea84e59a8 Reviewed-on: https://pdfium-review.googlesource.com/11250 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>