summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_parser
AgeCommit message (Collapse)Author
2016-03-09Split off IPDF_CryptoHandler into its own .cpp/.h files.Tom Sepez
CPDF_CryptoHandler was always a pure-virtual class, now it is named as IPDF_ to indicate this. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1782673002 .
2016-03-09Move ScopedSetInsertion to third_party/base/stl_util.hTom Sepez
Also move ScopedFileStream, since it isn't specific to the parser, and belongs with the fxcrt object it manipulates. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1780063003 .
2016-03-09Move CPDF_NumberTree to fpdfdoc.Tom Sepez
It's not used anywhere in fpdfapi, and can become restricted to fpdfoc/. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1776713004 .
2016-03-09Fix build broken at ca78d9a52893Tom Sepez
Move time.h inclusion to new file. TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1778893003 .
2016-03-09Split off IPDF_SecurityHandler and CPDF_StandardSecurityHandler.Tom Sepez
R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1781593003 .
2016-03-09Fix build broken at 8388037a5c58Tom Sepez
Missing explicit include of <vector> TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1783433004 .
2016-03-09Split off CPDF_Parser and CPDF_SimpleParser into .h/.cpp filesTom Sepez
R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1773103003 .
2016-03-09Review and cleanup lint warnings.Dan Sinclair
This CL goes through the remaining list of list warnings and records why they are currently blacklisted, or fixes and enables them. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1773733002 .
2016-03-08Split off CPDF_Document into its own .cpp/.h files.Tom Sepez
R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1780503002 .
2016-03-08Re-land "Split CPDF_SyntaxParser into its own named .cpp/.h files."Tom Sepez
This reverts commit 06fae28d307fe051f0c7e890344cd487c2260910. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1775023003 .
2016-03-08Revert "Split CPDF_SyntaxParser into its own named .cpp/.h files."Tom Sepez
This reverts commit d50095fb151688e119a7097aabce11e4b3d36244. Reason for revert: build broken. TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1774293002 .
2016-03-08Split CPDF_SyntaxParser into its own named .cpp/.h files.Tom Sepez
BUG= R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1774753002 .
2016-03-08Reland "Fix chromium-style errors."Dan Sinclair
This reverts commit 594912241cd7d409b5f58a48ccffdc1904d844b2. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1769273002 .
2016-03-07Revert "Fix chromium-style errors."Dan Sinclair
This reverts commit c582c0ddfea8ba01c8449ed7841cdb33c12e0a98. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1769263002 .
2016-03-07Fix chromium-style errors.Dan Sinclair
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1772543003 .
2016-03-03Combine StrToInt methods.Dan Sinclair
This Cl combines the two StrToInt implementations. In doing so I had to add some more overrides to toDecimalDigit() and add a isDecimalDigit(). BUG=pdfium:423 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1757283002 .
2016-03-03Fixup chromium-style warnings in fpdf_objects.hDan Sinclair
This CL fixes up chromium-style warnings in fpdf_object.h Specifically, the warnings fixed were: * Complex constructor has an inlined body. * Complex destructor has an inline body. * virtual methods with non-empty bodies shouldn't be declared inline. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1764793002 .
2016-03-03Fix parsing of object numbers > 16,777,216.Dan Sinclair
Currently, there is a check that an object number is <= 0x1000000. If that check fails, we end up putting the parser into a bad state and fail to load documents. The object does not need to be in the XRef table, or referenced from the document, just be in the document. This Cl removes the size check and updates the various atoi calls to use a uint32_t instead of an int32_t so we don't end up getting strange values when converting from a string. BUG=455199 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1755273002 .
2016-03-01This Cl adds some whitespace and other formatting while removing some braces ↵Dan Sinclair
and making bits of the code simpler. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1742273002 .
2016-02-26Re-land "Replace CPDF_Rect and CPDF_Point with CFX types."Tom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1737593006 .
2016-02-26Revert "Replace CPDF_Rect and CPDF_Point with CFX types."Tom Sepez
This reverts commit 3b8fdd34bdf57ec45291b77008a43249f838efcb. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1743753002 .
2016-02-26Replace CPDF_Rect and CPDF_Point with CFX types.Tom Sepez
Too many rectangle types. Remove CPDF_Rect #define, and make an equivalent point type in CFX, but stop short of consolidating the N different forms of rectangles in CFX. Also banish PDF_ClipFloat to the one .cpp file that needs it, since it was in the vicinity of the .h file changes. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1740923003 .
2016-02-24Clean up some if/else if statements in CPDF_Parser::RebuildCrossRef().Lei Zhang
R=weili@chromium.org Review URL: https://codereview.chromium.org/1725133004 .
2016-02-23Remove uses of this->foo.Lei Zhang
R=weili@chromium.org Review URL: https://codereview.chromium.org/1722913002 .
2016-02-23Remove many _CAPS structure names.Tom Sepez
They're technically not allowed because they are reserved for the preprocessor. Also get rid of LPC* typedefs along the way. Also provide a header for a data file containing many instance of these found along the way. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1722873002 .
2016-02-19Revert "Revert "Use safe arithmentic in CFX_BinaryBuf::ExpandBuf.""Tom Sepez
This relands the CL at https://codereview.chromium.org/1710403002 Tests passed locally. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1717603003 .
2016-02-19Revert "Use safe arithmentic in CFX_BinaryBuf::ExpandBuf."Tom Sepez
This reverts commit 78353d5dbc0b0c9b2d6946005439a51efa7d108c. Reason for revert Failed tests. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1719493002 .
2016-02-19Get rid of CFX_CharMap instantiations.Lei Zhang
The only thing left are a couple of static methods. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1711273002 .
2016-02-19Use safe arithmentic in CFX_BinaryBuf::ExpandBuf.Tom Sepez
Always call ExpandBuf(), and if it returns, we know the subsequent calculations won't overflow. Also use std::unique_ptr, and fix unintentional copies thus detected by its suppressed copy ctor in fsdk_baseform.cpp Also Remove unused CFX_BinaryBuf::TakeOver(), AppendFill(), CopyData(). Also remove operator= in favor of using <<, for similarity with std::ostream and friends. Also move ByteStringC methods to CFX_ByteTextBuf sub-class. Also re-order members, may pack tighter on 64-bits. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1710403002 .
2016-02-18Name the states for fpdf_parser_parser.Dan Sinclair
Currently the states are numbers, use names instead to make the code clearer where things are transitioning too. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1715483002 .
2016-02-17Banish CFX_ByteArray and CFX_WideArray to the XFA side.Tom Sepez
Fix IWYU and include paths as we go. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1701883004 .
2016-02-16Fix name change after rebase 970c11eWei Li
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1705553002 .
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-16Simplify string function test macroWei Li
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1701123002 .
2016-02-09Add unit tests for ascii85 and hex decoders.chromium/2652chromium/2651chromium/2650chromium/2649chromium/2648chromium/2647chromium/2646Wei Li
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1666663004 .
2016-02-08Fix for-loop which results in no-opLei Zhang
The existing code (added in https://codereview.chromium.org/1650793002/) changes the state of a copy of the object. Original CL: https://codereview.chromium.org/1679783002/ Original Author: hashimoto@chromium.org R=hashimoto@chromium.org Review URL: https://codereview.chromium.org/1681863002 .
2016-02-08Convert NULLs to nullptrs in fpdf_parser_decode.cppOliver Chang
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1680923002 .
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-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-27XFA: Fix DOS newlines, final round.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1641963002 .
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: Move struct ContentParam off of CPDF_Object's enumsTom Sepez
Original Review URL: https://codereview.chromium.org/1635173003 . (cherry picked from commit 0ec8bb4486ab315283f36d071be2ddc1b80998c3) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1636133002 .
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 .