Age | Commit message (Collapse) | Author |
|
This reverts commit 23d576f0b498bd4f37ef2175916223a2e5ea0324.
Cleanup some numeric code.
This changes the various comparisons of char >= '0' && char <= '9' and
char < '0' || char > '9' to use std::isdigit checks. It also cleans up
a handful of hex to digit conversions to call one common method.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1405253007 .
|
|
This CL adds tests for the numeric conversion done when calculating the format
percision and width fields.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1411973005 .
|
|
This size is different on Windows vs Mac and Linux. Need to use numeric_limits
instead of a hard coded value.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1414793010 .
|
|
This CL adds tests for the ReadHexString method of the syntax parser.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1433503002 .
|
|
This CL adds a unit test for the ReadHexString method.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1408213008 .
|
|
Check fseek() return values too.
BUG=549998
R=thakis@chromium.org
Review URL: https://codereview.chromium.org/1419793003 .
|
|
This CL adds tests for the CMap_GetCode and CMap_GetCodeRange methods. To do
so, it moves the methods to be static private members of CPDF_CMapParser and
makes the test class a friend.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1414013005 .
|
|
I moved the declaration to be public, instead of having it implicit in one
file and defined in a seperate cpp file.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1410873009 .
|
|
There are no uses of this method, I also checked the XFA branch and there don't
appear to be any uses there either.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1427913006 .
|
|
This CL adds a test case for the StringToCode and
StringToWideString methods in fpdf_font.cpp. In order
to do so, it moves the methods to be private methods of CPDF_ToUnicodeMap and
make the tests friends of the class.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1428593005 .
|
|
BUG=446715
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1410073009 .
|
|
BUG=446715
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1353093003 .
|
|
- Remove dead code
- Stop using CFX_PtrArray
- Mark more things const
- Fix style nits
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1425093003 .
|
|
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1414073005 .
|
|
It is unused in PDFium.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1407903005 .
|
|
BUG=pdfium:29
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1419943006 .
|
|
This reverts commit 589f7e0a57675efce9810c15a3e9b7c49bf0bc90.
Broke the build on Mac, unable to find std::isdigit.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1428853002 .
|
|
This changes the various comparisons of char >= '0' && char <= '9' and
char < '0' || char > '9' to use std::isdigit checks. It also cleans up
a handful of hex to digit conversions to call one common method.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1415933005 .
|
|
Also stray newline in fpdf_parser_document.cpp in master.
R=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1424213004 .
|
|
This CL adds a helper to check if a given character is a \n or \r.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1418073006 .
|
|
R=thestig@chromium.org
BUG=548714
Review URL: https://codereview.chromium.org/1430653002 .
|
|
This CL adds constants for some of the path operators to make it more obvious
what is being checked.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1413783009 .
|
|
When we call OpenDocument we fail to check if the document was actually opened.
Currently we return true in all cases (assuming we read the file). This CL
updates the code to check if the document was opened and return false if not.
I've updated several tests to check for FALSE instead of TRUE. I verified the
documents in fact don't open with my local (non-PDFium) PDF reader.
BUG=pdfium:223
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1417893007 .
|
|
This Cl moves all of the m_Size <= m_Pos and m_Pos >= m_Size checks to an
PositionIsInBounds() helper.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1412793008 .
|
|
This CL adds helpers to provide more descriptive access to
PDF_CharType.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1407913004 .
|
|
This Cl converts a bunch of c-style casts to static_cast<CPDF_Object*>().
BUG=pdfium:201
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1428583003 .
|
|
Currently the shading types are referenced by number. This Cl creates and enum
and updates the code to use the enum names instead of magic numbers.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1418623011 .
|
|
The m_pShadingObj can be a stream or a dictionary depending on how it's used.
This CL adds some simple type checking to make sure that the type of the
object matches what we expect.
BUG=chromium:547706
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1421973004 .
|
|
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1412823005 .
|
|
Also fix a potential object leak.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1414963005 .
|
|
Make master closer to XFA and eliminate some magic numbers.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1410823005 .
|
|
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1418263003 .
|
|
As seen in FPDFViewEmbeddertest.Crasher_451830.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1385803002 .
|
|
There appear to be a bunch of corpus tests which fail with this change such
as FAILURE: shading1.pdf
This reverts commit 85361b227ad6786d2aeef8409b79a8d077a26ee9.
Make m_pShadingObj a CPDF_Stream instead of CPDF_Object.
This object is required to be a stream and was being converted as such. With
the new type checking this caused us to pass a nullptr where previously we'd
have, incorrectly, cast a CPDF_Dictionary to a CPDF_Stream.
This CL changes the m_pShadingObj to always be a CPDF_Stream. Then, we never
go down the bad code path because we check if m_pShadingObj is nullptr earlier
and bail out.
BUG=chromium:547706
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1414283003 .
|
|
This object is required to be a stream and was being converted as such. With
the new type checking this caused us to pass a nullptr where previously we'd
have, incorrectly, cast a CPDF_Dictionary to a CPDF_Stream.
This CL changes the m_pShadingObj to always be a CPDF_Stream. Then, we never
go down the bad code path because we check if m_pShadingObj is nullptr earlier
and bail out.
BUG=chromium:547706
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1426713002 .
|
|
This reverts commit 7e155865c90cc1115cc7193b7646a341d8f9093e.
Add type cast definitions for CPDF_Reference.
This Cl adds ToReference, CPDF_Object::AsReference and CPDF_Object::IsReference
and updates the src to use them as needed.
BUG=pdfium:201
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1418923005 .
|
|
This is causing pixel test failures on the bots.
FAILURE: bug_543018_2.in
FAILURE: bug_543018_1.in
FAILURE: bug_524043_1.in
This reverts commit 9024e026dae1af064b8467bb0f62278417fb82d1.
Add type cast definitions for CPDF_Reference.
This Cl adds ToReference, CPDF_Object::AsReference and CPDF_Object::IsReference
and updates the src to use them as needed.
BUG=pdfium:201
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1420973002 .
Review URL: https://codereview.chromium.org/1414393006 .
|
|
This Cl adds ToReference, CPDF_Object::AsReference and CPDF_Object::IsReference
and updates the src to use them as needed.
BUG=pdfium:201
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1420973002 .
|
|
R=thestig@chromium.org, tsepez@chromium.org
Review URL: https://codereview.chromium.org/1411043003 .
|
|
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1420873003 .
|
|
This limit mirrors FX_MAX_PAGE_LEVEL in fpdf_parser_document.cpp
R=thestig@chromium.org, tsepez@chromium.org
BUG=544880
Review URL: https://codereview.chromium.org/1421743003 .
|
|
This Cl adds ToStream, CPDF_Object::AsStream and CPDF_Object::IsStream and
updates the src to use them as needed.
BUG=pdfium:201
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1402413004 .
|
|
Also fixes a potential memory leak.
R=tsepez@chromium.org, thestig@chromium.org
BUG=pdfium:156
Review URL: https://codereview.chromium.org/1409973003 .
|
|
This Cl adds ToArray, CPDF_Object::AsArray and CPDF_Object::IsArray and
updates the src to use them as needed.
BUG=pdfium:201
R=thestig@chromium.org, tsepez@chromium.org
Review URL: https://codereview.chromium.org/1417893003 .
|
|
This Cl adds ToName, CPDF_Object::AsName and CPDF_Object::IsName and
updates the src to use them as needed.
BUG=pdfium:201
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1417823005 .
|
|
This Cl adds ToString, CPDF_Object::AsString and CPDF_Object::IsString and
updates the src to use them as needed.
BUG=pdfium:201
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1417933002 .
|
|
This Cl adds ToNumber, CPDF_Object::AsNumber and CPDF_Object::IsNumber and
updates the src to use them as needed.
BUG=pdfium:201
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1410673005 .
|
|
This Removes the ctor that took a pointer to the data to store and copied it
into the union memory. Instead, the call sites look at the type and pass the
correct value.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1422473002 .
|
|
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1412733011 .
|
|
This CL adds ToBoolean, CPDF_Object::AsBoolean and CPDF_Object::IsBoolean and
updates the src to use them as needed.
BUG=pdfium:201
R=thestig@chromium.org, tsepez@chromium.org
Review URL: https://codereview.chromium.org/1417623005 .
|