Commit Graph

2706 Commits

Author SHA1 Message Date
Jay Berkenbilt 25ccc7eae4 Rename QPDFValueProxy.hh and QPDFValueProxy.cc
Preparing to change the class name back to QPDFObject
2022-09-08 11:19:49 -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 9dcd25a06e Remove superfluous call to resetObjGen 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 0132261ee0 Revert getOwningQPDF, and add getQPDF that returns a reference 2022-09-07 17:26:39 -04:00
Jay Berkenbilt bac559559e Fix typo 2022-09-07 17:26:39 -04:00
Jay Berkenbilt a0c32b1e8d Remove resolved TODO comment 2022-09-06 19:03:19 -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 d12734d76f Remove lgtm since it's getting shut down
It might be worth enabling code scanning at GitHub, which is a
superset of lgtm.
2022-09-06 12:46:05 -04:00
Jay Berkenbilt 94c79bb8f6 Support --show-encryption without a valid password (fixes #598) 2022-09-06 12:45:12 -04:00
Jay Berkenbilt 7e07897106 Update spelling dictionary 2022-09-06 12:45:12 -04:00
Jay Berkenbilt e3c1e1fbcb Validate RUNPATH of standalone Linux binaries in CI 2022-09-06 12:45:12 -04:00
Jay Berkenbilt 706e37a42c Move multiple direct owner notes in TODO 2022-09-06 12:45:06 -04:00
Jay Berkenbilt 259eec3a94 Clarify comments for QPDFObjectHandle::getOwningQPDF 2022-09-06 10:09:28 -04:00
Jay Berkenbilt f95e0549cc Update documentation to clarify some limitations of qpdf JSON 2022-09-06 10:09:26 -04:00
Jay Berkenbilt ed04b80caf Update internals documentation to reflect QPDFObject split 2022-09-05 18:54:02 -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 6c61be00e8 Rename QPDFObject -> QPDFValueProxy
This is in preparation for restoring a QPDFObject.hh to ease the
transition on qpdf_object_type_e.

This commit was created by
* Renaming QPDFObject.cc and QPDFObject.hh
* Replacing QPDFObject\b with QPDFValueProxy (where \b is word
  boundary)
* Running format-code
* Manually resorting files in libqpdf/CMakeLists.txt
* Manually refilling the comment in QPDF.hh near class Resolver
2022-09-05 18:52:59 -04:00
Jay Berkenbilt 5d65e73ca7 TODO note about shared_ptr vs. unique_ptr 2022-09-05 18:52:59 -04:00
Jay Berkenbilt 0a7ba62b00 Update formatting a documentation from last PR 2022-09-05 18:52:59 -04:00
Jay Berkenbilt 1264f4733e
Merge pull request #756 from jbarlow83/unique-ptr
Use unique_ptr and move constructor for Buffer::Members
2022-09-05 17:25:35 -04:00
James R. Barlow 12967bdf8a Take advantage of unique_ptr and move construction for Buffer
Since Buffer has always implemented its copy constructor with a deep
copy, its Members object will never have multiple owners. Change to unique_ptr.

Also implement move constructors for Buffer, since there may be cases
where a deep copy is not needed.
2022-09-05 13:29:56 -07:00
Jay Berkenbilt 952b00aecd
Merge pull request #755 from m-holger/tidy3
Fix commit  805c1ad : Reset QPDFValue::qpdf and QPDFValue::og when ...
2022-09-04 11:26:44 -04:00
m-holger 9c86ba40d8 Fix commit 805c1ad : Reset QPDFValue::qpdf and QPDFValue::og when ...
On destruction of the QPDF object replace all indirect object references
with direct nulls.

Remove all existing code to release resolved references.

Fixes performance issue due to interaction of resetting QPDFValue::qpdf and
og members and prior code.
2022-09-04 10:41:18 +01:00
Jay Berkenbilt 6d2db68f2e Update comments in Constants.h 2022-09-02 14:43:29 -04:00
Jay Berkenbilt da32689350 TODO reminder about github discussions 2022-09-02 11:51:38 -04:00
Jay Berkenbilt a5ae042e2b Add workaround for bug in ghostscript 9.56 (fixes #732) 2022-09-02 11:51:38 -04:00
Jay Berkenbilt 31396f61c9 Disallow --empty with --replace-input (fixes #728) 2022-09-02 09:37:17 -04:00
Jay Berkenbilt fa15042ce9 Document decision not to remove raw QPDF pointers from the API 2022-09-02 09:22:57 -04:00
Jay Berkenbilt a59e7ac7ec Disable copying/assigning to QPDF objects, add QPDF::create() 2022-09-02 08:53:27 -04:00
Jay Berkenbilt da0b0e405d Fix outdated comment 2022-09-02 08:30:11 -04:00
Jay Berkenbilt 8299083bec Update spell check dictionary 2022-09-01 18:19:48 -04:00
Jay Berkenbilt 2a1ae0b44c Remove remaining virtual functions from QPDFObject
This doesn't need an explicit destructor anymore.
2022-09-01 18:19:48 -04:00
Jay Berkenbilt 6d62662e2d Make QPDFObject::releaseResolved public
Now that QPDFObject.hh is out of the public API, we don't really need
QPDFObjAccessor. Also, the function didn't have to be virtual anymore.
2022-09-01 18:19:47 -04:00
Jay Berkenbilt c510c01568 Remove copyright banner from newly private header files
We don't put specific copyright banners on files that aren't installed.
2022-09-01 18:19:47 -04:00
Jay Berkenbilt 1d57772b76 Remove QPDFObject and QPDFValue from public include directory 2022-09-01 18:19:47 -04:00
Jay Berkenbilt f772c43de8 Stop including QPDFObject.hh from other than private files
This required moving some newly inlined functions back to the cc file,
but that seems to have had no measurable performance impact.
2022-09-01 18:19:47 -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
Jay Berkenbilt a47b99953f Update TODO 2022-09-01 17:20:59 -04:00
Jay Berkenbilt 4e7d5f190a Include memory usage in performance test output 2022-09-01 17:20:59 -04:00
Jay Berkenbilt ceeb25f3c8 Rename --report-mem-usage to --report-memory-usage
Avd xcsv brvtns.
2022-09-01 17:15:41 -04:00
Jay Berkenbilt df3d3d23b1 Update performance_check to notify about qpdf/performance-test-files 2022-09-01 17:15:41 -04:00
Jay Berkenbilt e94f478217 Update ChangeLog and Release Notes from previous pull requests 2022-09-01 17:15:41 -04:00
Jay Berkenbilt 481b1aeb50 Add comments after merge of last pull request 2022-09-01 17:15:41 -04:00
Jay Berkenbilt f12539e8aa Add QPDFParser to spelling checker 2022-09-01 17:15:41 -04:00
Jay Berkenbilt 4f4b908605 Add a file with arrays with lots of nulls to the test suite
A bug was fixed between qpdf 8.4.2 and 9.0.0 regarding this type of
file (see #305 and #311), but it was necessary to retest after some
major refactoring work at the lexical and parsing layers. This lays
the groundwork for including this in performance benchmarks and in the
qpdf test suite rather than having to keep a large,
non-redistributable file around.

20 arrays of 20K nulls is plenty for performance memory testing and
doesn't take too long to run. Compared to qpdf 8.4.2, in qpdf 11.0.0,
the file generated here uses 3% of the RAM and runs over 4 times
faster.
2022-09-01 16:15:54 -04:00