Summary:
Okular allows to drop changes when saving to a file format not
supporting those. However, this is only sensible for {nav Save As},
while for {nav Save} the {nav Continue} button is not needed. When this
behaviour was introduced in 481676dced, the `jpg` test row failed
subsequently, because `closeDialogHelper` relies on the availability of
the {nav Continue} button. The `epub` test row is similar, but `returns`
early because it does not allow `canSwapBackingFile` and therefore does
not fail the test afterwards.
As the test progresses, the initial {nav Save As} (`potato.jpg` to
`/tmp/123.jpg`) is implicitly followed by {nav Save} (`/tmp/123.jpg` to
`/tmp/123.jpg`) for each subsequent `part.saveAs`. This causes the
{nav Continue} button to vanish, so eventually the test will fail.
Forcing {nav Save As} so the {nav Continue} button continues to exist
could be done in multiple ways, but just alternating between two
different files to save seems like the most efficient and most readable
approach.
Test Plan:
- `./autotests/parttest testSaveAsUndoStackAnnotations:jpg` now passes.
- Other test rows still pass.
- No changes to non-test code needed.
Reviewers: aacid, #okular
Reviewed By: aacid, #okular
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D9579
Summary:
In general Okular makes it very hard to get the filename extension for
document archives wrong when saving. Still it would be nice to document
this.
BUG: 291176
Test Plan: `meinproc5` still happy.
Reviewers: lueck, yurchor
Reviewed By: yurchor
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D9577
text page was storing a pointer to a PagePrivate pointer but those die
after saving so we need to store a Page pointer since those are stable.
BUGS: 387247
bd20e48c3c updated Okular's copy of the synctex code to 1.19.
Unfortunately since this version the upstream code logs errors like
`"! SyncTeX Error : Ignored record...` when accessing selected synctex
files created with older versions of synctex.
The upstream `_synctex_log` contains `va_list arg` as a parameter, but
fails to initialize and tear down this properly via `va_start` and
`va_end`. In general this seems to work for the single argument case.
However, once we apply our hardening patch to get rid of the
`gnu_printf format attribute` warning and thus introduce a variadic
argument, things go wrong.
To fix this, we add the missing code. The remaining changes are just
refreshing the patches.
BUG: 383915
Test Plan:
Opening `empty.pdf` with `empty.synctex.gz` from
https://bugs.kde.org/attachment.cgi?id=109116 located
in the same folder does not lead to Okular segfaulting anymore.
Summary:
pixelValue/pixelValue will give us a normalised value.
Normalised values shouldn't be modified by a device pixel ratio.
We want scaledRect not dScaledRect.
BUG: 386110
Test Plan:
Searched for text. Zoomed in, panned about
Created annotations, they still seemed to work
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8832
Summary:
pixelValue/pixelValue will give us a normalised value.
Normalised values shouldn't be modified by a device pixel ratio.
We want scaledRect not dScaledRect.
BUG: 386110
Test Plan:
Searched for text. Zoomed in, panned about
Created annotations, they still seemed to work
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8832
Summary:
Unfortunately, poppler (the only backed that supports saving) is not able
to save properly if the file is modified by a third party while it is opened
So we give the user a warning saying things went wrong and give him the option
to not reload/close, that way if there was something very important in the annotations
she added she can try to save them (even if by copy&paste the contents to a third program)
Reviewers: rkflx
Reviewed By: rkflx
Subscribers: ngraham, rkflx, ltoscano, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8863
Summary:
It appears it's copied and pasted from LibCHM and while it's indeed
needed to support displaying CHM files, it's a library of its
own.
Reviewers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8879