summaryrefslogtreecommitdiff
path: root/fpdfsdk
AgeCommit message (Collapse)Author
2016-01-25XFA: Fix a bunch of pointless returns.chromium/2637chromium/2636chromium/2635chromium/2634chromium/2633chromium/2632Lei Zhang
And a few other nits. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1635853002 .
2016-01-22Merge to XFA: Change _PDF_RenderItem to CPDF_RenderContext::Layer.Tom Sepez
Original Review URL: https://codereview.chromium.org/1620523002 . (cherry picked from commit d5712ac571f3487fe3f74617fdab007a11a09052) TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1624553004 .
2016-01-21Merge to XFA: Rename CPDF_PageObjects to CPDF_PageObjectListTom Sepez
Orignal Review URL: https://codereview.chromium.org/1612113003 . (cherry picked from commit 9ebc84109d7d2f7b81f06f19e5db20888e026c3b) R=ochang@chromium.org TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1612243002 .
2016-01-21Mege to XFA: Redo CPDF_PageObjects - part 1Tom Sepez
Original Review URL: https://codereview.chromium.org/1601093009 . (cherry picked from commit da9355139b5dce270be02af31db326d60f488e8c) Trivial conflicts/changes in fpdfeditpage.cpp and fpdfxfa_page.cpp. TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1613823003 .
2016-01-21Merge to XFA: Rename CPDF_PageContentGenerate to CPDF_PageContentGenerator.Tom Sepez
Original Review URL: https://codereview.chromium.org/1611193003 . (cherry picked from commit ca6d98f4dfe7d4fc506b72c91f122f471a53c878) R=ochang@chromium.org TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1613163003 .
2016-01-20Merge to XFA: Use std::set to track visited dictionaries in fsdk_actionhandler.Tom Sepez
Original Review URL: https://codereview.chromium.org/1610303002 . (cherry picked from commit f409da4b8a3e6a3885605a47bed4f8798c4703b9) TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1611733002 .
2016-01-20Merge to XFA: Bugs in CJS_PublicMethods::ParseNumber().Tom Sepez
Original Review URL: https://codereview.chromium.org/1586203006 . (cherry picked from commit f13d510cf267c27f4c123494de67670ec201cedc) BUG=pdfium:361 R=ochang@chromium.org TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1603173004 .
2016-01-20Fix crashing in CPDFXFA_Document::GetPage()Jun Fang
BUG=pdfium:332 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1539193003 .
2016-01-19Merge to XFA: Fix infinite loops caused by calling circular indirect objectsWei Li
There are multiple functions in CPDF_Object class which can cause infinite loop due to recursively calling circular indirect objects. Fix them by deference indirect object first. BUG=pdfium:355 TBR=jun_fang@foxitsoftware.com, thestig@chromium.org Review URL: https://codereview.chromium.org/1585533002 . (cherry picked from commit 90853cb1dfd1bf3803ec21cfae3e93948137be61) Review URL: https://codereview.chromium.org/1602103004 .
2016-01-14Merge to XFA: Loose checking for trailer's size fieldWei Li
Although trailer's size value is required by spec, other readers such as Acrobat or libpoppler can handle without it. Loose up the check to be more tolerant. BUG=pdfium:213 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1582193002 . (cherry picked from commit 34291b900ad0472eef582215cfce0d942a40fd16) Review URL: https://codereview.chromium.org/1589783004 .
2016-01-14Merge to XFA: Correct the way to count pages and to avoid infinite loopWei Li
BUG=pdfium:360 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1585823003 . (cherry picked from commit 5d5d9fe7bd1c9566b9d6570015b7c60894d9fc0c) Review URL: https://codereview.chromium.org/1583073004 .
2016-01-13Merge to XFA: Fix some iterator invalidation issues while traversing ↵Oliver Chang
CPDF_Dictionary. Also fixes a potential issue in CPDF_Dictionary::ReplaceKey. TBR=thestig@chromium.org BUG=577030 Original Review URL: https://codereview.chromium.org/1582963003 . (cherry picked from commit cae57daaa0f7ed4c92e22c4e7ef30392393d1128) Review URL: https://codereview.chromium.org/1587703003 .
2016-01-11XFA: Fix memory leakage on LinuxJun Fang
BUG=pdfium:348 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1579503002 .
2016-01-11Merge to XFA: Fix an infinite loop parsing in CPDF_SyntaxParser::GetObject()Wei Li
CPDF_SyntaxParser::GetObject() may enter into an infinite loop when a signature dictionary doesn't have 'Contents' field. Add a check to avoid that. BUG=pdfium:344 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1575833004 . (cherry picked from commit d3ab0f383f6736657480a8bb418c5e715a1aed3b) Review URL: https://codereview.chromium.org/1571333004 .
2016-01-11Merge to XFA: Fix an uninitalized read in FPDFText_GetFontSize().Lei Zhang
BUG=pdfium:346 TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1578543002 . (cherry picked from commit 401cd2dbaaa10790077de2fd70e8101b0bdd0f36) Review URL: https://codereview.chromium.org/1578873002 .
2016-01-11Merge to XFA: Switch most min/max macros to std::min/max.Lei Zhang
Fix lint errors along the way. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1567343002 . (cherry picked from commit 9adfbb0920a258e916003b1ee9515e97879db82a) Review URL: https://codereview.chromium.org/1577503002 .
2016-01-11Merge to XFA: Use std::map as CPDF_Dictionary's underlying store.Oliver Chang
Replaces CFX_CMapByteStringToPtr. XFA still uses CFX_CMapByteStringToPtr so it's not completely removed just yet. Adds begin()/end() to CPDF_Dictionary and removes the GetStartPos()/GetNextElement() functions to traverse the dictionary. Callers are changed accordingly. AddValue() is also removed. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1541703003 . (cherry picked from commit 14f39950451bb9c2a11fbc7173fd47367410f80f) Review URL: https://codereview.chromium.org/1576033002 .
2016-01-08Merge to XFA: Remove a bunch of dead code.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1567333003 . (cherry picked from commit 4a24ad858484ecdf9b49481e63060e4d476cf1c7) Review URL: https://codereview.chromium.org/1569783007 .
2016-01-08Merge to XFA: Fix infinite loop caused by parsing same indirect objectsWei Li
BUG=pdfium:343 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1569343002 . (cherry picked from commit 149f1db8bba85bdf2b40d330c38f2478695ca0d5) Review URL: https://codereview.chromium.org/1575663002 .
2016-01-08Merge to XFA: Clean up misc nits found while fixing bugs.Lei Zhang
Some bits regressed in commit 338805f. Also merge: IWYU fix after commit c5a8933. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1544963002 . Review URL: https://codereview.chromium.org/1570973002 . (cherry picked from commit c5a8933f260ca1034fde902058442984e55c0f7a) (cherry picked from commit e6bd31873c3dba3f79c5ebbbefed636948629cc9) Review URL: https://codereview.chromium.org/1577453002 .
2016-01-08XFA: Remove relative includes outside of xfa/.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1572523002 .
2016-01-07Merge to XFA: Disentangle fpdfsave_embeddertest's FPDF_FILEWRITE.Tom Sepez
Original Review URL: https://codereview.chromium.org/1561303002 . (cherry picked from commit 5dc13d7858f9caf58b0e12f38823300a739302e2) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1569973002 .
2016-01-06Merge to XFA: Return const-ref object in a few CPWL_Wnd getters.Lei Zhang
Also remove a bunch of dead code. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1565803003 . (cherry picked from commit cbed99098ad4cdc3f9f260cc1e8521f67c12d35d) Review URL: https://codereview.chromium.org/1569483004 .
2016-01-06XFA: Change the destruction order inside CPDFXFA_Document to avoid UAFs.Lei Zhang
R=jun_fang@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/1566903002 .
2016-01-06Invalidate IPWL_FocusHandler and IPWL_Provider on destruction.Lei Zhang
BUG=572871 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1564773003 . (cherry picked from commit dcac57bc8b64fdc870d79d11a498ae7021cf8ae7) Review URL: https://codereview.chromium.org/1569663002 .
2016-01-06Merge to XFA: Return unique_ptrs from test_support functionsTom Sepez
Orignal Review URL: https://codereview.chromium.org/1563513002 . (cherry picked from commit aa326bd6b169dc1b5b9b83048c71799799ab34c6) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1564583004 .
2016-01-06Merge to XFA: Add fpdf_edit basic creation embedder test.Tom Sepez
Original Review URL: https://codereview.chromium.org/1554133003 . (cherry picked from commit d368261cc8d604286e29ca6358700e6bb051dcaa) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1567643002 .
2016-01-05Merge to XFA: Document::DoAnnotDelay and m_DelayAnnotData member unused.Tom Sepez
Orignal Review URL: https://codereview.chromium.org/1565613002 . (cherry picked from commit 685c3130da63bd1eea1281f29bf1ee4f22f03129) R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1562653002 .
2016-01-05Merge to XFA: Remove header files that only have includes.Lei Zhang
Also do some cleanups in affected files. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1552583002 . (cherry picked from commit d794d34b5deb6ad691c19af758090f9ce46015a3) Review URL: https://codereview.chromium.org/1566583002 .
2016-01-05Merge to XFA: Replace IconTree class with std::list.Tom Sepez
Original Review URL: https://codereview.chromium.org/1566433003 . (cherry picked from commit cc3727f88e48f4d26a589131dc03adca4eaac301) R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1560333002 .
2016-01-05Merge to XFA: Make more CPDF_Parser method const.Lei Zhang
TBR=weili@chromium.org Review URL: https://codereview.chromium.org/1549103002 . (cherry picked from commit a3235d0f5ca92c89b1de0f135a05e9891e499fb9) Review URL: https://codereview.chromium.org/1560183003 .
2016-01-05Merge to XFA: Add embedder test for fpdfsave.cpp and bug 342Tom Sepez
Original Review URL: https://codereview.chromium.org/1556033002 . (cherry picked from commit 603533fb0e5968923d67c1d8f2e00a640f41b5e5) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1563483003 .
2016-01-05Merge to XFA: Exit infinite loops for cross reference loadingWei Li
When cross reference sections form a loop, our code will enter an infinite loop. Add detection and exit code for v4 cross reference loading. V5 loading was done previously. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1558093002 . (cherry picked from commit aab8f462ea3368ed4825172231131e1a10db978d) Review URL: https://codereview.chromium.org/1556423002 .
2016-01-05Merge to XFA: Make FPDF_WIDESTRING work regardless of endianness.Tom Sepez
Original Review URL: https://codereview.chromium.org/1554363002 . (cherry picked from commit ed34cdf99d5a4b33e57f81f9244a311f6fb86db3) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1559373002 .
2016-01-04Merge to XFA: Cover FPDFBookmark_Find() with embedder tests.Tom Sepez
Original Review URL: https://codereview.chromium.org/1559043006 . (cherry picked from commit 5dac8047f02c937a5a3546a8cc5b352db2188d97) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1553313002 .
2016-01-04Merge to XFA: Add FPDFDoc_GetPageMode() embeddertestTom Sepez
Original Review URL: https://codereview.chromium.org/1557173002 . (cherry picked from commit 14fdb1d40741912e430db4318a9033764429659f) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1556983003 .
2015-12-29Merge to XFA: Fix partial information printed with blank window covering the ↵Jun Fang
center BUG=482206 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1551563002 . Review URL: https://codereview.chromium.org/1552643002 .
2015-12-28Merge to XFA: Take care fall-through cases of switch in pdfiumLei Zhang
Found with Clang's -Wimplicit-fallthrough option by tzik@chromium.org. TBR=tzik@chromium.org Review URL: https://codereview.chromium.org/1549283002 . (cherry picked from commit de0387c3690ca147482ed943c70eeb828b6dd732) Review URL: https://codereview.chromium.org/1554453002 .
2015-12-25Merge to XFA: Speculative IWYU fix for failing Chromium DEPS roll.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1546133002 . (cherry picked from commit 1f1c1970259b696a9b1e5ca1a3c199f221846409) Review URL: https://codereview.chromium.org/1542403002 .
2015-12-24Merge to XFA: Fix a bad virtual keyword removal from commit 0f6b51c.Lei Zhang
BUG=546744 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1542373002 . (cherry picked from commit ae58ed8bccc56dd78c12d89972b19d58de94f790) Review URL: https://codereview.chromium.org/1548093002 .
2015-12-24Merge to XFA: Switch from nonstd::unique_ptr to std::unique_ptr.Lei Zhang
TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/1547833002 . (cherry picked from commit d20dfba2ae10e8aeb328328f09da79ff904110a8) Review URL: https://codereview.chromium.org/1545183002 .
2015-12-22Merge to XFA: Cleanup: Remove some dead code in CPWL_Note.Lei Zhang
TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1544953002 . (cherry picked from commit cd0ade6f77b1a3e7c340a05bc6cb448f52e9bb96) Review URL: https://codereview.chromium.org/1547843003 .
2015-12-22Merge to XFA: Add ContainsKey() and ContainsValue() and use them where ↵Lei Zhang
appropriate. TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1540263003 . (cherry picked from commit 1fc92867ca53f0fba4272fbee3814d844f487495) Review URL: https://codereview.chromium.org/1542193002 .
2015-12-21Merge to XFA: Cleanup CJS_PublicMethods:Lei Zhang
- Use FXSYS_iswdigit() instead of CJS_PublicMethods::IsDigit(). - Ditto for FXSYS_iswalpha() and FXSYS_iswalnum(). - Change CJS_PublicMethods::ParseNormalDate() and CJS_PublicMethods::MakeRegularDate() to take an out parameter by ptr. TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1539113002 . (cherry picked from commit f84fd2b1dac1fcca41db84d162995c38af650614) Review URL: https://codereview.chromium.org/1542693002 .
2015-12-21Merge to XFA: Fix JS seconds since epoch to date conversions.Lei Zhang
BUG=515137,564736 TBR=ochang@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1533233002 . Review URL: https://codereview.chromium.org/1544493003 . (cherry picked from commit b426e3edde040089b70d1a223c83b90957aa571d) (cherry picked from commit bd35d484a4027775f19ff93e9143e0b270133d42) Review URL: https://codereview.chromium.org/1546443002 .
2015-12-18Merge to XFA: Get rid of a few CPDF_Object Create() methods and just use new ↵Lei Zhang
instead. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1540693002 . (cherry picked from commit d866ab0b44a571c884fdd8ba5a5319adaf607559) Review URL: https://codereview.chromium.org/1541563002 .
2015-12-17Merge to XFA: Tidy CPDF_RenderContextTom Sepez
Original Review URL: https://codereview.chromium.org/1536623004 . (cherry picked from commit 761660c4074269ac806d06c9bef70e4e9fb0eb29) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1531423002 .
2015-12-16Fix memory leaking in FPDF_LoadCustomDocument()Jun Fang
BUG=pdfium:245 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1526873006 .
2015-12-14Merge to XFA: Get rid of most instance of 'foo == NULL'Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1520063002 . (cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff) Review URL: https://codereview.chromium.org/1528763003 .
2015-12-14Merge to XFA: Get rid of most instance of 'foo != NULL'Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 . (cherry picked from commit e3c7c2b54348da4a6939f6672f6c6bff126815a7) Review URL: https://codereview.chromium.org/1529553003 .