2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-09-24 19:19:08 +00:00
Commit Graph

1370 Commits

Author SHA1 Message Date
m-holger
3efd665703 Remove redundant parameters cross_indirect and stop_atstreams from QPDFObjectHandle::copyObject1 2022-11-20 12:07:22 -05:00
m-holger
d7b8525235 Refactor QPDFObjectHandle::unsafeShallowCopy 2022-11-20 12:07:22 -05:00
m-holger
0289b21c3b Remove redundant QPDFObjectHandle::copyObject2
copyObject2 repeats a second time what
new_obj = QPDFObjectHandle(obj->copy(true))
in shallowCopyInternal2 already did.
2022-11-20 12:07:22 -05:00
m-holger
15e8d3a763 Remove redundant parameter first_level_only from QPDFObjectHandle::shallowCopyInternal2 and copyObject2 2022-11-20 12:07:22 -05:00
m-holger
0827b1096e Remove redundant parameters cross_indirect and stop_atstreams from QPDFObjectHandle::copyObject2 2022-11-20 12:07:22 -05:00
m-holger
63d1dcb414 Split QPDFObjectHandle::shallowCopyInternal and copyObject
Have separate versions for unsafeShallowCopy, shallowCopy and makeDirect.
2022-11-20 12:07:22 -05:00
m-holger
dbc5f07b90 Rename QPDFObject::shallowCopy to copy
Add optional parameter shallow. Change logic errors to runtime errors.
2022-11-20 12:07:22 -05:00
m-holger
34a6f8938f Add methods QPDFTokenizer::Token::isWord 2022-11-20 11:55:02 -05:00
m-holger
dca70f13e7 Add method QPDFTokenizer::Token::isInteger 2022-11-20 11:55:02 -05:00
Jay Berkenbilt
e9980efec8 Correctly handle reuse of xref stream (fixes #809) 2022-11-19 17:03:17 -05:00
m-holger
d79a823d66 Remove QPDF_Stream::getOffset and QPDF_Stream::setObjGen 2022-11-19 14:10:42 -05:00
m-holger
6350cf16e6 Remove QPDF_Stream::offset 2022-11-19 14:10:42 -05:00
m-holger
3a86b893f7 Remove redundant parameters from QPDF_Stream::warn 2022-11-19 14:10:42 -05:00
m-holger
69e67b45bb Remove QPDF_Stream qpdf and og data members 2022-11-19 14:10:42 -05:00
m-holger
bf347dfb73 Remove QPDFObjectHandle::Factory::newStream 2022-11-19 14:10:42 -05:00
m-holger
743a735ee0 Use QPDF::newStream in library 2022-11-19 14:10:42 -05:00
m-holger
9ebabd1953 Add new methods QPDF::newStream 2022-11-19 14:10:42 -05:00
m-holger
0a3c533186 Add private method QPDF::nextObjGen 2022-11-19 14:10:42 -05:00
m-holger
b3d71e1f58 Add private overload of QPDF::makeIndirectObject taking a QPDFObject shared_ptr 2022-11-19 14:10:42 -05:00
m-holger
fc64d0a371 Fix stray formatting error 2022-11-14 07:05:58 -05:00
Jay Berkenbilt
d94e6958ef Fix stray formatting error 2022-10-08 17:05:11 -04:00
Jay Berkenbilt
2bc9121fa1 Fix major performance bug with openssl crypto (fixes #798)
Lazily load MD5 and RC4 once in the life of the program. Only load the
legacy provider if RC4 is actually being used.
2022-10-08 17:04:59 -04:00
Jay Berkenbilt
5c5b4e640e Be more conservative about QPDF_DLL_CLASS with mingw (fixes #799)
* Define it even though previous experiments have shown it to be
  unnecessary since it seems like it may be necessary after all
* Add QPDF_DLL_CLASS to QPDFObjectHelper and QPDFDocumentHelper in
  case there's some future unknown reason why someone may want to have
  them and/or in case it helps with the weird
  QPDFNameTreeObjectHelper problem.
2022-10-06 08:40:08 -04:00
m-holger
d44bba3914 Fix typos in error message 2022-10-03 11:42:27 -04:00
m-holger
c63fb86c01 Inline call to QPDFObjectHandle::parse in QPDF::readObject 2022-10-01 11:17:39 -04:00
m-holger
cb0a6be983 Code tidy: use QPDF::toS and QPDF::toI where possible 2022-10-01 11:17:39 -04:00
m-holger
5ccab4be03 Add private methods QPDF::damagedPDF 2022-10-01 11:17:39 -04:00
Jay Berkenbilt
f4ca04cec1 Fix edge case in character encoding (fixes #778)
Avoid representing as PDF Doc encoding any string whose PDF Doc
encoding representation starts with a UTF-16 or UTF-8 marker.
2022-09-26 08:06:47 -04:00
m-holger
4fb7d1335a Tune QPDF_String::useHexString() 2022-09-24 17:09:56 -04:00
m-holger
44a7aff56f Refactor Pl_Buffer
Base implementation of the buffer on std::basic_string<unsigned char>.
2022-09-23 15:09:13 -04:00
m-holger
ae800361fe Tune QUtil::hex_encode 2022-09-23 06:20:12 -04:00
m-holger
033a66e9a5 Tune unparsing of hex strings in QPDF_String::unparse 2022-09-23 06:20:12 -04:00
m-holger
2e6869483b Replace calls to QUtil::int_to_string with std::to_string 2022-09-21 15:57:14 -04:00
Jay Berkenbilt
5796475a5e Cosmetic: use default constructor for QPDFObjGen 2022-09-14 07:35:32 -04:00
Jay Berkenbilt
2394acf7a6 Remove explicit direct object check from getObject
An indirect object reference to 0, 0 is invalid. If it appears in the
file or is parsed from a string, the parser catches it. This check
would only be useful for someone explicitly calling getObject with 0,
0, and that would trigger an error during resolve().
2022-09-13 11:21:29 -04:00
Jay Berkenbilt
a0b1a18172 Remove redundant function calls 2022-09-13 11:20:28 -04:00
Jay Berkenbilt
31b2cfbb79 Fix up a few comments 2022-09-13 11:18:49 -04:00
Jay Berkenbilt
4963ce6a53 Remove obsolete LL_FMT check from build (fixes #768)
This was broken for cross-compilation and has probably been
unnecessary for several years now.

Also fix extraneous whitespace in related some tests.
2022-09-12 11:48:38 -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
3dbab589e3 Add C API functions for using custom loggers
Expose functions to the C API to create new loggers and to setLogger
and getLogger for QPDF and QPDFJob.
2022-09-09 10:49:25 -04:00
Jay Berkenbilt
0ad4e190ff Make QPDFLogger() private and provide create method 2022-09-09 07:03:29 -04:00
Jay Berkenbilt
f1a2d3160a Add JSON v2 support to C API 2022-09-09 06:19:09 -04:00
Jay Berkenbilt
66f1fd2ad9 Switch user-supplied functions in C API to return int 2022-09-08 17:36:51 -04:00
Jay Berkenbilt
b0f054e600 Add ability to initialize Pl_Function with a C-style function 2022-09-08 17:35:27 -04:00
Jay Berkenbilt
18a583e8d9 Rename QPDFValueProxy back to QPDFObject
QPDFValueProxy wasn't a good name for it. We decided the evil of
having the header file be named QPDFObject_private.hh was less than
the evil of having the class be named something other than what it
should have been named.
2022-09-08 11:29:23 -04:00
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
9dcd25a06e Remove superfluous call to resetObjGen 2022-09-08 10:19:38 -04:00