summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-15Use Width()/Height() methods from rectangles.Lei Zhang
Change-Id: I07f4363046be920816e8d0dae766c7af833284db Reviewed-on: https://pdfium-review.googlesource.com/28582 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-15Remove unused CPDFSDK_BAAnnot methods.Lei Zhang
Change-Id: I5de956c8a759c974659396a34a355eb0840d2144 Reviewed-on: https://pdfium-review.googlesource.com/28580 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-15Fix a red-blue channel flip when rendering masks to EMF.Lei Zhang
Use BGR instead of RGB in CGdiDeviceDriver::GDI_StretchBitMask(). Many win32 GDI APIs take COLORREF as input, and COLORREF is BGR. In this case, a win32 API was being called with RGB data. BUG=chromium:821672 Change-Id: Ia530c7ef5582eed13ac7119935851cfe0ad57323 Reviewed-on: https://pdfium-review.googlesource.com/28573 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-15Cleanup CStretchEngine.Lei Zhang
- Make members const. - Change some ints to enum classes. - Add helper function to calculate pitch. Change-Id: I32f94e1189d54a2c365530166fb5c9c0857b7c97 Reviewed-on: https://pdfium-review.googlesource.com/28571 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-14Fix bad return value in WideString::Compare().chromium/3371Lei Zhang
When comparing L"a" vs L"ab", the return value should be -1 or 1, not 0 or 1. Add a regression test for this case. BUG=chromium:821454 Change-Id: I38e2d7ca62319b7a62f8d8afeb231b8ed3bd9e86 Reviewed-on: https://pdfium-review.googlesource.com/28570 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-14Fix blend mode in generated APRalf Sippl
When adding an annotation, an appearance stream (AP) is generated. According to the PDF spec, the Subtype, Type and BM entries it contains should be names rather than strings. Type should be set to XObject. BUG=pdfium:1038 Change-Id: I0131eec33c257ab3a3a48c7e0dfeac5ca8dfbe2b Reviewed-on: https://pdfium-review.googlesource.com/28550 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-03-13Remove usage of FXSYS_*ASCIIlower/upper methodschromium/3370Ryan Harrison
This replaces them with equivalent FXSYS_*wlower/upper methods, which uses ICU to perform the correct Unicode operations. BUG=pdfium:1035 Change-Id: I432db5bef9eda71762016b619d93155949d054db Reviewed-on: https://pdfium-review.googlesource.com/28530 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-12Remove all usages of FXSYS_iswASCIIspacechromium/3369Ryan Harrison
This replaces it with FXSYS_iswspace, which uses ICU to perform correct Unicode space checking. BUG=pdfium:1035 Change-Id: I7a4ed01a6b50f56a6f9d1434a7f0b01596fe42db Reviewed-on: https://pdfium-review.googlesource.com/28510 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-12Fix crash when creating a CFX_DIBitmap with FXDIB_Invalid.Henrique Nakashima
Bug: chromium:820885 Change-Id: I3886c636b91a8499924d95ad47f4c832db9f9754 Reviewed-on: https://pdfium-review.googlesource.com/28491 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-03-12Add test that non-ASCII characters to not foul hyphen processingRyan Harrison
In this doc there is a hyphen followed a fi ligature. Older versions of PDFium were not inserting the appropriate soft hyphen marker (0x0002) at this point, since they were only checking for ASCII characters. That bug is fixed in the preceding CLs, so this test is being added to avoid regressions. BUG=pdfium:1029 Change-Id: I9c9906de5a13ade1400a589fb18967938150516d Reviewed-on: https://pdfium-review.googlesource.com/28470 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-12Remove all usages of FXSYS_iswASCIIalphaRyan Harrison
Instances are either replaced with FXSYS_iswalpha, which calls out to the ICU library to do the proper Unicode operations, or have been converted to a isascii && isalpha pair, if ASCII alpha is actually what was wanted. BUG=pdfium:1035 Change-Id: I971ff639ee1ff818ad08793a1900a8bcbb0a3e04 Reviewed-on: https://pdfium-review.googlesource.com/28450 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-12Remove all usages of FXSYS_iswASCIIalnumRyan Harrison
Instances are either replaced with FXSYS_iswalnum, which calls out to the ICU library to do the proper Unicode operations, or have been converted to a isascii && isalnum pair, if ASCII alnum is actually what was wanted. BUG=pdfium:1035 Change-Id: I959ec8739a4d020e61562180393ab8113a81577c Reviewed-on: https://pdfium-review.googlesource.com/28430 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-12Handle inserting negative values without a selectionDan Sinclair
When handling the AFNumber_Keystroke callback, if the changed value is negative and there is no selection, we'd incorrectly error out thinking we were inserting before the negative sign. This CL checks if the selection string is empty before erroring out. Bug: chromium:817433 Change-Id: I0ca08e121e9a8c207e9c7793f5b8a4e795c135e6 Reviewed-on: https://pdfium-review.googlesource.com/28110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-03-12Stop excluding SkDumpCanvas from Skia. It no longer exists.Brian Osman
Change-Id: I210b18e4ab037f1190ddb1362d11973d2e492c75 Reviewed-on: https://pdfium-review.googlesource.com/28490 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-09Cleanup CPDF_DefaultAppearancedan sinclair
Minor cleanups and refactoring of the CPDF_DefaultAppearance class. Change-Id: I7b3de021e8a6a1e9ca1d70ae413f3c433627f3fd Reviewed-on: https://pdfium-review.googlesource.com/28390 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-09Remove default params from CPDF_DefaultAppearance methodschromium/3368chromium/3367dan sinclair
This CL removes default params from CPDF_DefaultAppearance methods. Change-Id: Iaeebc7b35ebb6140850f3f0e0828c3ae9e3c5548 Reviewed-on: https://pdfium-review.googlesource.com/28350 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-09Explicitly mark helper methods that only operate on ASCII rangesRyan Harrison
A number of our character helper methods take in wide character types, but only do tests/operations on the ASCII range of characters. As a very quick first pass I am renaming all of the foot-gun methods to explictly call out this behaviour, while I do a bigger cleanup/refactor. BUG=pdfium:1035 Change-Id: Ia035dfa1cb6812fa6d45155c4565475032c4c165 Reviewed-on: https://pdfium-review.googlesource.com/28330 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-09Remove unused methods from CPDF_DefaultAppearancedan sinclair
Methods unused. Removed. Change-Id: I059b1e321b7d57f631368b77ace1d62cb75596c8 Reviewed-on: https://pdfium-review.googlesource.com/28310 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-08Unset timer in XFA scrollbar after stopping it.Henrique Nakashima
This fixes a crash that happens after interacting with the scrollbar a few times. Bug: chromium:820210 Change-Id: I458337f21c9322351474a1574ab596c600dcbbbf Reviewed-on: https://pdfium-review.googlesource.com/28290 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-08Move GetPopupPos from CFWL_Widget to subclasses that call it.Henrique Nakashima
Change-Id: I27118d2c8d0d7e4509b6a89cd32a7c9c906d19bc Reviewed-on: https://pdfium-review.googlesource.com/28270 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-08Remove unused constructordan sinclair
Unused. Removed. Change-Id: I493a98b22c343d44834d3648e4ef2fe9978f88b1 Reviewed-on: https://pdfium-review.googlesource.com/28250 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-08Cleanup CPDF_SimpleParserdan sinclair
Minor code cleanup. Change-Id: Ibc3ea17d270de517058c41e9b466bc8fb042ecd7 Reviewed-on: https://pdfium-review.googlesource.com/28230 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-08CPDF_InterForm::ResetForm always returns truedan sinclair
This method always returns true, so remove the return value. Change-Id: I3da93fc5face39a53b589787873839c06c9fcfab Reviewed-on: https://pdfium-review.googlesource.com/28210 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-08Convert Before{Selection|Value}Change to return a boolchromium/3366dan sinclair
Both of these IPDF_FormNotify methods return {-1, 0, 1} but all callsites only care about < 0 and >= 0. Convert to return a bool that treats the 0 and 1 case as the same. This also makse sense in terms of the API because false means validation failure. The case where 0 was used was a place holder for we didn't try for this field type, which also implicitly means validation passed. Change-Id: I0950c678191b83caffd755d4a87b2f0efee71c89 Reviewed-on: https://pdfium-review.googlesource.com/28192 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-08Remove BeforeFormImportData and BeforeFormResetdan sinclair
Both of these IPDF_FormNotify callbacks have empty implementations which just return 0. Removed. Change-Id: I3324113222f19d2f7a2323ab5086e446d2064451 Reviewed-on: https://pdfium-review.googlesource.com/28191 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-08Remove uncalled AfterFormImportDatadan sinclair
The IPDF_FormNotify::AfterFormImportData method is never called. Removed. Change-Id: I0c436193a0af7bc94077bb719e48682bbf7a9b2b Reviewed-on: https://pdfium-review.googlesource.com/28190 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-07[formcalc] Consider width along with depth of treeDan Sinclair
When building the formcalc parser trees we need to limit on width along with depth. It's possible to generate a tree of a single depth but is more then 20k nodes wide. This will eventuall cause stack overflow issues. This CL re-uses the depth check for the grammar expressions in which we're extending the width of the tree we count that against our depth check. Bug: chromium:813346 Change-Id: I01f6567a75776a75374465eacc1ff546db46cac1 Reviewed-on: https://pdfium-review.googlesource.com/28170 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-07[formcalc] Handle bad elseif conditionalschromium/3365Dan Sinclair
This Cl adds checking for the conditionals of if and elseif expressions. If the conditional fails to parse we should return nullptr. This already happens by accident in the if() case, but with elseif() conditions we'll fail the ASSERT in the CXFA_FMIfExpression constructor and crash. This CL explicitly checks for the expressions and early exists if they failed to parse. Bug: chromium:819509 Change-Id: I9a90182c7709c8c4c0d3ae17d6be67cb668c0c6a Reviewed-on: https://pdfium-review.googlesource.com/28131 Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-06Remove axial gradients from XFA widgets.Henrique Nakashima
Most of the CPU time when moving around XFA forms is spent rendering these gradients. Bug: chromium:592748 Change-Id: I08c68c60996755a2be25243dfd2143b6cbb13af9 Reviewed-on: https://pdfium-review.googlesource.com/28090 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-06Rename IFX classes in core/fxge to Ifacechromium/3364Dan Sinclair
This CL renames IFX classes in core/fxge to Iface. Change-Id: I137167ddd4ff1563d8002d9501222c27183408cc Reviewed-on: https://pdfium-review.googlesource.com/27990 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-06Rename core/fxcrt IFX files to IfaceDan Sinclair
This CL renames the 3 IFX files in core/fxcrt to Iface instead. Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3 Reviewed-on: https://pdfium-review.googlesource.com/27970 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-06[formcalc] Allow empty declaration bodiesDan Sinclair
This CL removes the checks for empty declaration bodies. Change-Id: I06a8f602f49d7709bce86442cae2d38991fa5d82 Reviewed-on: https://pdfium-review.googlesource.com/27950 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-05[formcalc] Simplify function signature parsingchromium/3363Dan Sinclair
This CL refactors the signature parsing for formcalc functions. Change-Id: I69634968ab1cbd9698a3ce3ae321e14bafe918c6 Reviewed-on: https://pdfium-review.googlesource.com/27930 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-05[formcalc] Cleanup m_error handlingDan Sinclair
This CL cleans up the setting of m_error. In most cases we don't need to set m_error it will be set when we bubble up the nullptr return from the various parse methods. The m_error was set inconsitently previously and was confusing on if it needed to be set or not. Change-Id: I8648b6296ef15239bd2663e6543a960b88177721 Reviewed-on: https://pdfium-review.googlesource.com/27910 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-05Cleanup CFWL_ScrollBar::Timer::Run.Henrique Nakashima
Change-Id: Icd76a6a98a66c977e45ed82663b68f6b05479e76 Reviewed-on: https://pdfium-review.googlesource.com/27891 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-03-05Fix crash when dragging scrollbar in XFA form.Henrique Nakashima
Bug: chromium:809612 Change-Id: I171d836927fc707388444726d3918b2cbbb39002 Reviewed-on: https://pdfium-review.googlesource.com/27890 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-03-05Clean up CPDF_DIBSource.Lei Zhang
- Deduplicate code. - Rearrange some functions for early returns. Change-Id: I901d9041a42ff66002b1454193e5e122e5a379cd Reviewed-on: https://pdfium-review.googlesource.com/27810 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Make FPDFBitmap_GetFormat() work for JBIG images.Lei Zhang
BUG=pdfium:945 Change-Id: I2a880e747b6f5a2fabed4d34ce47b69ff589ce3f Reviewed-on: https://pdfium-review.googlesource.com/27814 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Use CPDF_DIBSource::LoadState enum class in more places.Lei Zhang
Change-Id: Iaf124c1b1ceca86d220ae654d9d18af7475209b6 Reviewed-on: https://pdfium-review.googlesource.com/27870 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Change CPDF_DIBSource::LoadJpxBitmap() to return a bitmap.Lei Zhang
Change-Id: If819bee4809142e2f9c9b0830f00264b0fbaf862 Reviewed-on: https://pdfium-review.googlesource.com/27852 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Change return types for some rendering Start/Continue methods.Lei Zhang
Either return a bool or a CPDF_DIBSource::LoadState. Explain what the bool return value means. Change-Id: I6346d0cd61d5faee5290df181cfff3b9e4d5d84e Reviewed-on: https://pdfium-review.googlesource.com/27851 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Add CPDF_DIBSource::LoadState enum class.Lei Zhang
Change-Id: I97819912e564e4b52fcdae4ce7f865188fb1a520 Reviewed-on: https://pdfium-review.googlesource.com/27850 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-02Make EmbedderTest::WriteBitmapToPng() work with grayscale images.chromium/3362chromium/3361chromium/3360Lei Zhang
Change-Id: I88d350171e2b18dc7776d17e845b55c361845721 Reviewed-on: https://pdfium-review.googlesource.com/27811 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-01Disable XFA tests without embedded fontsRyan Harrison
These are being flakey due to subtle differences between builders, so turning them off while resolving that. Change-Id: I7f400a7a95076bafb2739ff78786eb3cc147953c Reviewed-on: https://pdfium-review.googlesource.com/27830 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-01Add a test for FPDFImageObj_GetBitmap() with a JBIG image.Lei Zhang
The test expectations are for the current failure state. BUG=pdfium:945 Change-Id: I1be503860b2ad5cbb0466793c9fa1438b3fc43d7 Reviewed-on: https://pdfium-review.googlesource.com/27770 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-01Break up CFX_DIBSource::ConvertBuffer().Lei Zhang
Change-Id: If93b4782016c7f27c1533417d019f3271c807941 Reviewed-on: https://pdfium-review.googlesource.com/27813 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-01Fix some nits in CFX_DIBSource::CloneConvert().Lei Zhang
Change-Id: I25c16b7159d168bd6deb4fd9936bb242d7e8c590 Reviewed-on: https://pdfium-review.googlesource.com/27812 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-28Add simple XFA test for entering text into TextEditRyan Harrison
BUG=pdfium:1008,pdfium:1020 Change-Id: I607b9327252ff836ad78a55659b1d40bc2797906 Reviewed-on: https://pdfium-review.googlesource.com/27771 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-02-27Move XFA pixel tests under pixel/chromium/3358chromium/3357Ryan Harrison
This removes the need for them to have their own runner. Due to other upstream changes some of the expectation files needed to be updated. The suppressions have been updated to make sure the tests do not run for non-XFA builds. Having these tests run on the bots surfaced an MSAN issue in the XFA code, which is fixed in this CL. BUG=pdfium:1020,pdfium:1008 Change-Id: I44e2fa1cba2d07f30f56f5792749acbe1ebf4b62 Reviewed-on: https://pdfium-review.googlesource.com/27710 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-02-26Shrink some tables and kill dead code in xfa.Tom Sepez
Change-Id: Ic1260417e7d1475dd518655b2ab08f0184955d88 Reviewed-on: https://pdfium-review.googlesource.com/27170 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>