Age | Commit message (Collapse) | Author |
|
overflow.
BUG=618267
Review-Url: https://codereview.chromium.org/2284063002
|
|
Currently when the parser utility classes are outputting to a text buffer we do
not verify that an element from an array exists before accessing. We can have
null items in arrays (and dictionaries but the dictionary case is already
handled).
This Cl updates the code to check the element exists before attempting to use
the element.
BUG=chromium:641076
Review-Url: https://codereview.chromium.org/2292473004
|
|
Move methods to CPDF_ColorStateData.
Move MakePrivateCopy() methods to call sites.
Remove now-empty cpdf_colorstate.cpp file.
Review-Url: https://codereview.chromium.org/2291763002
|
|
This CL is a speculative fix for the associated BUG. Make sure the CPDF_Document
is initialized in the constructor.
BUG=chromium:640998
Review-Url: https://codereview.chromium.org/2291743002
|
|
These just invoked exaclty the same methodes in the underlying
xxxData class, which we can now do with just a ->()
Move some methods to the xxxData class, where they belong.
In doing so, put MakePrivateCopy() calls at each callsite
for those methods that made a copy.
Review-Url: https://codereview.chromium.org/2286983002
|
|
BUG=641444
Review-Url: https://codereview.chromium.org/2283893003
|
|
Review-Url: https://codereview.chromium.org/2292503002
|
|
Allows CFX_CountRefs to behave more like pointers.
Rename SetNull() to Clear() for consistency with other ptrs.
Change GetPrivateCopy() into MakePrivateCopy() with no return,
since the -> operators are clearer than getting an object pointer.
Review-Url: https://codereview.chromium.org/2283113002
|
|
CPDFSDK_Annot::GetType should be renamed to GetAnnotSubtype as it returns
annotation subtype. Also, CPDFSDK_Annot::GetSubType is only used to check if
the annotation is signature widget. Thus, change the method to
IsSignatureWidget. Lastly, rename CPDF_Annot::GetSubType to
CPDF_Annot::GetSubtype to match with spec.
Review-Url: https://codereview.chromium.org/2287703002
|
|
Hide the CountedObj class from the rest of the code.
Rename GetModify() to GetPrivateCopy(), since it turns out
there are places where we modify a potentially-shared copy.
Add non-const version of GetObject() to permit these.
Review-Url: https://codereview.chromium.org/2287633002
|
|
Review-Url: https://codereview.chromium.org/2285513002
|
|
The code that was deleted is being used by Android foxit viewer
This reverts commit dbfc3522a6ee24d17f2c50a5dcc465db52a280ee and updates the #includes
Review-Url: https://codereview.chromium.org/2281083002
|
|
Make use of existing ref count work rather than re-inventing it.
Review-Url: https://codereview.chromium.org/2281683002
|
|
- CPDF_TextPageFind and CPDF_LinkExtract moved to new file
- fpdf_text_int.cpp renamed to be CPDF_TextPage definition
Review-Url: https://codereview.chromium.org/2286723003
|
|
Avoid using reference argument and return CFX_FloatRect instead.
Review-Url: https://codereview.chromium.org/2278153005
|
|
Review-Url: https://codereview.chromium.org/2277323002
|
|
BUG=597440
Review-Url: https://codereview.chromium.org/2273293003
|
|
BUG=444446
Review-Url: https://codereview.chromium.org/2271373003
|
|
fpdf_text_int.cpp should be split up into classes in a later CL
Review-Url: https://codereview.chromium.org/2271973004
|
|
Remove friendship with CFX_Path
Pack members tighter on 64-bits.
Review-Url: https://codereview.chromium.org/2275883004
|
|
Currently the only calls to CloseParser() happend in the destructor or the
start*Parse methods. The Start*Parse methods are currently only called on
freshly constructed parsers in fpdf_dataavail and fpdfview.
This CL removes the CloseParser() method and puts the contents in the
destructor. We then add an ASSERT that we don't re-enter the parser after it
has already completed the parse.
Review-Url: https://codereview.chromium.org/2267173005
|
|
Added a vector of pointers to CFX_Fonts in the class CPDF_Font, so that
fallback fonts may be used. In CPDF_CharPosList::Load, the glyphs for each
character are calculated. When m_Font does not support a character, a fallback
font is selected and the character is rendered using that font. This meant
adding an attribute to FXTEXT_CHARPOS so it knows which font renders it.
Also, methods in fpdf_render_text.cpp now may need to call device drawing
methods multiple times because these only support one font at a time. In
CPDF_TextRenderer::DrawNormalText and in CPDF_TextRenderer::DrawTextPath, the
device drawing method is called as few times as possible by grouping contiguous
characters rendered by the same font. In
CPDF_RenderStatus::DrawTextPathWithPattern, drawing was already done one
character at a time, but precalculating CFX_FaceCache. Now, the face cache is
precalculated for all of the fallback fonts.
The list of fallback fonts does not include tha main font. Otherwise the list
would be of raw pointers to avoid double free problems. For now, the font
Arial is used as fallback. This should fix the issue of not seeing Latin
characters displayed when bad fonts are used. However, this should be improved.
Tested manually using the file in the bug, plus a font directory containing a
font that supports Hangul but not Latin. This font is chosen as the substitute
font, but Latin characters are now being rendered.
Design proposal: go/pdfium_fallbackfonts
BUG=pdfium:358
Review-Url: https://codereview.chromium.org/2276653002
|
|
This Cl switches the ownership between the parser and the document. Previously
the parser owned the document and we'd jump through hoops during cleanup to
delete the right object. This Cl flips the ownership so the document owns
the parser and simplifies the cleanup logic where needed.
BUG=pdfium:565
Review-Url: https://codereview.chromium.org/2275773003
|
|
Now that Document::getAnnot works and annotation instances
can have its properties changed, consider the following
scenario:
- A PDF content has an annotation without AP and
CPVT_GenerateAP is called to generate one.
- However the annotation also has its hidden flag set (/F 2),
and CPVT_GenerateAP bails out earlier, not generating an AP.
- When the PDF's Javascript runs, it acquires an instance of
this annotation object, bounded to JS using Document::getAnnot(),
and set its "hidden" flag to false.
- At this point, the annotation should get drawn, but it does
not because its "AP" was never generated.
CL fixes this scenario by making PDFium able to lazy
generate APs, if needed.
BUG=pdfium:492
Review-Url: https://codereview.chromium.org/2265313002
|
|
This Cl moves the parser out of the indirect object holder and into the
CPDF_Document where it is used.
Review-Url: https://codereview.chromium.org/2277433003
|
|
Review-Url: https://codereview.chromium.org/2269203002
|
|
For some complex objects such as CPDF_Dictionary, CPDF_Array,
CPDF_Stream, and CPDF_Reference, Clone() could be executed with
infinite recursion to cause the stack overflow. Fix this by
checking already cloned objects to avoid recursion.
BUG=pdfium:513
Review-Url: https://codereview.chromium.org/2250533002
|
|
This CL moves the m_IndirectObjs map to be private to the IndirectObjectHolder.
Various bits of code have been updated to use the accessors to the map.
This CL fixes the issue with the last time this landed by removing the objnum
check from GetIndirectObject() which appears to have caused the crashes.
Review-Url: https://codereview.chromium.org/2275703002
|
|
This Cl updates the names of the methods in the indirect object holder to better
reflect their usage. The m_LastObjNum is made private and a setter added.
Review-Url: https://codereview.chromium.org/2275593002
|
|
BUG=637119
Review-Url: https://codereview.chromium.org/2274723002
|
|
This patch generates a default AP stream for text annotation. The AP stream
only draws a symbol, which represents the presence of text annotation at the
point.
Also, roll DEPS for testing/corpus to afbac94 to test text annotations.
BUG=62625
Review-Url: https://codereview.chromium.org/2270493002
|
|
BUG=637119
Review-Url: https://codereview.chromium.org/2268693003
|
|
https://codereview.chromium.org/2253723002/ )
Reason for revert:
Causing asan issues. See crbug.com/639451.
Original issue's description:
> Move parser pointer to CPDF_Document
>
> The CPDF_IndirectObjectHolder has two subclasses, CPDF_Document and
> CFDF_Document. The CPDF document requires the parser and the CFDF document
> does not. This cl moves the parser pointer up to CPDF_Document.
>
> Committed: https://pdfium.googlesource.com/pdfium/+/260f5fbf3553a96fa49b029cc050220039c30e2a
TBR=tsepez@chromium.org,thestig@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
Review-Url: https://codereview.chromium.org/2266033002
|
|
Moved ScopedFontTransform from fx_ge_text namespace to fx_font
Moved some arrays used by both CFX_Font and CFX_FaceCache from fx_ge_text to
inside CFX_Font class
Review-Url: https://codereview.chromium.org/2263623002
|
|
It was intended to be unsigned in the first place, and we're
perfectly happy with the overflow as long as it is no longer
undefined behaviour.
BUG=638489
Review-Url: https://codereview.chromium.org/2258053003
|
|
BUG=636559
Review-Url: https://codereview.chromium.org/2255083004
|
|
BUG=pdfium:562
Review-Url: https://codereview.chromium.org/2257313002
|
|
Put class definition into its own header file so fuzzer can find it.
Fix a pair of div by 0s immediately hit by the fuzzer.
Review-Url: https://codereview.chromium.org/2253193003
|
|
Review-Url: https://codereview.chromium.org/2260533002
|
|
Moved classes CFX_FontCache and CFX_AutoFontCache into a separate file.
Review-Url: https://codereview.chromium.org/2246223002
|
|
The CPDF_IndirectObjectHolder has two subclasses, CPDF_Document and
CFDF_Document. The CPDF document requires the parser and the CFDF document
does not. This cl moves the parser pointer up to CPDF_Document.
Review-Url: https://codereview.chromium.org/2253723002
|
|
Recent Skia driver addition of 8 bit src / 8 bit dst workaround
needs to check for a nullptr bitmap.
R==dsinclair@chromium.org
Review-Url: https://codereview.chromium.org/2255763002
|
|
CFX_SubstFont::m_ExtHandle is never assigned a value different from nullptr.
Similarly, IFX_SystemFontInfo::RetainFont has two implementations.
Both of these return nullptr, so this method is not needed.
Review-Url: https://codereview.chromium.org/2252833002
|
|
Review-Url: https://codereview.chromium.org/2247073005
|
|
Now that PDFium supports drawing of more annotation
types, it should also respect the "hidden" flag that
annotations might feature.
For instance, in IE/Acroread if an annotation is flagged as
"hidden" it does not get drawn.
CL adds a check for the specific "hidden" flag, not drawing
annotation that are flagged with it, in order to match IE + acrobat
reader behavior.
The "flags" definition can be seen by looking at "/F {value}"
syntax in a PDF file source, where {value} is an predefined
integer value.
Test: PDF files being added in [1].
[1] https://codereview.chromium.org/2239713003/
BUG=62625
Review-Url: https://codereview.chromium.org/2239853002
|
|
The parser and document refer to async loading and parsing. The code isn't
actually async but loading a linearized PDF. This Cl renames the methods to
clarify what the code is doing.
The LoadDoc() and LoadLinearizedDoc() methods have been refactored to share
a common LoadDocInternal() method.
Review-Url: https://codereview.chromium.org/2250163002
|
|
Precursor to someday using possibly subclassed documents.
Review-Url: https://codereview.chromium.org/2248123002
|
|
And also CFX_RenderDevice::DrawNormalText().
BUG=637192
Review-Url: https://codereview.chromium.org/2244613002
|
|
BUG=635438
Review-Url: https://codereview.chromium.org/2248473002
|
|
Previously, Skia generated PDFs would only output one character at a
time, but now they output whole strings. Handle this case.
BUG=409472
Review-Url: https://codereview.chromium.org/2197553002
|