With the previous implementations of AFNumber_Keystroke [MR 988](https://invent.kde.org/graphics/okular/-/merge_requests/988), we ensure that during a keystroke event, a user does not enter thousands separator. With this in mind, numerical fields can always be first converted to en_US format and then used for calculations. This ensures that all numbers are correctly interpreted.
BUG: 474661
Also did some refactoring on the keystroke, format, validate methods.
Created new methods that can accept any generalized form field to allow
for the operations on FormFieldChoice as well.
the d_func hierarchy is quite common and should just be generalized.
That way, the suppressions might be able to be moved centrally
Also function argument pointers constness is something one should really
consider if it is worth fixing (it often isn't) due to issues with
binary compatibility or if the base or interface class might define it
without const pointers.
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
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.
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
After trying to measure the effect of switching TinyTextEntity from a
custom SBO string type to just QString and getting a barely measurable
gain, TinyTextEntity kind of looked like TextEntity, so merge those two.
Also reduce the amount of new/deletes around TextEntities
Implement a string pool for some tiny strings, and various memory optimizations
It complicates stuff further down the line and we don't gain much for
it, so work with the rest of the stack rather than work around it.
One of the complications is that if bindir contains both plugins and executable, we will have okular and okular/ in the same folder and that doesn't really work.
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.