summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi
AgeCommit message (Collapse)Author
2016-02-17Banish CFX_ObjectArray to the XFA side.Tom Sepez
Tidy whitespace, add missing consts in a few places. Remove a few pointless typedefs. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1707953002 .
2016-02-17Remove CFX_PtrList from renderer main loop.Tom Sepez
Exposes an iterator over the object list, but not the object holder, since pages and forms inherit from object holder, and we don't want to imply that there's only one thing that might be iterated over for those classes. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1700183002 .
2016-02-16Split CPDF_PageObjectHolder off from CPDF_PageObjectListTom Sepez
Eventually, we're going to expose an iterator over CPDF_PageObjectList that we don't want to be inherited by the CPDF_PageObjectHolder sub-classes: page and form. Also, the operations that the object holder performs dealing with inquiring about masks and such seem beyond the scope of what a list would provide. Hence the "Holder" name. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1701073002 .
2016-02-16Refactor CPDF_SimpleParser and add unit tests.Wei Li
Remove unused member functions and simplify calls to find tag parameters. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1681403007 .
2016-02-16Rework progressive render loop.Tom Sepez
Migrating this off of CFX_PrtList depends on first making this saner. The tricky part is checking whether new objects have been added to a partially-parsed layer. The old code used to do this by keeping track of the last element in the list, and seeing if it changes. It's far simpler to keep track of the last element processed, and just keep looking for more objects after it with each pass. Fold together some duplicated blocks along the way. Remove unused EstimateProgress() method. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1699443002 .
2016-02-12Fix the way to access marked content.Wei Li
When there is no dictionary for marked content, it potientially may cause crash. But it is not happening now since 1) we now check for the returned dict parameter 2) the alloc function in pdfium does zero initialization. BUG=pdfium:67 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1695633004 .
2016-02-11Remove unused NormalizeString()Tom Sepez
- NormalizeString() has 1 caller: - CTextBaseLine::WriteOutput(), which has only 1 caller: - CTextPage::WriteOutput(), which has only 1 caller: - PDF_GetPageText_Unicode(), which has only 1 caller: - PDF_GetPageText(), which has no callers. Removing this also makes CheckRotate(), NormalizeCompositeChar(), and CTextPage unused. Removing those makes CTextBaseline() unused. Removing that makes txtproc.h unused. PDF_GetTextStream_Unicode also unused. ... and so on until entire files can be removed. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1689843002 .
2016-02-08Tidy fpdfsave.cppTom Sepez
Remove CFX_PtrArray filelist. Promote ScopedFileStream to .h file and use it. Fix _CAPS names, bool returns, and put in anonymous namespace. FX_CreateMemoryStream() can't return null, so remove checks. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1672153002 .
2016-02-05Remove CFX_FileSizeArray.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1671113002 .
2016-02-04Use full include path in core/include/fpdfapiTom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1669113002 .
2016-02-03Merge to XFA: Complete unit tests for CPDF_ArrayWei Li
Also remove one unnecessary member function. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1660523003 . (cherry picked from commit 6f358daa2e8b1639a1c3a3f07a449f8450197e8b) Review URL: https://codereview.chromium.org/1667873002 .
2016-02-01Merge to XFA: Remove the m_ObjVersion member variable from CPDF_Parser.Lei Zhang
Use the gennum field in the m_ObjectInfo map instead. BUG=pdfium:111 R=weili@chromium.org TBR=weili@chromium.org Review URL: https://codereview.chromium.org/1654303002 . (cherry picked from commit a620372c9e1d0ff825bcbe6620fe7e1b63c769c2) Review URL: https://codereview.chromium.org/1653023004 .
2016-02-01Merge to XFA: Remove the m_V5Type member variable from CPDF_Parser.chromium/2641chromium/2640chromium/2639chromium/2638Lei Zhang
Use the type field in the m_ObjectInfo map instead. BUG=pdfium:111 TBR=weili@chromium.org Review URL: https://codereview.chromium.org/1650793002 . (cherry picked from commit 93c196d868535f684007a7d3ed1f7146851a0ab9) Review URL: https://codereview.chromium.org/1652083004 .
2016-01-29Merge to XFA: Refactor CPDF_Object and its subclasses.Wei Li
Mainly use virtual functions to replace functions with switch statements. Also remove a few unused functions and make some format changes. BUG=pdfium:63 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1634373003 . (cherry picked from commit df1ab41e000069dda7bf21527308f3bf41e126ca) Review URL: https://codereview.chromium.org/1650493003 .
2016-01-29Another round of cleanup in CPDF_Parser and friends.Lei Zhang
- Remove dead code. - Add more public methods and remove friends. TBR=weili@chromium.org Review URL: https://codereview.chromium.org/1566133002 . (cherry picked from commit 9e8185948f7631515951770ca8778f42cc9fd2fc) Review URL: https://codereview.chromium.org/1649233002 .
2016-01-29Merge to XFA: Member function name refactoringWei Li
This is needed by Cl 1634373003 as the name collision with virtual functions will be shown as warnings on Linux. Also, it is better to use different names for different cases. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1644633003 . (cherry picked from commit d45e7a51904164fb22049f0a7a80d2a94c06936b) Review URL: https://codereview.chromium.org/1648233002 .
2016-01-26War on #defines - part 2Tom Sepez
Introduce CPDF_Parser::Error. Introduce CPDF_Color::Type. Unused XFA_DATASETS and XFA_FORMS defines. Move FPDF_CreateStandardSecurityHandler() prototype to header. Delete prototype for nonexistent FPDF_CreatePubKeyHandler(). Make PBS_* defines local to .cpp file. Tidy whitespace. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1634123004 .
2016-01-26Merge to XFA: War on #defines, part 1.Tom Sepez
Contains additional XFA-specific changes. Original Review URL: https://codereview.chromium.org/1632143002 . (cherry picked from commit 66a9dc9dd65ed2b9c7ede448d046b770140f16d5) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1636503006 .
2016-01-25Remove several more unused parser values.Tom Sepez
unused progressive enum unused members m_bFileStream, m_dwWordPos Remove PDFWORD_* types R=thestig@chromium.org Review URL: https://codereview.chromium.org/1634683003 .
2016-01-25Remove struct PARSE_OPTIONS.Tom Sepez
Its members are assigned to, but never used in any calculations (besides for other members). R=thestig@chromium.org Review URL: https://codereview.chromium.org/1630973002 .
2016-01-25Remove unused IsContentUsedElsewhere()Tom Sepez
Then CPDF_Object::GetDirectType() becomes unused. Then GetIndirectType() becomes unused. Then PDFPARSE_TYPEONLY becomes unused. Then we can remove hideous casts of ints to ptrs. Also, PDFPARSE_NOSTREAM is unused. Then we can remove m_Flags from PARSE_CONTEXT. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1638493002 .
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: Replace more CFX_MapPtrToPtr.Tom Sepez
Original Review URL: https://codereview.chromium.org/1580573002 . (cherry picked from commit a505d9d3e13485e090e50d5d83f882fb707d3f48) R=ochang@chromium.org Review URL: https://codereview.chromium.org/1610163003 .
2016-01-19Merge to XFA: Remove an extra "const" in fpdf_objects.Oliver Chang
TBR=weili@chromium.org Original Review URL: https://codereview.chromium.org/1602323002 . (cherry picked from commit b196c7bebad66c9938d2705ccf64961bcdd774e2) Review URL: https://codereview.chromium.org/1607473008 .
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: 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-13Merge to XFA: Fix out of bound access in CPDF_Parser::ParseIndirectObject().Lei Zhang
This regressed in commit f6dafc9. BUG=576915 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1582763002 . (cherry picked from commit e02f30bb59b01c159b010fc5c6bb55e677aba8ce) Review URL: https://codereview.chromium.org/1584663003 .
2016-01-13Merge to XFA: Use the compiler to type check DocAvailStatus return values.Lei Zhang
TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1575363007 . (cherry picked from commit 2fa5c7a8b6602bb2fe1df7cd09b12de666ca8a0a) Review URL: https://codereview.chromium.org/1585773002 .
2016-01-12Merget to XFA: Use std::map in CPDF_IndirectObjectsTom Sepez
Review URL: https://codereview.chromium.org/1576113003 . (cherry picked from commit fce548047a44c7015996874452f3e778bf64cad6) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1579693004 .
2016-01-11Merge to XFA: Tidy up shading patternsTom Sepez
Original Review URL: https://codereview.chromium.org/1570873005 . (cherry picked from commit a07804a3b16c10fa2011ef56d1dacefb7d21e4f6) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1577893002 .
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: 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-06Merge to XFA: Change CPDF_SyntaxParser::GetNextWord() to not pass by ↵Lei Zhang
non-const ref. Change the internal version to GetNextWordInternal(). TBR=weili@chromium.org Review URL: https://codereview.chromium.org/1558083002 . (cherry picked from commit 61197421793e24add7a250d3f15ab83dc75f80c6) Review URL: https://codereview.chromium.org/1561093002 .
2016-01-05Merge to XFA: Replace CPDF_SortObjNumArray with a std::set.Lei Zhang
R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1566553002 . (cherry picked from commit 6caae4d3c6815c5a1e12340734412a3bc7548652) Review URL: https://codereview.chromium.org/1561853002 .
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: Fix a few uses of default arguments.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1555293002 . (cherry picked from commit dbfaa8d11404a53b4807b3dbd0185047367bbff6) Review URL: https://codereview.chromium.org/1565603002 .
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-04Merge to XFA: Remove CPDF_Creator::m_ObjectSize, it's never read from.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1543413002 . (cherry picked from commit 03f5040cbe03cc93e133cb98ecce6725e2679170) Review URL: https://codereview.chromium.org/1555193002 .
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-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: Convert CPDF_Parser::m_CrossRef to a std::map.Lei Zhang
This improvements memory usage in case PDFs have sparse object numbers. The map holds a struct that currently has only one member. The struct will contain more members as other internal data structures get converted. BUG=pdfium:111 TBR=weili@chromium.org Review URL: https://codereview.chromium.org/1539573003 . (cherry picked from commit f6dafc90ec1a0df8d618efc68c0223f0cdd80ffb) Review URL: https://codereview.chromium.org/1544913002 .
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-18Remove CFX_MapPtrToPtr in CFX_PageRenderCacheTom Sepez
Rename CPDF_ImageCache to CPDF_ImageCacheEntry because it represents a single entry, not the entire cache itself. Delete unused ClearRenderCache method, and merge cache entry clear() into its dtor. Fix a broken size calculation. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1539983002 .
2015-12-18Merge to XFA: CPDF_QuickStretcher unused.Tom Sepez
Original Review URL: https://codereview.chromium.org/1537103002 . (cherry picked from commit f0f6a01ee3dcb592e4eeaadaa2ea52c2fce317ba) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1540683002 .
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-15Merge to XFA: Fix free entry handling for cross reference v4 reading.Wei Li
While reading free entries in v4 cross reference table, changing the start_objnum caused crossref table built wrong. BUG=569795 TBR=jun_fang@foxitsoftware.com, thestig@chromium.org Review URL: https://codereview.chromium.org/1527823003 . (cherry picked from commit c89cd979fb8654d85b822909cba9263d5f13760c) Review URL: https://codereview.chromium.org/1528153003 .