Age | Commit message (Collapse) | Author |
|
Also, it's idempotent, so simplify some logic in callers to
not care if objnum is zero.
The alternate forms are rarely used, using the objnum form
makes it clear that SetReferenceFor() can't possibly register
the object as a side-effect.
Review-Url: https://codereview.chromium.org/2361713002
|
|
Review-Url: https://codereview.chromium.org/2358243002
|
|
Upon indirect object holder destruction, all indirect
objects are destroyed -- currently by order of increasing
object number -- but ideally without ordering constraints.
So currently, we can get away with a dictionary pointing
directly at an indirect object with a higher number. It
gets destroyed first, invoking Release() on its subordinates,
which skips destroying them if they are indirect objects. But
we don't want to rely on this artifact of destruction
order. Should it happen to be reversed, the dictionary
would invoke Release() on freed memory.
Interestingly, CPDF_Array skirts the issue by replacing
any indirect objects it is given with references. Not
clear whether we should do the same thing for dictionaries,
or remove it from arrays. The technique certainly
complicates understanding ownership.
The one violation found is in the unittest that broke the
previous CL which tried to use unique_ptrs in indirect
object holder.
Review-Url: https://codereview.chromium.org/2353093002
|
|
BUG=645954
Review-Url: https://codereview.chromium.org/2355733002
|
|
Replace the CPDF_Stream(nullptr, 0, nullptr) pattern with
a default ctor.
Remove unused parameters from CPDF_Stream::SetData(). Both
are always passed as FALSE.
CPDF_Stream declared its own m_GenNum, which shadowed the one
in CPDF_Object. It was used only to distinguish file/memory
streams, so add a bool explicitly for this purpose.
Remove the union, it would be sad if we confused user data
with a C++ object with virtual function calls.
Use unique_ptrs with appropriate deleters to manage memory.
Review-Url: https://codereview.chromium.org/2347993002
|
|
PWL_FontMap does not need its own charset definitions. fx_edit.h does
not need to define DEFAULT_CHARSET. XFA have their own definitions.
They look different in that most are MAC or MSWin charset definitions.
So they are left untouched. public/fpdf_sysfontinfo.h duplicate ones
were left untouched due to being in public folder.
Review-Url: https://codereview.chromium.org/2347313002
|
|
On Acrobat, if "/AP" is present on a text markup definition,
the coordinates used to draw the annotation come from "/Rect
values, whereas if "/AP" is not defined, the array defined
in /QuadPoints is used to grab the annotation coordinates from.
PDFium, on the other hand, uses "/Rect" regardless of
presence or absence of "/AP".
CL fixes PDFium to work similarly to Acrobat, in this case.
TEST=testing/resources/pixel/bug_585_*.in
BUG=pdfium:585
Review-Url: https://codereview.chromium.org/2289293005
|
|
This Cl makes the Get and Set methods consistenly use {G|S}et<Type>For.
BUG=pdfium:596
Review-Url: https://codereview.chromium.org/2334323005
|
|
Deleted parameter from callers, who also do not use it.
Review-Url: https://codereview.chromium.org/2337973004
|
|
This CL updates all of the includes to be correctly sorted. A PRESUBMIT warning
is added (from chromium) that will warn if the includes are in the wrong order on upload.
Review-Url: https://codereview.chromium.org/2337293002
|
|
Review-Url: https://codereview.chromium.org/2341453002
|
|
Avoids a needless alloc and copy.
Review-Url: https://codereview.chromium.org/2338553002
|
|
Wide strings compare just fine on their own.
Review-Url: https://codereview.chromium.org/2331233002
|
|
Removes some unused code for the default implementation,
Review-Url: https://codereview.chromium.org/2332983002
|
|
We should not use DR field from annotation/field dictionaries, since
these are not supposed to have one. In PDF spec 1.7, DR is defined only
for the form dictionary, in 8.6.1. In addition, note 118 in Appendix H
says "In PDF 1.2, an additional entry in the field dictionary, DR, was
defined but was never implemented. Beginning with PDF 1.5, this entry
is obsolete and should be ignored."
The changes in CBA_FontMap fix the bug below. The changes in
cpvt_generateap do not affect the bug but follow the reasoning from
the above paragraph.
BUG=pdfium:538
Review-Url: https://codereview.chromium.org/2337673002
|
|
Previously, PDFium only supported widget annotations to draw forms. As
we've implemented other annotations, the behavior of
FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw changed. So, this CL
clearly defines what needs to be done in FPDF_RenderPageBitmap_Retail
and FPDF_FFLDraw.
This CL first assumes that PDFium users will always call
FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw to render PDF pages,
because otherwise they are not able to support PDF forms.
FPDF_RenderPageBitmap_Retail should only deal with non-widget
annotations, such as highlight, underline, text, etc. If
FPDF_ANNOT flag is passed, non-widget annotations are drawn. Otherwise,
they are hidden.
FPDF_FFLDraw should only deal with annotations that requires
user-interaction, such as widget annotations and popup annotation. Since
popup annotation is associated with non-widget annotation, they should
not be drawn if the associated annotation is hidden. Thus, if FPDF_ANNOT
flag is passed, popup annotations are drawn. Otherwise, they are hidden.
Widget annotations should be always drawn regardless of FPDF_ANNOT flag
since they need to be always displayed for PDF forms.
Also, roll DEPS for testing/corpus to 8485b30.
BUG=pdfium:594
Review-Url: https://codereview.chromium.org/2323203002
|
|
CFX_ByteString cannot properly check whether the contents string is empty
because the first two bytes of text strings encoded in Unicode are always ASCII
254 followed by 255. So if we get contents in CFX_ByteString, the length will
always be 2.
Also, roll DEPS for testing/corpus to 608bf04.
Review-Url: https://codereview.chromium.org/2293403003
|
|
Review-Url: https://codereview.chromium.org/2312743005
|
|
By doing this, we simplify the code in cpvt_generateap.cpp,
and avoid calling CPVT_GenerateAP methods altogether,
when it is known that they are bailing out.
This is a preparation to fix pdfium bug 585.
BUG=pdfium:585
Review-Url: https://codereview.chromium.org/2310873002
|
|
When we create popup annotations, we also create the dictionary
associated with it. For regular annotations, the dictionary
associated with an annotation is not owned by annotation,
and will be released separately. But our created dictionary is not
associated with any other data structure, it would be leaked if not
released by the associated annotation.
Add a boolean to indicate the ownership to the dictionary, and release
the owned dictionary during the destruction of an annotation.
BUG=pdfium:242
Review-Url: https://codereview.chromium.org/2301613002
|
|
This one doesn't require an explict Emplace(), as the object
seems to get constructed only as a side-effect of making a
private copy.
Review-Url: https://codereview.chromium.org/2298953002
|
|
Comparing CFX_ByteString for annotation subtypes is inefficient and
error-prone. This CL uses enum class to compare annotation subtypes.
Also, remove unused IPDFSDK_AnnotHandler::GetType() and
FSDK_XFAWIDGET_TYPENAME.
Review-Url: https://codereview.chromium.org/2295953002
|
|
Each annotation has its contents, and users should be able to see the
contents. In this patch, PDFium creates a Popup annotation for each
annotation and stores the author and the content. When a user mouse
hover on the annotation, PDFium draws the corresponding Popup annotation
and displays the content.
Also, roll DEPS for testing/corpus to 5867fa6.
BUG=62625
Review-Url: https://codereview.chromium.org/2273893002
|
|
Review-Url: https://codereview.chromium.org/2292503002
|
|
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
|
|
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
|
|
Avoid using reference argument and return CFX_FloatRect instead.
Review-Url: https://codereview.chromium.org/2278153005
|
|
BUG=444446
Review-Url: https://codereview.chromium.org/2271373003
|
|
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
|
|
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 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
|
|
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
|
|
files.
This is the third CL to separate fx_ge into classes, one per file.
All fx_ge.h includes had to be replaced with new includes
The method definitions for CFX_FxgeDevice were not moved to a single file.
These methods are defined in two folders different from fxge/ge, so they were left untouched for now.
Review-Url: https://codereview.chromium.org/2223213002
|
|
This patch generates a default AP stream for ink annotation so that ink
annotations without AP stream can be displayed.
Also, roll DEPS for testing/corpus to 4119f8e to test ink annotations.
BUG=62625
Review-Url: https://codereview.chromium.org/2232553002
|
|
Review-Url: https://codereview.chromium.org/2226003003
|
|
This patch generates a default AP stream for circle annotation so that
circle annotations without AP stream can be displayed.
Also, roll DEPS for testing/corpus to 71d1f22 to test circle annotations.
BUG=62625
Review-Url: https://codereview.chromium.org/2228093002
|
|
This patch generates a default AP stream for square annotation so that square
annotations without AP stream can be displayed.
Also, roll DEPS for testing/corpus to 7f07c22 to test square annotations.
BUG=62625
Review-Url: https://codereview.chromium.org/2219683002
|
|
Using IsEmpty() is more readable than using GetCount() == 0.
Review-Url: https://codereview.chromium.org/2226113002
|
|
This is the second CL in an attempt to split up the classes in fxge/include/fx_ge.h into their own files. CFX_ClipRgn is moved to core/fxge/ge because it is only used in core/fxge. The header for CFX_PathData is left in core/fxge/include since it is used elsewhere.
Review-Url: https://codereview.chromium.org/2216853004
|
|
Since CFX_BinaryBuf::GetBuffer() returns uint8_t*, casting to uint8_t*
is unnecessary.
Review-Url: https://codereview.chromium.org/2218633002
|
|
This patch generates a default AP stream for squiggly annotation so that
squiggly annotations without AP stream can be displayed.
Also, roll DEPS for testing/corpus to a89e4fb to test squiggly annotations.
BUG=62625
Review-Url: https://codereview.chromium.org/2206773004
|
|
This patch generates a default AP stream for strike out annotation so that
strike out annotations without AP stream can be displayed.
Also, roll DEPS for testing/corpus to ddc1938 to test strike out annotations.
BUG=62625
Review-Url: https://codereview.chromium.org/2206083002
|
|
This patch generates a default AP stream for underline annotation so that
underline annotations without AP stream can be displayed.
Also, roll DEPS for testing/corpus to cae29d1 to test underline annotations.
BUG=62625
Review-Url: https://codereview.chromium.org/2205543002
|
|
This CL cleans up the remaining doc_* files, splitting into .h and .pp files
as needed.
Review-Url: https://codereview.chromium.org/2190983002
|
|
Also, use PaintOperation instead of bStrokingOperation in
CPDF_DefaultAppearance.
Review-Url: https://codereview.chromium.org/2197353002
|
|
This splits the doc_ocg, doc_vt and doc_basic files into individual class files.
Review-Url: https://codereview.chromium.org/2187073005
|
|
The first of several CLs to split the core/fpdfdoc/doc_* files up to individual
class files.
Review-Url: https://codereview.chromium.org/2192823002
|
|
BUG=62625
Review-Url: https://codereview.chromium.org/2202063002
|
|
This patch generates a default AP stream for highlight annotation so that
highlight annotations without AP stream can be displayed.
BUG=62625
Review-Url: https://codereview.chromium.org/2193983002
|
|
Review-Url: https://codereview.chromium.org/2196903002
|