2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-29 16:30:53 +00:00
Commit Graph

234 Commits

Author SHA1 Message Date
m-holger
862feed100 Add additional QPDFObjectHandle::Rectangle and Matrix tests 2024-02-20 14:53:18 +00:00
m-holger
36ee4ecc6e Add test for QPDFObjectHandle::isDirectNull 2024-02-20 13:02:16 +00:00
m-holger
a047d5497e Add test for QPDFObjectHandle::getStreamJSON 2024-02-20 00:49:41 +00:00
Jay Berkenbilt
e362bce8e8 Merge branch 'jw' from #1146 into work 2024-02-17 14:15:48 -05:00
m-holger
f0bc2f11ef Expose QPDFObjectHandle::writeJSON 2024-02-16 14:09:28 +00:00
Jay Berkenbilt
b1dad0de2a Fix previous fix to setting checkbox value (fixes #1056)
The code accepted values other than /Yes but still used /Yes as the
checked value instead of obeying the normal appearance dictionary.
2024-02-11 15:49:44 -05:00
m-holger
ed43691bf3 Tighten checks for invalid indirect references in QPDFParser 2024-01-17 13:15:13 +00:00
Jay Berkenbilt
ebb10f3256 Fix null pointer issue on array copy 2024-01-12 08:05:22 -05:00
Jay Berkenbilt
b8fd18ae56 Merge branch 'parse_ref' into work 2023-12-21 15:43:50 -05:00
Jay Berkenbilt
4ee393d1fa Remove compression from linearization tests where possible
By combining --linearize with --compress-streams=n, we ensure that no
new compressed data will appear in linearized output, which makes the
output independent of zlib's output. There are other tests to ensure
that linearization works correctly with compression. This commit
involves changing some test outputs and test code as well just
updating test suites.
2023-12-20 15:46:20 -05:00
m-holger
172cc61305 Remove redundant code in QPDFParser::parse and parseRemainder
Also, fix test cases.
2023-11-03 01:26:34 +00:00
Jay Berkenbilt
9fc02e2f91 Add another string parsing test 2023-10-14 17:31:54 -04:00
Jay Berkenbilt
1ecc6bb29e Don't lose character after \d or \dd parsing string (fixes #1050) 2023-10-14 17:12:56 -04:00
m-holger
ca79fcb26e Add test for attempts to copy foreign /Pages object 2023-09-03 10:50:06 +01:00
m-holger
d784e8033c Code tidy - Clang-Tidy rule performance-for-range-copy 2023-06-09 15:55:49 +01:00
m-holger
0ac005f0d9 Code tidy - Clang-Tidy rule modernize-use-override 2023-06-09 15:52:56 +01:00
m-holger
5906dd5c1f Code tidy - Clang-Tidy rule modernize-use-default-member-init 2023-06-09 15:43:21 +01:00
Jay Berkenbilt
60965d5f4d Rerun clang-format 2023-05-21 13:35:09 -04:00
Jay Berkenbilt
d740c6ccce Rerun format_code (after merging clang-tidy PR) 2023-05-20 14:52:19 -04:00
m-holger
41ec7eda54 Use auto when initialializing with new 2023-05-20 15:41:40 +01:00
m-holger
d0682f0f60 Use nullptr instead of 0 or NULL 2023-05-20 15:41:36 +01:00
m-holger
e28f4efb00 Replace deprecated C++ includes 2023-05-20 15:41:25 +01:00
m-holger
7f043fe88e Remove unused include directives 2023-05-20 15:37:41 +01:00
m-holger
182c2480df Refactor QPDF_Array::setItem and rename to setAt 2023-04-01 13:56:29 +01:00
m-holger
4d37389bef Refactor QPDF_Array::eraseItem and rename to erase 2023-04-01 13:56:16 +01:00
m-holger
1bb23d0545 Refactor QPDF_Array::insertItem and rename to insert 2023-04-01 13:56:10 +01:00
Jay Berkenbilt
bf477fbb96 Do double indirect test correctly 2023-01-01 07:33:34 -05:00
Jay Berkenbilt
ce8e63cb9a Add test case for broken indirect object reference
...where the first "number" is an indirect object that happens to be a
number.
2022-12-31 15:12:58 -05:00
m-holger
0ca44ef84c Fix QPDFObjectHandle::isScalar
Exclude uninitialized, destroyed and reserved objects.
2022-12-31 09:27:19 -05:00
Jay Berkenbilt
bd337b8055 Preserve unreferenced objects in dangling test 2022-11-25 15:16:16 -05:00
Jay Berkenbilt
f6367bbada Dangling ref test: show new object ID 2022-11-25 15:16:16 -05:00
Jay Berkenbilt
5489f1d8d6 Code formatting updates 2022-11-25 15:16:16 -05:00
Jay Berkenbilt
db6598b449 Attempt to test for QPDFNameTreeObjectHelper's vtable
It has disappeared from the DLL on Windows a few times.
2022-10-06 08:40:08 -04:00
Jay Berkenbilt
8a3cdfd2af Change QPDFObjectHandle == to isSameObjectAs
Replace operator== and operator!=, which were testing for the same
underlying object, with isSameObjectAs. This change was motivated by
the fact that pikepdf internally had its own operator== method for
QPDFObjectHandle that did structural comparison. I backed out qpdf's
operator== as a courtesy to pikepdf (in my own testing) but also
because I think people might naturally assume that operator== does a
structural comparison, and isSameObjectAs is clearer in its intent.
2022-09-09 18:09:40 -04:00
Jay Berkenbilt
c7a4967d10 Change reset to disconnect and clarify comments
I decided that it's actually fine to copy a direct object to another
QPDF. Even if we eventually prevent a QPDFObject from having multiple
parents, this could happen if an object is moved.
2022-09-08 11:06:15 -04:00
Jay Berkenbilt
dba61da1bf Create a special "destroyed" type rather than using null
When a QPDF is destroyed, changing indirect objects to direct nulls
makes them effectively disappear silently when they sneak into other
places. Instead, we should treat this as an error. Adding a destroyed
object type makes this possible.
2022-09-08 10:36:39 -04:00
Jay Berkenbilt
264e25f391 Clear owning QPDF information for all objects, not just indirect 2022-09-08 10:19:38 -04:00
Jay Berkenbilt
a615985865 Update QPDFObject with comment
Also, since it's just there for compatibility, we don't need to add
new object types to it.
2022-09-08 10:19:38 -04:00
Jay Berkenbilt
4422588d7d Remove unneeded owning_qpdf from QPDFValue
The qpdf member was already sufficient. Removing this actually fixed a
few pre-existing issues around detecting foreign ownership and
allowing certain conditions to be warnings rather than exceptions.
2022-09-08 10:19:38 -04:00
Jay Berkenbilt
bac559559e Fix typo 2022-09-07 17:26:39 -04:00
Jay Berkenbilt
76cd7ea67a Clarify and improve QPDFPageObjectHelper::get*Box methods
Add copy_if_fallback and explain how it differs from copy_if_shared.
2022-09-06 19:00:40 -04:00
Jay Berkenbilt
c1def4ead4 Implement QPDFObjectHandle equality 2022-09-06 18:34:23 -04:00
Jay Berkenbilt
55cc2ab680 Re-introduce QPDFObject.hh as deprecated
* Just removing a header file would cause build errors with no hint as
  to what happened. This way, people get a warning rather than error
  for the life of qpdf 11, and the warning tells them what to do.

* This avoids build surprises resulting from having two versions of
  QPDF headers installed at once. If you were building code out of a
  checkout of qpdf but had an older version installed on your system,
  if your code included <qpdf/QPDFObject.hh>, everything would work,
  but then your code would break without QPDFObject.hh later.
2022-09-05 18:52:59 -04:00
Jay Berkenbilt
a59e7ac7ec Disable copying/assigning to QPDF objects, add QPDF::create() 2022-09-02 08:53:27 -04:00
Jay Berkenbilt
b663926538 Remove QPDFObject::object_type_e as alias for qpdf_object_type_e 2022-09-01 18:11:22 -04:00
m-holger
805c1ad479 Reset QPDFValue::qpdf and QPDFValue::og when the owning QPDF object gets destroyed 2022-09-01 17:20:16 +01:00
Jay Berkenbilt
12d065c751 Provide a simpler QPDF::writeJSON 2022-07-31 16:23:17 -04:00
Jay Berkenbilt
b3e6d445cb Tweak "AndGet" mutator functions again
Remove any ambiguity around whether old or new value is being
returned.
2022-07-24 15:42:23 -04:00
m-holger
afd35f9a30 Overload StreamDataProvider::provideStreamData
Use 'QPDFObjGen const&' instead of 'int, int' in signature.
2022-07-24 16:02:35 +01:00
Jay Berkenbilt
0c7c7e4ba4 Track whether certain page modifying methods have been called
We need to know whether pushInheritedAttributesToPage or getAllPages
have been called when generating JSON output. When reading the JSON
back in, we have to call the same methods so that object numbers will
line up properly.
2022-06-25 13:55:45 -04:00