The Qt6 port left sometimes a deleted pointer behind to be dereferenced
later.
Fix this by leveraging smartpointers.
Also clean up the related code to be a bit more specific about data
deletion
Rather than opening a new window/tab with an extra document when signing
a document, replace current active unsigned document with the signed
version.
At least for some users, including me when testing,
it gives annoyance or confusion.
Fixes two things:
1. Cursor positions are being incorrectly calculated in scenarios where keystroke actions reject some input text.
2. Undo/redo operations were buggy and the commands would not merge often leading to single character undo/redo most of the times.
at least certain documents triggers asserts in qt debug mode if a
filename does not contain a space.
Malformed TFM font files can trigger quite serious out of bounds writes.
Also simplify initializations
Currently event.change evaluates from first point of difference to end of the string. This MR modifies it to evaluate to whole incoming text. Now we evaluate whatever change is coming in, even if that change contains some common substring with original string (not considering only from the first point of difference).
The current definition makes it difficult to evaluate the final value from event.value and event.change within Javascript. This change is also better from compatibility POV as other readers such as Adobe and PDF.js make similar calculations.
Use NFC in copy, makeWord, and export functions, and NFKC for search operations.
NFKC may alter characters when copied or exported. For example ⑥ in pdf will be pasted as 6. So most instances are replaced with NFC.
To simplify matching during search operation, NFKC is used.
BUG: 466521
CCBUG: 473495
When adding/removing an annotation, the tree would collapse
completely every time, due to the model being fully reset().
Handling row insertion/removal in the proxies would lead to
very complicated code, so instead use KViewStateSerializer to
save/restore the expanded state, based on displayed texts
(e.g. "Page 4 / David Faure").
This required splitting up rebuildIndexes() so we can save on
aboutToBeReset and restore on reset().