documentSignatureMessageWidgetText and getSignatureFormFields in gui/signatureguiutils.cpp
have similar loops to extract PDF form fields from pages. I made both loops more similar
and added early exit loop conditions to improve performance in documents with many pages.
documentSignatureMessageWidgetText and getSignatureFormFields have similar loops to extract PDF form fields from pages. I made both loops more similar and added early exit loop conditions to improve performance in documents with many pages
We now definitely has std::as_const available and Qt has started nagging
about converting to std::as_const.
Implementation is the same for both functions, and qAsConst was a
stop-gap measure until std::as_const was sufficiently available.
Instead of just a simple list of "nickname"'s which is kind of like the
signing backend's internal ID for a given certificate, provide some more
context to each key.
This is a slight improvement, not a complete overhaul.
It turns out that there were two issues at play here: rounding errors
meant that pixmaps were almost never the same size as pagePainter
thought the tiles should be, and the tile-is-the-size-it-should-be code
path was broken (but only hit in rare cases, seemingly at random).
To help with rounding errors in the future, I added a geometryF function
to NormalizedRect that returns a QRectF. In general,
device-independent-pixel points/rects should be floating point, and
device-pixel rects should be integer.
PagePainter::paintCroppedPageOnPainter had a few calls to
QPixmap::setDevicePixelRatio on pixmaps it does not own, which detaches
the pixmap, making a deep copy. It turns out these were all unnecessary.
It also copied scaled before drawing them onto the painter.
I've tested all the changes except for the annotation stamps, which I'm
just assuming works like the others.
Also ran clang-format.
Better enforce them now, so that the work to port doesn't increase over
time
Not a super fan of this for regular applications, but oh well the ship
has sailed
QLinkedList is deprecated in later Qt5 and gone in Qt6
The 1:1 port is std::list but in this cases all we ever do
is create the lists, push back to them, and pass then around
to be read, for that a QList is more than enough