This patch turns Okular into a ReadWritePart. Annotation editing is always
disabled if we're loaded as ReadOnlyPart, no matter the document type.
REVIEW: 105020
The only affected generator is poppler. Note that:
Document has /Encrypt <=iff=> SaveInterface supportsOption(SaveChanges) is false
This patch enforces the following behavior (and warns the user the first time
he edits an annotation).
- If the document has /Encrypt, warn that "Save as" is not available, but it's
possible to export as okular archive. New annotations will be automatically
saved to XML as usual.
Note that the previous patch already made all existing annotations uneditable,
because there's no way to save them.
- If the document has no /Encrypt and there are existing external annotations,
warn that changes won't be saved automatically. The user needs to "Save as" or
changes will be lost.
- If the document has no /Encrypt and there aren't existing external
annotations, don't show any warning. New annotations will be automatically saved
to XML as usual and to file if "Save as" is pressed.
The previous counter-based approach didn't take into account existing names used
by external annotations and names used in other pages.
Instead of creating a document-global table of used names, I used random UUIDs
as a source of unique names.
Modification and removal of *external* annotations are disabled by this
patch. Note that this change doesn't remove any functionality, because they
have never been implemented (AnnotationProxy is defined by the previous
patch).
The #if0'd blocks will be enabled by a future patch that provides fallback
behavior for generators that don't support saving changes.
mTextPageReady is only used for threaded generation and this is a sync one so resetting it to true make very bad things happen
An improvement of this area is needed since it makes no sense canGenerateTextPage returns mTextPageReady when generateTextPage doesn't use itB
BUGS: 297379
FIXED-IN: 4.8.3
(cherry picked from commit c29ce712cf)
I did not have time to finish the poppler work and even if this will probably be good for using the poppler work, this adds new API and I don't want to commit to this since having a proper look at making it work
Sorry i failed to fulfill my promise
This is needed because sometimes the hash had collissions and make it impossible to know which character we had to put back
Now we just keep the word and the characters together in the same class and it is much easier to correlate them
Also the code gets much more simplified and less new/delete are needed
This fixes the crash in 287138
I am still concerted that we use the page width and height in TextPagePrivate::correctTextOrder, but that should not cause crashes, at most some misplacements of very small text
TextPagePrivate::correctTextOrder was running makeAndSortLines + calculateStatisticalInformation to calculate the tcx, tcy
to pass it to XYCutForBoundingBoxes and then in XYCutForBoundingBoxes we were doing the same but just for when countLoop was not 0, thus
if we remove the first code and remove the check for countLoop being not 0 we end up with the same behaviour