summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi/fpdf_parser.h
AgeCommit message (Collapse)Author
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-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 .
2015-12-14Merge to XFA: Remove FX_BSTRC.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1521563002 . (cherry picked from commit 1956a174020686f91cd3b34294e91f4560fe45aa) Review URL: https://codereview.chromium.org/1526823002 .
2015-12-10Merge to XFA: Remove CFX_AffineMatrix/CPDF_MatrixTom Sepez
Review URL: https://codereview.chromium.org/1513363002 . (cherry picked from commit f32c969bce6743fca1e7ff796b54a1692d26d7f0) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1519693002 .
2015-12-09Merge to XFA: Prevent infinite looping in CPDF_Parser::LoadAllCrossRefV5().Lei Zhang
BUG=pdfium:298 TBR=weili@chromium.org Review URL: https://codereview.chromium.org/1496703005 . (cherry picked from commit 93181f9a20db7ac706bb9405750303db93762a5b) Review URL: https://codereview.chromium.org/1514783002 .
2015-12-09Merge to XFA: Get rid of most uses of CFX_PtrArray.Tom Sepez
Original Review URL: https://codereview.chromium.org/1518593002 . (cherry picked from commit 035359cd8ddb555fa33b6133db4fd405e4660712) R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1513103002 .
2015-11-20Make XFA core/ look like master (part N).Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1463173003 .
2015-11-20Update XFA fpdfsdk to match masterTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1465663002 .
2015-11-19Merge to XFA: Cache object numbers in CPDF_Parser::ParseIndirectObject().Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1458633004 . (cherry picked from commit 0c8e6c1f39f20985a3efb17292e46c476194183a) Review URL: https://codereview.chromium.org/1461693005 .
2015-11-12Merge to XFA: Remove relative includes.Lei Zhang
That refer to parent directories. TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1434223002 . (cherry picked from commit 22bc4227fbbda5a5e9abad2a2c0a98c04fe7f228) Review URL: https://codereview.chromium.org/1439223003 .
2015-11-10Merge to XFA: Support linearized loadingJun Fang
BUG=446715 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1353093003 . Conflicts: core/include/fpdfapi/fpdf_parser.h core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp samples/pdfium_test.cc testing/embedder_test.cpp testing/embedder_test.h Review URL: https://codereview.chromium.org/1412083010 .
2015-11-06Merge to XFA: Fix all relative includes to third_party.Lei Zhang
- In non-standalone builds, use the provided jpeg library. - Run gn format over all the GN files. - Also roll DEPS for buildtools to c2f2598. - And fix XFA's lack of #includes. BUG=541704 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1425153006 . (cherry picked from commit 34bb6c58fe60206a08dc0a1f37b7cfe83e8c762c) Review URL: https://codereview.chromium.org/1434543003 .
2015-11-03Merge to XFA: Add test for CPDF_SyntaxParser::ReadHexString.Dan Sinclair
This CL adds tests for the ReadHexString method of the syntax parser. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1433503002 . (cherry picked from commit 71ad9a0028a183605fba734c48b4756d6caa7754) Review URL: https://codereview.chromium.org/1424923007 .
2015-11-02Merge to XFA: Add a test for the HexDecode method.Dan Sinclair
I moved the declaration to be public, instead of having it implicit in one file and defined in a seperate cpp file. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1410873009 . (cherry picked from commit e948a4ee08b78e27da37bc12244fa1b66d927dc7) Review URL: https://codereview.chromium.org/1432513002 .
2015-10-28Merge to XFA: Add PDFCharIsLineEnding helperDan Sinclair
This CL adds a helper to check if a given character is a \n or \r. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1418073006 . (cherry picked from commit 4b38229b004b7b6493cb4c4507df450adc6085f6) Review URL: https://codereview.chromium.org/1428763002 .
2015-10-28Merge to XFA: Add helpers to check the PDF_CharType.Dan Sinclair
This CL adds helpers to provide more descriptive access to PDF_CharType. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1407913004 . (cherry picked from commit e3e5675bcdd26b8df7286e10a42d585df6d2321d) Review URL: https://codereview.chromium.org/1419893004 .
2015-10-23Merge to XFA: Convert some pointers in fpdf_parser_parser to unique_ptr and ↵Oliver Chang
std::vector. Clean merge. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1411043003 . (cherry picked from commit bef190fcacb7dde4fedc1360e3019ab9968db16a) Review URL: https://codereview.chromium.org/1418223004 .
2015-10-02Merge to XFA: Get rid of gotos in CPDF_SyntaxParser and FlateUncompress().Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1360103002 . (cherry picked from commit b8a074711108baf04017d86207e08c19ff327d8e) Review URL: https://codereview.chromium.org/1384123002 .
2015-09-25Merge to XFA: Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf filesLei Zhang
Pdfium swallows 'fi' or 'ff' in some tested files because it doesn't load the embedded font file correctly. The root cause is that there is incorrect keyword like 'ngendstream' in the stream of the embedded font file. Pdfium tries to find another correct keyword but uses wrong offset rather than accumulated offset. BUG=524043 TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1307353005 . (cherry picked from commit 9bd18183ba8210c91d71c3060146235750a4c71c) Review URL: https://codereview.chromium.org/1365253003 .
2015-08-19Merge to XFA: Extern in .cpp file is a code smell, part 2.Tom Sepez
(cherry picked from commit c3f4894a6862c74b9ab32b4ec38c531de6ecd83c) Original Review URL: https://codereview.chromium.org/1298393003 . Fixed IWYU in core/src/fpdftext/text_int.h exposed by new inclusion. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1294933008 .
2015-08-19Merge to XFA: Extern in .cpp files is a code smell, part 1.Tom Sepez
(cherry picked from commit 71c15a5e6652952a94ba3a3ef7ac0392e3a06962) Original Review URL: https://codereview.chromium.org/1299963002 . R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1301073003 .
2015-08-14Merge to XFA: Use override in more classes in core/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1292613003 . (cherry picked from commit c2c3f7b5f0396409451a9d344f35ec1929a76e9f) Review URL: https://codereview.chromium.org/1296043002 .
2015-08-05Merge to XFA: Early object closing in PDF via premature 'endobj' keywordJUN FANG
Adobe acrobat defines keywords "\nendstream\n" and "\nendobj\n" in object's stream. However, Pdfium searches "endstream" and "endobj" as the keywords in the streams of objects. Some words like "(endstream)" are wrongly treated as keywords in pdfium. This fix follows Adobe's solution. BUG=493126 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1219133005 .
2015-08-05Merge to XFA: CPDF_Parser shouldnt be in the business of opening filesTom Sepez
(cherry picked from commit 2b9178181eb82a3611bee5c9435ea5956def24be) Orignal Review URL: https://codereview.chromium.org/1269073003 . TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1278533002 .
2015-08-04XFA: clang-format all pdfium code.Nico Weber
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
2015-07-27Merge to XFA: Fix FX_BOOL compilation errors under windowsTom Sepez
(cherry picked from commit a25b4bca69ab26d174edb8cefbdcfc1a0353915a) Original Review URL: https://codereview.chromium.org/1254973004 . TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1252943010 .
2015-06-19Merge to XFA: Do some IWYU cleanups.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1176333002. (cherry picked from commit 0ef0de55657db8a83372ad8eb22d84c5893afc4c) Review URL: https://codereview.chromium.org/1195943005.
2015-06-13Merge to XFA: Remove unneeded checks in ↵Lei Zhang
CPDF_DocPageData::GetFontFileStreamAcc(). The input cannot be null. Same for CPDF_Document::LoadFontFile(). Also set the contract for CPDF_Document::LoadFont() and adjust callers accordingly. Also remove unused CPDF_Document::FindFont(). R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1184673002. (cherry picked from commit 1972b16849fedfda675eacd5c8594b54dbd1264d) Review URL: https://codereview.chromium.org/1181393002.
2015-06-13Remove trailing whitespaces in core, XFA edition.Lei Zhang
Review URL: https://codereview.chromium.org/1180333002.
2015-06-10Merge to XFA: Remove FX_BSTR and FX_WSTR typedefs.Tom Sepez
Nearly automatic merge + re-run script on new files. Original Review URL: https://codereview.chromium.org/1180593004. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1174303002.
2015-06-10Merge to XFA: Remove typdefs for pointer types in fx_system.h.Tom Sepez
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
2015-06-09Merge to XFA: Use stdint.h types throughout PDFium.Tom Sepez
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
2015-06-03Merge to XFA: Kill unused IPDF_ classes.Tom Sepez
Original Review URL: https://codereview.chromium.org/1168503003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1153033009
2015-06-02Merge to XFA: kill IPDF_DocParser().Tom Sepez
Original Review URL: https://codereview.chromium.org/1158053003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1156203004
2015-05-28Merge to XFA: Fix ALL the include guards.Tom Sepez
Original Review URL: https://codereview.chromium.org/1160443004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1162013003
2015-04-27Merge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString().Tom Sepez
Original Review URL: https://codereview.chromium.org/1101933003 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1108903002
2015-04-14Merge to XFA: Kill CFX_Object.Tom Sepez
Not just a simple merge, but changes to remove CFX_Object from XFA. Original Review URL: https://codereview.chromium.org/1088733002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1087053002
2015-02-05Kill off some dodgy JS callbacksTom Sepez
None of these are currently reachable because the IsSafeMode method always returns true. This, in turn, will let us kill off some file (as in fopen()) based parsing. That, in turn, will let us kill of some more now-unreachable code. In general, we don't want to have unsafe modes. BUG=https://code.google.com/p/pdfium/issues/detail?id=116 R=jam@chromium.org Review URL: https://codereview.chromium.org/883393007
2015-01-27Merge to XFA: Kill scattered extern _PDF_CharType declarations.Tom Sepez
TBR=brucedawson@chromium.org Original Review URL: https://codereview.chromium.org/880663003 Review URL: https://codereview.chromium.org/884473003
2015-01-26Merge to XFA: Fix infinite recursion in CPDF_Parser::ParseIndirectObjectAt().Tom Sepez
Orignal Review URL: https://codereview.chromium.org/875263002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/880753002
2015-01-22Merge to XFA: Use IPDF_DataAvail interface to hide CPDF_DataAvail.Tom Sepez
Original CL at https://codereview.chromium.org/873523002/ TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/871773002
2015-01-09merge to XFA: Fix -Wnon-virtual-dtor compiler warnings.Tom Sepez
Original at URL: https://codereview.chromium.org/810883005 Note that the new code in XFA introduces many more of these, to be handled separately. TBR=brucedawson@chromium.org TBR=thestig@chromium.org BUG=https://code.google.com/p/pdfium/issues/detail?id=102 Review URL: https://codereview.chromium.org/842223004
2014-08-25Use number of components from ICC profile and alternate color spaceBo Xu
BUG=406806 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/503883002
2014-08-25Revert of Use number of components from ICC profile and alternateCS ↵Bo Xu
(patchset #1 of https://codereview.chromium.org/493163003/) Reason for revert: Needs to address comments before landing Original issue's description: > Use number of components from ICC profile and alternate color space > > BUG=406806 > > Committed: https://pdfium.googlesource.com/pdfium/+/be83103 TBR=tsepez@chromium.org,jun_fang@foxitsoftware.com NOTREECHECKS=true NOTRY=true BUG=406806 Review URL: https://codereview.chromium.org/504883003
2014-08-25Use number of components from ICC profile and alternate color spaceBo Xu
BUG=406806 Review URL: https://codereview.chromium.org/493163003
2014-08-22Fix the issue 'SEGV on unknown address in CPDF_DataAvail::GetObjectSize'Jun Fang
BUG=387983 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/454283002
2014-08-13Add FX_OVERRIDE and use it for virtual functions of FX_FINAL classes.Tom Sepez
Should there be cases where this fails to compile, it indicates a mistake, either an incorrectly declared overrriden virtual method, or a method that should be declared non-virtual. The only issues were with CPDF_CustomAccess::GetBlock(), CPDF_CustomAccess::GetByte(), and CPDF_CustomAccess::GetFullPath(). These don't appear to be used anywhere, and are removed. Two members are removed that are no longer needed once those methods are removed. R=jam@chromium.org, jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/454983003
2014-07-18pdfium: Fix all -Wdelete-non-virtual-dtor violations on Mac.Nico Weber
Calling `delete` on an object of a type that has virtual functions but not a virtual destructor is questionable: Since the object has virtual functions, it likely has subclasses, so if it's deleted through the base pointer and the destructor isn't virtual, the subclass destructor won't be called. In most cases, the classes getting deleted can just be marked final to tell the compiler that it can't possibly have subclasses (this also enables the compiler to generate better code). Two classes didn't have any sub- or superclasses but virtual functions - this doesn't make sense, so make all methods of these classes non-virtual. (Also delete an unused function on one of the two classes.) In one case, a class actually did have a subclass that needs to be deleted virtually, so mark one destructor as virtual. BUG=none R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/370853002
2014-05-23Convert all line endings to LF.John Abd-El-Malek