Commit graph

1625 commits

Author SHA1 Message Date
Yuri Chornoivan 39b6e8147d Fix minor EBN issues 2018-09-01 11:25:57 +03:00
Yuri Chornoivan c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Albert Astals Cid 6a37055351 Merge remote-tracking branch 'origin/Applications/18.08' 2018-08-27 01:09:44 +02:00
Yuri Chornoivan c7722c4078 Fix minor EBN issues 2018-08-17 21:05:01 +03:00
Albert Astals Cid 9ba8dd2cd7 Make sure sorting in the configure backends is always the same
The sorting is not the best, but at least it's always the same now :D
2018-08-14 10:37:30 +02:00
Albert Astals Cid 4f06f742f9 Fix properties dialog path not being correct on Save As
We need to clear DocumentInfo because otherwise it is cached and refers
to the old file

BUGS: 397039
2018-08-09 00:27:42 +02:00
l10n daemon script d85fe1df64 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-08-04 07:49:58 +02:00
Albert Astals Cid 6d3837e6f4 Merge remote-tracking branch 'origin/Applications/18.04' 2018-07-10 00:51:34 +02:00
Albert Astals Cid 14dc396cdb Do not crash on right-click on TOC item with no associated page
BUGS: 396326
2018-07-10 00:49:08 +02:00
Albert Astals Cid 66b5f9c83c Merge remote-tracking branch 'origin/Applications/18.04' 2018-05-30 10:57:00 +02:00
Albert Astals Cid 95bc29a76f Force release of free memory
This should not be needed, but i can totally reproduce that without it
top is still reporting lots of memory used by Okular when it's really
not (heaptrack reports memory freed correctly)

BUGS: 394834
2018-05-30 10:55:17 +02:00
Andre Heinecke 18d404c3ee Support additional widget actions in PDF Forms
Summary:
This adds support for actions associated with form fields
through corresponding annotation widgets.

Test Plan:
Still needs a unit test, only tested manually with
the document attached in the task.

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: okular-devel, aacid

Tags: #okular

Maniphest Tasks: T8627

Differential Revision: https://phabricator.kde.org/D12665
2018-05-30 10:04:21 +02:00
Andre Heinecke 3ae2ae06e8 Fix recalculating forms twice
Summary:
As a side effect of f0a80a67 a recalculation was triggered
by the notifyFormChanges called in EditFormTextCommand::redo,
which is called for each edit. So calculation was done twice.

Test Plan: The calculate forms test still passes.

Reviewers: aacid

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D12825
2018-05-28 16:03:54 +02:00
Aleix Pol ac53737242 Remove dup'ed comment 2018-05-13 17:56:05 +02:00
Aleix Pol cf4bb5e3b1 Android: Make it possible to associate with files
Summary:
Put the file into a file descriptor and open this file descriptor.
Just application/pdf for now.

Test Plan: opened some documents on my phone

Reviewers: #okular, aacid, mart

Reviewed By: mart

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D12770
2018-05-11 19:27:13 +02:00
Albert Astals Cid 3a060a1680 Delete old actions when setting new
Noone should be calling this twice, but there's no need to leak memory if they do
2018-04-30 14:03:22 +02:00
Andre Heinecke 1de0f5465b Add support for chained / next actions
Summary:
This adds support for multiple actions following each
other through the "Next" value of Action dictionaries.

Test Plan: Activates the corresponding part of the visibilitytest.

Reviewers: #okular

Subscribers: sander, aacid

Tags: #okular

Maniphest Tasks: T8278

Differential Revision: https://phabricator.kde.org/D11609
2018-04-30 14:02:49 +02:00
Andre Heinecke bf90867c13 Add support for dynamic visibility
Summary:
This adds the hidden property to JavaScript fields and
uses it to implement support for HideAction.

Test Plan: Unit test in the next commit.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T8274

Differential Revision: https://phabricator.kde.org/D11596
2018-04-23 23:55:01 +02:00
Albert Astals Cid 47836646d7 Merge remote-tracking branch 'origin/Applications/18.04' 2018-04-17 00:39:32 +02:00
Ahmad Osama 6a2ed4f314 [Okular] Bug 387282: Highlighting of search results lost when rotating page
Summary:
The highlights were removed when rotating the page, also the RotaionJob::rotationMatrix function was not rotating the Highlihgts correctly.
I removed the deletion and modified the rotaionMatrix function by making it shorter and adding a translation after the rotatin. I tried different rotations and they are working fine.
BUG: 387282

Reviewers: #okular

Subscribers: aacid, ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D11901
2018-04-17 00:39:02 +02:00
Aleix Pol c325b342f3 Make some frameworks optional so okular can be built on Android
Summary:
Disables KWallet integration if there's no KWallet, KJS if there's no
KJS and KDocTools.
Here's a list of frameworks that don't work on Android:
https://cgit.kde.org/sysadmin/ci-tooling.git/tree/local-metadata/project-ignore-rules.yaml

Test Plan: Still works locally, ran Okular and Okular Mobile on Android.

Reviewers: #okular, aacid

Subscribers: aacid

Tags: #okular

Differential Revision: https://phabricator.kde.org/D12177
2018-04-16 22:41:19 +02:00
Albert Astals Cid d3c89a1505 Cancel request when removing an observer
There's no need to continue generating something that won't be useful.
Also fixes a crash if the request would report partial updates since at that stage it uses the observer and that is gone
2018-04-06 11:19:23 +02:00
Albert Astals Cid 21f2c91010 Fix crash when changing pages fast on presentation mode
The crash would happen because we were setting partial updates to true on requests
that were synchronous, because that sync request was cancelling an async one (prerender)
so now we only set newRequest partial updates to true when cancellingm another one if it's asynchronous

And a sync but with partial updates request would make stuff crash because the request
would all be processed on the main thread but generator_pdf.cpp cakks signalPartialPixmapRequest
with a queued connection so we that function was called the request would have already gone
2018-04-02 21:13:27 +02:00
Andre Heinecke 8ed1d14f8d Fix CheckBox script usage
Summary:
This implements setting / getting the value of buttons,
which is important for checkboxes in scripts. It also moves
the checkbox activate action after the value is set so that
the correct value is used when the activation script is
executed.

Reviewers: #okular

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10868
2018-03-20 23:19:29 +01:00
Andre Heinecke 6897e042df Add support to set read only from scripts
Summary:
This makes it possible to set the read only state from
scripts. Requires Poppler master with the patch attached to the parent task.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10867
2018-03-20 23:19:29 +01:00
Andre Heinecke f0a80a675f Recalculate forms after command form changes
Summary:
notifyFormChanged is called by documentcommands when
Form fields are changed. E.g. by Undo / Redo.
We need to recalculate after such changes.

Test Plan:
Tested with simple_calculate example.

Run the unit test with the added line commented out and it failed, with the added line it passes.

Reviewers: #okular

Subscribers: aacid, ltoscano

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10547
2018-02-22 00:13:25 +01:00
Andre Heinecke cead2bbef3 Add initial support for built-in javascript functs
Summary:
This starts by adding support for AFSimple_Calculate which
is the standard "calculate" function in Adobe Acrobat Pro.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10049
2018-02-22 00:12:44 +01:00
Andre Heinecke d50c06df25 Add refresh widgets if underlying field changes
Summary:
If a field is updated because of a calculate form action /
a script execution, not only refresh the rendered pixmap but
also the corresponding formWidget.

Test Plan: Unittest in separate revision. Tested it manually, too.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10048
2018-02-22 00:12:34 +01:00
Andre Heinecke d3a549ca25 Add JavaScript Event Object handling
Summary:
This adds a new data object "Event" that can be used
to carry information in and out of JavaScript execution
contexts. The Event Object is defined in the Adobe JavaScript
scripting reference.

The implementation now adds handling for the FieldCalculate
Event. It should be extensible enough so that in the future
more events could be supported.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10073
2018-02-22 00:11:20 +01:00
Sergio Bragin 54c741844b Fix realDpi function for Mac
Summary:
Removes old Utils::realDpi function for Mac. The old code employs functions
CGDisplayCurrentMode and CGDisplayIOServicePort, which are deprecated as
of versions 10.6 and 10.9, respectively. Now Mac uses the same code, as
Linux does, since it works out of the box.

This commit automatically fixes the long-standing bug of having an
implementation of realDpiX() and realDpiY(), which are not declared in
the utils.h file.

Reviewers: #okular, rjvbb

Reviewed By: rjvbb

Subscribers: rjvbb, cullmann, aacid, kde-mac, ltoscano, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10415
2018-02-18 19:24:19 +01:00
Albert Astals Cid 739b591e25 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-15 10:14:45 +01:00
Albert Astals Cid e8d9feed70 Fix potential crash in document saving
Probably doesn't happen very often since most of the times people don't save while rendering is still happening
but if that is the case we need to wait for all the rendering to finish otherwise we remove the document
from under the render thread feet and bad things happen
2018-02-14 17:51:01 +01:00
Andre Heinecke 9f458a54cf Fix regression in refreshPixmaps 2018-02-10 00:37:19 +01:00
Albert Astals Cid 2d8b2c7e95 Add support for cancellable image rendering and text extraction
Summary:
Only supported by the pdf backend if using poppler >= 0.63

Sadly had to change the generator API

Text cancellation is a bit wobbly still since poppler has large parts
of the code where doesn't check for the cancellation flag, but that
is something that will get automagically fixed for us if the poppler
side is improved

Test Plan: Needs https://bugs.freedesktop.org/show_bug.cgi?id=104263

Reviewers: ervin, rkflx

Reviewed By: ervin, rkflx

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9328
2018-02-01 22:53:28 +01:00
Albert Astals Cid 5acb6d06f0 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-31 11:18:53 +01:00
Albert Astals Cid acd3c81e23 Fix regression due to more QTemporaryFile behaviour changes
Make sure we call fileName because otherwise things break
2018-01-31 11:18:09 +01:00
Laurent Montel 85a91c1bb7 Fix i18n usage 2018-01-29 13:19:45 +01:00
Michel Ludwig 6b259d7000 Use Windows ANSI versions of the PathFind... methods
Differential Revision: https://phabricator.kde.org/D9937
2018-01-19 21:23:02 +01:00
Albert Astals Cid 4fc203076b Code simplification
No need to use d->m_loadedGenerators to find the generator since we already have m_generator
2017-12-14 14:33:18 +01:00
Albert Astals Cid 4e6c9f8f7a Fix crash when accessing text page after save
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
2017-12-05 23:07:10 +01:00
Henrik Fehlauer dccd83783d Prevent Okular from crashing when synctex logs an error
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.
2017-11-30 14:57:05 +01:00
Henrik Fehlauer b6573a2713 Change whitespace in synctex patches
15-prevent-leaks-and-segfault.diff did not apply cleanly with quilt.
After fixing this, some of the other patches needed a refresh.
2017-11-30 12:45:58 +01:00
Albert Astals Cid 9c352ca67c Workaround to build with older Qt
As explained in the comment we can do with using an older Qt since what this adds is really a small nicety in a corner case
2017-11-16 15:35:50 +01:00
Albert Astals Cid 3957683d76 Merge branch 'dont-use-docdata-for-annots-and-forms' into Applications/17.12 2017-11-16 15:00:23 +01:00
Albert Astals Cid 19b7e3c112 The work in this branch was sponsored by LiMux
give them some credit in the headers
2017-11-16 09:58:31 +01:00
Albert Astals Cid e29892fda4 some review tweaks 2017-11-15 11:20:25 +01:00
Albert Astals Cid 2102843273 Use the undo stack to set the modified bit
This way it's much easier to track whether we are modified or not
2017-11-14 14:52:02 +01:00
Albert Astals Cid 8e80a4f570 Account for Okular::PagePrivate::findEquivalentForm failing
It should never fail but it's better if we have the backup for not crashing at least if it does
2017-11-14 09:57:38 +01:00
Albert Astals Cid 302c38672f Make Document::swapBackingFileArchive use swapBackingFile 2017-11-14 09:49:32 +01:00
Albert Astals Cid eea5127e73 We also support opening Okular archive files 2017-11-13 17:30:54 +01:00