aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFAcroFormDocumentHelper.cc
AgeCommit message (Collapse)Author
2022-08-01Add QPDF::getObject to replace getObjectByObjGen and getObjectByIDm-holger
For consistency with similar methods, e.g. replaceObject.
2022-07-24Tweak "AndGet" mutator functions againJay Berkenbilt
Remove any ambiguity around whether old or new value is being returned.
2022-07-24Add optional parameter separator to QPDFObjGen::unparsem-holger
Also, revert inlining of unparse and operator << from commit 4c6640c in order to avoid exposing QUtil.
2022-05-21Code clean up: use range-style for loops wherever possiblem-holger
Remove variables obsoleted by commit 4f24617.
2022-05-20Back out fluent QPDFObjectHandle methods. Keep the andGet methods.Jay Berkenbilt
I decided these were confusing and inconsistent with how JSON works. They muddle the API rather than improving it.
2022-04-30Code clean up: use range-style for loops wherever possibleJay Berkenbilt
Where not possible, use "auto" to get the iterator type. Editorial note: I have avoid this change for a long time because of not wanting to make gratuitous changes to version history, which can obscure when certain changes were made, but with having recently touched every single file to apply automatic code formatting and with making several broad changes to the API, I decided it was time to take the plunge and get rid of the older (pre-C++11) verbose iterator syntax. The new code is just easier to read and understand, and in many cases, it will be more effecient as fewer temporary copies are being made. m-holger, if you're reading, you can see that I've finally come around. :-)
2022-04-30Formatting: remove space in range-style for loopsJay Berkenbilt
Change .clang-format and commit automated changes from a fresh run of format-code
2022-04-30Use fluent replaceKeyJay Berkenbilt
2022-04-30Use replaceKeyAndGet in a few places in existing codeJay Berkenbilt
2022-04-16Use anonymous namespaces for file-private classesJay Berkenbilt
2022-04-16Remove QPDFAcroFormDocumentHelper::copyFieldsFromForeignPageJay Berkenbilt
2022-04-16Use = default and = delete where possible in classesJay Berkenbilt
2022-04-09Replace PointerHolder with std::shared_ptr in library sources onlyJay Berkenbilt
(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
2022-04-05Update some code manually to get better formatting resultsJay Berkenbilt
Add comments to force line breaks, parenthesize function arguments that are contatenated strings, etc. -- these kinds of changes improve clang-format's results and also cause emacs cc-mode to match clang-format. After this type of change, most of the time, when clang-format and emacs disagree, clang-format is better.
2022-04-04Programmatically apply new formatting to codeJay Berkenbilt
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
2022-02-07Update for clean compile with POINTERHOLDER_TRANSITION=2Jay Berkenbilt
2022-02-04PointerHolder: deprecate getPointer() and getRefcount()Jay Berkenbilt
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.
2022-01-27Remove some if statements and simplify some boolean expressionsm-holger
Use QPDFObjectHandle::isNameAndEquals, isDictionaryOfType and isStreamOfType.
2021-11-04Fix bug in merging resources /DR from foreign AcroForm (fixes #548)Jay Berkenbilt
When making resources indirect in from_dr, the code was using the wrong owning QPDF, forgetting that from_dr had already been copied using CopyForeignObject.
2021-03-11Allow /DR to be direct in /AcroFormJay Berkenbilt
Also handle direct annotation, though this is much less likely.
2021-03-05QPDFAcroFormDocumentHelper: add missing analyze callsJay Berkenbilt
2021-03-04Don't use handleWarning, which is being revertedJay Berkenbilt
2021-03-04Major rework of handling form fields when copying pages (fixes #509)Jay Berkenbilt
2021-02-23Spell checkJay Berkenbilt
2021-02-23Keep only referenced form fields in --pagesJay Berkenbilt
2021-02-23Preserve form fields when splitting pages (fixes #340)Jay Berkenbilt
2021-02-23Add methods for copying form fieldsJay Berkenbilt
2021-02-22Change from QPDF{Array,Dict}Items to aitems() and ditems()Jay Berkenbilt
2021-02-21Add transformAnnotations and fix flattenRotations to use itJay Berkenbilt
2021-02-21addFormField: update cache rather than invalidatingJay Berkenbilt
2021-02-18Add QPDFAcroFormDocumentHelper::addFormFieldJay Berkenbilt
2021-02-18Form field for non-widget just returns nullJay Berkenbilt
2019-06-21Fix sign and conversion warnings (major)Jay Berkenbilt
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.
2019-01-04Add basic appearance stream generationJay Berkenbilt
2018-06-21Allow setting a form field's valueJay Berkenbilt
2018-06-21Implement helper class for interactive formsJay Berkenbilt