summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-06-07Reland "Reland "Simplify CPDF_HintsTable.""Artem Strygin
This is a reland of d89f1bf48f017ab9f56df13299f75a906ed33cd0 Original change's description: > Reland "Simplify CPDF_HintsTable." > > This is a reland of 33591752d2cb14f2e07726ca52afce6efbdc07c9 > > Original change's description: > > Simplify CPDF_HintsTable. > > > > Use CPDF_LinearizedHeader directly. > > > > Change-Id: Id12402ef6e6f92fef68d0932df2e1ccb2dcf06aa > > Reviewed-on: https://pdfium-review.googlesource.com/15770 > > Reviewed-by: Lei Zhang <thestig@chromium.org> > > Commit-Queue: Lei Zhang <thestig@chromium.org> > > Change-Id: I2b5425a6533f4ce237f9ae6c483caa517105a5f7 > Reviewed-on: https://pdfium-review.googlesource.com/34130 > Reviewed-by: Lei Zhang <thestig@chromium.org> > Commit-Queue: Art Snake <art-snake@yandex-team.ru> Change-Id: If34c4ea05db7c9abaf2ba75ebe1abaabb962dd88 Reviewed-on: https://pdfium-review.googlesource.com/34410 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2018-06-07Add expectations for xfa_node_caption.pdfchromium/3453Ryan Harrison
This test appears to just be confirming that caption layout and content can be controlled via JS. Specifically there is a bunch of listeners for the initialize event that run and setup the page by inspecting and changing values. Clicking and such does nothing interesting, so there is no .evt. BUG=pdfium:1020 Change-Id: I1a24dc6fab058c17362506cce1f184e62dd82500 Reviewed-on: https://pdfium-review.googlesource.com/34491 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-07Convert resolve_nodes.pdf into 3 test casesRyan Harrison
There are 3 elements in the PDF that can be interacted with that cause testable output. This CL creates test cases for each of these elements. 2 of them work correctly, and a new bug, pdfium:1106, has been filed for the third. BUG=pdfium:1020 Change-Id: I524911d03927a0eeeee1d1479e1a855f90269e8e Reviewed-on: https://pdfium-review.googlesource.com/34370 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-07Rename CPDF_PageObjectHolder::GetFormDict() to GetDict().Henrique Nakashima
Renamed the underlying member m_pFormDict as well. These names are misleading, as a page also uses the same field as the page dict. Change-Id: I52e0f1864a917a1e1b863725cb0d4f22faecacb3 Reviewed-on: https://pdfium-review.googlesource.com/34450 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-06-07Remove friending in CFXJSE_Context.Tom Sepez
Change-Id: I6a634cb3fb9acdd78ae29017987e5e41865a0d4b Reviewed-on: https://pdfium-review.googlesource.com/34490 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-07Return from GenerateContent() if m_pObjHolder->GetFormDict() is null.Henrique Nakashima
Currently this case will lead to a crash, as pContent will be null and pPageDict will be dereferenced. This is a theoritical case, there is no concrete test case. Change-Id: Ieedab26cd9f419ab49aa2cde15f1b8e3c230b61d Reviewed-on: https://pdfium-review.googlesource.com/34430 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-06-07Check is first page number valid in CPDF_LinearizedHeader.Artem Strygin
Bug=chromium:850407,chromium:850440 Change-Id: I0115f75677db618b0de5e1e78b13da80b1da9559 Reviewed-on: https://pdfium-review.googlesource.com/34390 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-06-07Revert "Reland "Simplify CPDF_HintsTable.""Ryan Harrison
This reverts commit d89f1bf48f017ab9f56df13299f75a906ed33cd0. Reason for revert: This CL has introduced at least two CF issues chromium:850407,chromium:850440. Additionally there is a number of changes that remove bounds checks, which I think are suspect. BUG=chromium:850407,chromium:850440 Original change's description: > Reland "Simplify CPDF_HintsTable." > > This is a reland of 33591752d2cb14f2e07726ca52afce6efbdc07c9 > > Original change's description: > > Simplify CPDF_HintsTable. > > > > Use CPDF_LinearizedHeader directly. > > > > Change-Id: Id12402ef6e6f92fef68d0932df2e1ccb2dcf06aa > > Reviewed-on: https://pdfium-review.googlesource.com/15770 > > Reviewed-by: Lei Zhang <thestig@chromium.org> > > Commit-Queue: Lei Zhang <thestig@chromium.org> > > Change-Id: I2b5425a6533f4ce237f9ae6c483caa517105a5f7 > Reviewed-on: https://pdfium-review.googlesource.com/34130 > Reviewed-by: Lei Zhang <thestig@chromium.org> > Commit-Queue: Art Snake <art-snake@yandex-team.ru> TBR=thestig@chromium.org,tsepez@chromium.org,art-snake@yandex-team.ru Change-Id: I463b5b1330f809c2cb508cbf46a804b7a11526e4 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/34350 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-07Test to show editing a PageObject and saving the .pdf duplicates it.Henrique Nakashima
It is disabled since pdfium:1051 currently causes it to fail. Bug: pdfium:1051 Change-Id: I99a12db0ae4a58eab46e365f2f618fc98aee363f Reviewed-on: https://pdfium-review.googlesource.com/34210 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-06-07Remove v8::Context slot usage entierly from fxjsTom Sepez
Its no longer required. Change-Id: I180ca99817352a91b6d9d7c9b45985cd96dc730e Reviewed-on: https://pdfium-review.googlesource.com/34290 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-07Simplify cfxjs_engine_embeddertest.cppTom Sepez
In a world without context slots, we don't need to test getting an engine from a content slot. Change-Id: If572c364d663d1f20af659392bda3b96348fd4d4 Reviewed-on: https://pdfium-review.googlesource.com/34270 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-06Remove still more v8::Context slot usage.chromium/3452Tom Sepez
Removes CJS_Runtime::RuntimeFromIsolateCurrentContext() Change-Id: I51abcf32aaafac522e1595edf663507c26781357 Reviewed-on: https://pdfium-review.googlesource.com/34230 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-06Unsuppress dynamic_password_field_background_fill.pdfRyan Harrison
This CL creates a .evt and expectation image for this test. This test has a variety of password entry fields with different backgrounds and enters text into them. BUG=pdfium:1020 Change-Id: Icaa695670e8a773e066aec2251658a11c3e8ca3b Reviewed-on: https://pdfium-review.googlesource.com/34214 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-06Reland "Simplify CPDF_HintsTable."Artem Strygin
This is a reland of 33591752d2cb14f2e07726ca52afce6efbdc07c9 Original change's description: > Simplify CPDF_HintsTable. > > Use CPDF_LinearizedHeader directly. > > Change-Id: Id12402ef6e6f92fef68d0932df2e1ccb2dcf06aa > Reviewed-on: https://pdfium-review.googlesource.com/15770 > Reviewed-by: Lei Zhang <thestig@chromium.org> > Commit-Queue: Lei Zhang <thestig@chromium.org> Change-Id: I2b5425a6533f4ce237f9ae6c483caa517105a5f7 Reviewed-on: https://pdfium-review.googlesource.com/34130 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2018-06-06Add ability to log click events reaching PDFiumRyan Harrison
Adds in logging statement to related API methods and a build flag to control enabling the feature. This is meant to be used in conjunction with Chromium. A developer can enable this flag, load a test PDF, and then click on elements to determine appropriate coordinates for an .evt file. BUG=pdfium:1057 Change-Id: I956c39f545297872a61affdb621a412b3c407ff5 Reviewed-on: https://pdfium-review.googlesource.com/34010 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-06Embedder tests can write saved PDFs to a file for debugging.Henrique Nakashima
Before calling a method that use EmbedderTest as FPDF_FILEWRITE (usually calling FPDF_SaveAsCopy()), call: OpenPDFFileForWrite("Filename.pdf"); After the write, close the stream with: ClosePDFFileForWrite(); Change-Id: Id1e7f778a9ff2b2b5bf976d49b485d5cb15f94bd Reviewed-on: https://pdfium-review.googlesource.com/34150 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-06-06Get global consts without use of v8::Context slotTom Sepez
Another step in the move away from v8::Context slots. Change-Id: I302d1b3305755088c663214120e582b783cc5fbb Reviewed-on: https://pdfium-review.googlesource.com/34211 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-06Stop using some v8::Context slot to find runtime.Tom Sepez
Instead, use the object binding's pointer. Puts the cart back behind the horse. Change-Id: I4c06ae991b871c6e90b0e6c70b69886addca2354 Reviewed-on: https://pdfium-review.googlesource.com/33630 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-06[fm2js] Fixup initialized variable conversionDan Sinclair
When converting a Var statement from formcalc to JS we would neglect to add the ; if the variable was initialized. This generated invalid JS as we'd end up with two statements smushed together. FormCalc: var s = "" Previous JS: var s = ""s = pfm.... New JS: var s = ""; s = pfm ... Bug: pdfium:1097 Change-Id: I8a869f07374cac68a06a487dace89699a4e5540c Reviewed-on: https://pdfium-review.googlesource.com/34110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-06-06[xfa] Make class error description betterDan Sinclair
This CL changes the JS error produced by the CFXJSE_Class when a method call returns with error. Instead of outputing something like: JS Error: resolveNode.: we will now get: JS Error: Root.resolveNode: which at least lets us know we're looking at the Root class. Bug: pdfium:1097 Change-Id: I4982109398e290d9ebc2763fcc2421a642c581a5 Reviewed-on: https://pdfium-review.googlesource.com/34090 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-06-06Simplify check root availability.Artem Strygin
Change-Id: I34403490672b752bed9d5b6b29e8f4422c0fbf95 Reviewed-on: https://pdfium-review.googlesource.com/17732 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-06Simplify check info availability.Artem Strygin
Change-Id: I4475b83f69426b135c304d5861f0b7bb582deb81 Reviewed-on: https://pdfium-review.googlesource.com/17731 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2018-06-06Better error reporting on XFA JS errorsTom Sepez
Change-Id: I773ff83b45ffbd736f064daedb1010c8d01a99d5 Reviewed-on: https://pdfium-review.googlesource.com/34050 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-06Create events and expectation for barcode_test.pdfRyan Harrison
This adds a test where a known value is used as a seed for generating a barcode and confirming that the generated barcode is consistent. BUG=pdfium:1020 Change-Id: I61ed37a8591f0efe40a8d4ab1d6024bb1489ef25 Reviewed-on: https://pdfium-review.googlesource.com/34030 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-06-06Use CPDF_StreamAcc to data access of CPDF_Stream.Artem Strygin
Change-Id: I68b88e013ac542f245dbe7b6889799c814d46eb8 Reviewed-on: https://pdfium-review.googlesource.com/33690 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-06-05Introduce IJS_Runtime::ScopedEventContext helper class.chromium/3451Tom Sepez
This proves that m_EventContextArray is, in fact, a stack. Tidy one function by using AutoRestorer while at it. Change-Id: I319538b4eadcd9ce83319aa73861635dd5eb8c36 Reviewed-on: https://pdfium-review.googlesource.com/33970 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-06-05Revert "Do not merge content streams to parse them."Henrique Nakashima
This reverts commit 9d3fb11a985a8f2aefbf361c0030c7bce2248b8e. Reason for revert: Break rendering of http://www.flbb.lu/bio_files/BIO_25_2005.pdf Original change's description: > Do not merge content streams to parse them. > > Removed the PrepareContent() step in CPDF_ContentParser, as its goal > was to merge these streams. > > In Parse(), now loop through the m_StreamArray and parse each stream > separately. > > Bug: pdfium:1051 > Change-Id: Id07f3efe766828081c8cf8601bf69c4f37e20e13 > Reviewed-on: https://pdfium-review.googlesource.com/33595 > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> > Reviewed-by: Ryan Harrison <rharrison@chromium.org> TBR=thestig@chromium.org,hnakashima@chromium.org,rharrison@chromium.org Change-Id: I8186b2dac8538ca477302bb91e22dcc54124461a Bug: pdfium:1051 Reviewed-on: https://pdfium-review.googlesource.com/33991 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-06-05Tidy parser lifecycle state machine in CPDF_PageObjectHolder.Tom Sepez
Only update state in CPDF_PageObjectHolder itself. Make more data private. Remove CPDF_Page::GetPageBBox() as exact duplicate of CPDF_PageObjectHolder::GetBBox(). Change-Id: I083ec33f61a1490e7a5e673c9787751af15a6cd1 Reviewed-on: https://pdfium-review.googlesource.com/33810 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-06-05Revert "Create m_ContentStream field in CPDF_PageObject."Henrique Nakashima
This reverts commit d3d8287e143daf12a602a919c120b4e0c656abf8. Reason for revert: Need to revert https://pdfium-review.googlesource.com/c/pdfium/+/33595 that this depends on. Original change's description: > Create m_ContentStream field in CPDF_PageObject. > > Content streams are now split and can set nonzero values to identify > each parsed content stream. > > Bug: pdfium:1051 > Change-Id: Ia2cb1e0997db5264d468043af31f9b41e8d0d349 > Reviewed-on: https://pdfium-review.googlesource.com/33591 > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> > Reviewed-by: Ryan Harrison <rharrison@chromium.org> TBR=thestig@chromium.org,hnakashima@chromium.org,rharrison@chromium.org Change-Id: I5046b6a76508fccc0ff04cb7393cae6485dd091f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:1051 Reviewed-on: https://pdfium-review.googlesource.com/33990 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-06-05Assert CPDF_ContentParser always has a valid page holder.Lei Zhang
Change-Id: Ia9b3066c8076ed296125bf514c07f7118c52dd05 Reviewed-on: https://pdfium-review.googlesource.com/33850 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-06-05[xfa] Make the event context available when calling back in XFADan Sinclair
When calling into the XFA JS engine with a request for a non-XFA JS call which accesses the EventContext we would get a crash in XFA as we never set the context. This CL changes the XFA code to accept the CJS_Runtime instead of the CFXJS_Engine and then calls NewEventContext before executing JS scripts. This will correctly setup the event context as needed for any JS callbacks. Bug: pdfium:1003 Change-Id: Icf202252b2e6e56afdf0d1766a32a893935a2fd3 Reviewed-on: https://pdfium-review.googlesource.com/33930 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-06-05Further improve CCodec_FaxDecoder performance in debug builds.Lei Zhang
BUG=chromium:845117 Change-Id: Id1c97bc40ff776f52011a8ab2d6e5166cd7c64c8 Reviewed-on: https://pdfium-review.googlesource.com/33650 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-06-05Move CPDF_PageObjectHolder::m_pFormStream to CPDF_Form.Lei Zhang
This member variable is only used in the CPDF_Form subclass. Change-Id: Ib922228e51f5c3b370027e565d04ffe47374a320 Reviewed-on: https://pdfium-review.googlesource.com/33830 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-06-05Create m_ContentStream field in CPDF_PageObject.Henrique Nakashima
Content streams are now split and can set nonzero values to identify each parsed content stream. Bug: pdfium:1051 Change-Id: Ia2cb1e0997db5264d468043af31f9b41e8d0d349 Reviewed-on: https://pdfium-review.googlesource.com/33591 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-06-05Clean up CFX_TxtBreakRyan Harrison
Removed some unused assignments and now unused variables. Also rewrote a for loop so that its secondary condition is now in the control block. The static analyzer was claiming it was possible for a division by 0, though following the control path it was claiming, I am pretty sure it should have exited early. This reorganizing of the code makes it a bit more readable and eliminates the div by 0 warning from the static analyzer. Issues found with Clang Static Analyzer. Change-Id: I91f1b42374734665b06724e9fafa6490e06bd3da Reviewed-on: https://pdfium-review.googlesource.com/33910 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-05Revert "Convert (void) to static_cast<void> in C++ code"Ryan Harrison
This reverts commit 80c6ab7b99bcbd7b940f78dc0cac52c30249f59c. Reason for revert: (void) idiom is prevalent through out C++ code. Original change's description: > Convert (void) to static_cast<void> in C++ code > > Converting instances of old C-style void casts to suppress return > values to use C++ style static cases. There are a few examples of > (void) that remain, since they are in C code, and the third_party/ > instances are not touched at all. > > Change-Id: I72b3fc0e1d713db669b76135e03d1cf87873a2fe > Reviewed-on: https://pdfium-review.googlesource.com/33790 > Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> > Commit-Queue: Ryan Harrison <rharrison@chromium.org> TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org,hnakashima@chromium.org,rharrison@chromium.org Change-Id: Ib6cc021c97cb1ea7c71b90346fa9b500659f565d No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/33890 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-05Add test for FPDF_GetPageSizeByIndex()Tom Sepez
Ensure that FPDF_GetPageSizeByIndex() doesn't do a full page parse. Issue was noticed on CL https://pdfium-review.googlesource.com/32830 Change-Id: I51966e0b91e1a002d33ee51f00c0428fa1cda04d Reviewed-on: https://pdfium-review.googlesource.com/33792 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-05Improve FPDFPath_GetMatrix() testsMiklos Vajna
The test succeeded if FPDFPath_GetMatrix() did not touch its out parameters, now this is covered. Change-Id: I04e3c4bd55e0a8e403e88dbc23ec21e8d00eacf2 Reviewed-on: https://pdfium-review.googlesource.com/33870 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-06-05Share read validator between CPDF_DataAvail and CPDF_SyntaxParser.Artem Strygin
Change-Id: I61c92050b034fbffa747a2519aba368e9678afcd Reviewed-on: https://pdfium-review.googlesource.com/15850 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-05Remove useless code.Artem Strygin
Change-Id: I68bd9004cb034df749625f4c83072b08d33202e4 Reviewed-on: https://pdfium-review.googlesource.com/17730 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-04Lowercase JS_Define.{h,cpp} and CJS_Define.hTom Sepez
Consistency with file naming conventions. No functional change. Change-Id: I596c4be5bbf0510950c44a7d9d80f59537739c3b Reviewed-on: https://pdfium-review.googlesource.com/33593 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-06-04Fix a number of unused writes in barcode codeRyan Harrison
This fixes a number of instances where a value is written out to a variable, but never used in the barcode. There are three different types of fixes employed in this CL. If the non-use is a bug, then rewrite the code to actually use the value. If it is an assignment with no side effects, then just remove the entire line. Finally if it is an assignment of a function return value, cast it to void instead to clearly mark that the return is being ignored. Issues found with Clang Static Analyzer. Change-Id: If13a3684cb2db81592cce9a798788a26fcdb4c6d Reviewed-on: https://pdfium-review.googlesource.com/33771 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-04Remove unused assignment from CFX_RTFBreakRyan Harrison
This assignment is never used, so removing it. Issue found with Clang Static Analyzer. Change-Id: I5cf4bd9626f0a0391681c3923ae1bee70ffb99c7 Reviewed-on: https://pdfium-review.googlesource.com/33791 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-04Convert (void) to static_cast<void> in C++ codechromium/3450Ryan Harrison
Converting instances of old C-style void casts to suppress return values to use C++ style static cases. There are a few examples of (void) that remain, since they are in C code, and the third_party/ instances are not touched at all. Change-Id: I72b3fc0e1d713db669b76135e03d1cf87873a2fe Reviewed-on: https://pdfium-review.googlesource.com/33790 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-04Make CJS_Objects track CJS_Runtime (and hence the document itself)Tom Sepez
Precursor to removing some more v8::Context slot dependency. There's a cost to maintaining the set of observers, but since these objects are tied to V8 lifetimes, not C++ lifetimes, we want to be very wary of the document going away unexpectedly. Change-Id: I579f58a460aa50b88cb861227c9aca9a8a83ce12 Reviewed-on: https://pdfium-review.googlesource.com/33471 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-04Do not merge content streams to parse them.Henrique Nakashima
Removed the PrepareContent() step in CPDF_ContentParser, as its goal was to merge these streams. In Parse(), now loop through the m_StreamArray and parse each stream separately. Bug: pdfium:1051 Change-Id: Id07f3efe766828081c8cf8601bf69c4f37e20e13 Reviewed-on: https://pdfium-review.googlesource.com/33595 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-06-04cjs_globalconsts.cpp need not use v8::Context slotsTom Sepez
Small step towards deprecating FXJS's use of v8::Context slots. Reduces some string constant storage size while were at it by avoiding wide literals for ascii strings. Change-Id: Ibc651cff264302681645fde7c53bf77517b97651 Reviewed-on: https://pdfium-review.googlesource.com/33470 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-04Clean up of comment from post-submitRyan Harrison
Landed https://pdfium-review.googlesource.com/c/pdfium/+/33592 without addressing some comments that appeared after I sent it to CQ, this addresses them. Change-Id: Ic9c4d81328aafee6ff8431460c5b8b674e25ad38 Reviewed-on: https://pdfium-review.googlesource.com/33712 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-04Revert "Make CPDF_Document cache CPDF_Pages"Tom Sepez
This reverts commit f0d9d28a034fe3650c3c2d662090c1e8687ddb16. Reason for revert: avoid parsing page. Change-Id: Id3478f7e38f1cbe95d098e00158b1d7d9dc6f76e Reviewed-on: https://pdfium-review.googlesource.com/33750 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-06-04Revert "Make common page base class for XFA and non-XFA."Tom Sepez
This reverts commit d06cc38b76685b002c51b227ae43b8314d926ad8. Reason for revert: blocking previous revert Change-Id: I74f8b80852c671440cca5fabef30e69cde9e2063 Reviewed-on: https://pdfium-review.googlesource.com/33713 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>