-
Use 'QPDFObjGen const&' instead of 'int, int' in signature.
-
Change method signatures to use QPDFObjGen. Replace QPDF_Stream::objid and generation with QPDF_Stream::og.
-
Change method signatures to use QPDFObjGen. Use QPDFObjGen methods where possible. Remove redundant QPDF::objGenToIndirect.
-
Also, revert inlining of unparse and operator << from commit 4c6640c in order to avoid exposing QUtil.
-
Move responsibility for creating shared pointers to objects and cloning from QPDFObjectHandle to QPDFObject.
-
These mean to leave the original values alone. This is needed for reconstructing streams from JSON given that the stream data and stream dictionary may appear in any order in the JSON.
-
I decided these were confusing and inconsistent with how JSON works. They muddle the API rather than improving it.
-
Not fully exercised in this commit
-
Update getJSON() methods and calls to them
-
Change .clang-format and commit automated changes from a fresh run of format-code
-
(patrepl and cleanpatch are my own utilities) patrepl s/PointerHolder/std::shared_ptr/g {include,libqpdf}/qpdf/*.hh patrepl s/PointerHolder/std::shared_ptr/g libqpdf/*.cc patrepl s/make_pointer_holder/std::make_shared/g libqpdf/*.cc patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g libqpdf/*.cc patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh git restore include/qpdf/PointerHolder.hh cleanpatch ./format-code
-
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
-
This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon.
-
None of these are in the public API.
-
Use get() and use_count() instead. Add #define NO_POINTERHOLDER_DEPRECATION to remove deprecation markers for these only. This commit also removes all deprecated PointerHolder API calls from qpdf's code except in PointerHolder's test suite, which must continue to test the deprecated APIs.
-
Use QPDFObjectHandle::isNameAndEquals, isDictionaryOfType and isStreamOfType.
-
Also fix a bug in checking consistency of length for stream data providers. Length should not be checked or recorded if the provider says it failed to generate the data.
-
Refactor QPDF_Stream to use stream filter classes to handle supported stream filters as well.
-
StreamDataProvider::provideStreamData now has a rich enough API for it to effectively proxy to pipeStreamData.
-
It's detected in QPDFWriter instead of at parse time because I can't figure out how to construct a test case in a reasonable time. This commit moves the fuzz file into the regular test suite for a QTC coverage case.
-
This makes all integer type conversions that have potential data loss explicit with calls that do range checks and raise an exception. After this commit, qpdf builds with no warnings when -Wsign-conversion -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used with MSVC. This significantly reduces the likelihood of potential crashes from bogus integer values. There are some parts of the code that take int when they should take size_t or an offset. Such places would make qpdf not support files with more than 2^31 of something that usually wouldn't be so large. In the event that such a file shows up and is valid, at least qpdf would raise an error in the right spot so the issue could be legitimately addressed rather than failing in some weird way because of a silent overflow condition.