Age | Commit message (Collapse) | Author |
|
The JPX decoder needs to verify there is data associated with an image channel
before access. This was already done in one side of the if() but seems to be
missing from the other.
This Cl updates the loop to check the existance of channel data and to continue
iteration if none found.
BUG=chromium:637232
Review-Url: https://codereview.chromium.org/2291813002
|
|
This reverts commit c10c23a2b1999b1cb0354fd4db9837dc63a3d833.
TBR=dsinclair@chromium.org
Review-Url: https://codereview.chromium.org/2285283003
|
|
This reverts commit d09a09751f724ecdb1a0bc307447a3d0c212ebff.
TBR=dsinclair@chromium.org
Review-Url: https://codereview.chromium.org/2291833002
|
|
This reverts commit 91ddd3f7501429222f648b986a99f3959a398889.
Reason for revert: may introduce sublte bugs, more thought required.
TBR=dsinclair@chromium.org
Review-Url: https://codereview.chromium.org/2294553002
|
|
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 patch also prevent a null pointer access problem.
BUG=chromium:638829
R=ochang@chromium.org
Review-Url: https://codereview.chromium.org/2270343002
|
|
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
|
|
In [1], it was made a mistake in the way the test case
testing/resources/pixel/bug_492.pdf was generated.
This CL aims at fixing this mistake by:
1- keep making use of the new pdfium_test capability
introduced by [1],
2- add a proper .in file for the test case to generate
its respective .pdf file.
[1] https://codereview.chromium.org/2277063003/
BUG=pdfium:492
Review-Url: https://codereview.chromium.org/2286023002
|
|
BUG=pdfium:416
Review-Url: https://codereview.chromium.org/2283313002
|
|
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
|
|
Although notably, the parameters handling support is not
complete, CL intends to be the first step towards a more
complete implementation of this API.
TEST=testing/resources/javascript/bug_492_1.in
BUG=pdfium:492
Review-Url: https://codereview.chromium.org/2281273002
|
|
BUG=pdfium:559
Review-Url: https://codereview.chromium.org/2286653002
|
|
This patch removes check-implicit-copy-ctors flag to the clang plugins.
This flag is enabled by default and will be removed soon.
R=thestig@chromium.org
Review-Url: https://codereview.chromium.org/2283923002
|
|
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
|
|
TBR=caryclark@google.com
Review-Url: https://codereview.chromium.org/2287443002
|
|
TBR=jshin@chromium.org
Review-Url: https://codereview.chromium.org/2283723002
|
|
TBR=thakis@chromium.org
Review-Url: https://codereview.chromium.org/2282693002
|
|
In [1], the lack of support of pdfium_test to some application
level hooks was felt.
More specifically, the lack of implementation of the hook FFI_GetPage,
called when 'this.getAnnot()' is executed in an Acrobar JS context,
makes it non-trivial to JS texts that manipulate PDF annotations.
[1] https://codereview.chromium.org/2265313002/
Here is the failing call stack in pdfium_test:
0 ::RenderPdf (samples/pdfium_test.cc)
1 ::FORM_DoDocumentOpenAction (fpdfsdk/fpdfformfill.cpp)
2 CPDFSDK_Document::ProcOpenAction (fpdfsdk/fsdk_mgr.cpp)
3 CPDFSDK_ActionHandler::DoAction_DocOpen (fpdfsdk/fsdk_actionhandler.cpp)
<----v8---->
4 Document::getAnnot (fpdfsdk/javascript/Document.cpp)
5 CPDFSDK_Document::GetPageView (fpdfsdk/fsdk_mgr.cpp)
6 CPDFDoc_Environment::FFI_GetPage (fpdfsdk/include/fsdk_mgr.h)
(frame 6 returns nullptr, and getAnnot call in frame 4 bails)
CL extends pdfium_test app with a FFI_GetPage hook implementation.
Basically what FFI_GetPage does is returning a FPDF_PAGE instance.
In case of pdfium_test, FPDF_PAGE instances were only created on demand
when the page was going to get rendered, and then discarded.
Since FFI_GetPage can be called by JS before pages are rendered,
CL moved the page creation code into a helper function, and cached
the FPDF_PAGE instances created in a map, so it does not recreate
them needlessly.
BUG=pdfium:492
Review-Url: https://codereview.chromium.org/2277063003
|
|
This CL cleans up CPDFSDK_PageView::LoadFXAnnots and nits.
Review-Url: https://codereview.chromium.org/2279563005
|
|
Review-Url: https://codereview.chromium.org/2276343006
|
|
Avoid using reference argument and return CFX_FloatRect instead.
Review-Url: https://codereview.chromium.org/2278153005
|
|
Review-Url: https://codereview.chromium.org/2283503002
|
|
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
|
|
Method is unused and misplaced (it should be in
CPF_Annot if actually needed).
Review-Url: https://codereview.chromium.org/2278613003
|
|
Remove friendship with CFX_Path
Pack members tighter on 64-bits.
Review-Url: https://codereview.chromium.org/2275883004
|
|
Review-Url: https://codereview.chromium.org/2276953003
|
|
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
|
|
This CL makes some methods private which are only used internally, removes
unused methods and removes an unused class.
Review-Url: https://codereview.chromium.org/2278583002
|
|
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
|
|
Embedder test's delegate function GetPage() calls FPDF_LoadPage() to
load a page which may be already loaded by embedder test itself.
Thus the page's ref count is increased unnecessarily.
This causes the page to be leaked. Fix this by putting the page map in
embedder test class and guarantee the page is loaded only once.
Also, fix leaks in this embedder tests by unloading the loaded pages to
properly release the resource.
BUG=pdfium:242
Review-Url: https://codereview.chromium.org/2258333002
|
|
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
|