Commit graph

1987 commits

Author SHA1 Message Date
Alex Richardson 0f4f3b1902 Fix -Werror build failure in synctex parser
I am cross-compiling with clang for FreeBSD and the build is failing with:
error: initializing 'char *' with an expression of type 'const char [1]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

Mark the char pointers as const to fix this build failure.
2021-07-12 14:18:39 +01:00
Luigi Toscano 9327fd485d Fix terminology: MIME Type 2021-07-02 19:27:53 +02:00
Alexander Lohnau ac083e44e3 Make meaning of sponsoring note more clear 2021-06-10 08:11:56 +00:00
Alexander Lohnau bf4c8da4fc Manual fixes to license headers 2021-06-10 08:11:56 +00:00
Alexander Lohnau 24c75071be Move sponsoring note outside of SPDX-FileCopyrightText statement 2021-06-10 08:11:56 +00:00
Alexander Lohnau 3c5cfc8abc Convert license files for core/synctex directory 2021-06-10 08:11:56 +00:00
Alexander Lohnau 2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +00:00
l10n daemon script 6ad2ebdbbb 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"
2021-06-02 02:15:07 +00:00
Albert Astals Cid 81344f8aa8 Unbox alert() parameters when they are in an object
API let's you use both arguments or objects with named properties, so
support both.

This fixes the contents of the warning in 435833, the crash is still
there though, working on that next

CCBUGS: 435833
2021-05-24 19:53:03 +02:00
Albert Astals Cid 72658e0ec3 Fix saving signed revisions of a signature
We don't need a QDataStream to assign a QByteArray to a QByteArray, and
it was adding some noise at the beginning which is clearly not what we
want
2021-05-06 21:09:49 +00:00
Oliver Sander ccda6d2a65 Remove device pixel ratio scaling from PixmapRequest
The PixmapRequest constructor expected width and height in logical
pixels, and scaled them to device pixels.  However, not knowing what
screen the request is for, it had to use qApp->devicePixelRatio()
for the scaling.  That value may not be correct if not all screens
use the same scaling.

Fix this by introducing a new constructor that takes the device
pixel ratio as an additional argument, and deprecating the old
constructor.
2021-03-08 00:23:11 +01:00
Albert Astals Cid 275b7ea57c Remove todo from NormalizedRect::operator|
as far as i can see that works just fine

GIT_SILENT
2020-12-25 23:58:33 +00:00
Albert Astals Cid b1fa4caaf2 Merge remote-tracking branch 'origin/release/20.12' 2020-12-22 01:25:17 +01:00
Albert Astals Cid d112682611 Make search work on documents that describe Å as A + ◌̊
BUGS: 430243
2020-12-21 22:32:39 +00:00
Albert Astals Cid 33ccbc0449 Signing: Don't say that there are no certificates if the user cancels...
...entering the pwd for the certificate store

Also Move CertificateStoreImpl to PopplerCertificateStore, since
PopplerCertificateStore was declared but never defined and use it
in CertificateTools to get the certificate list instead of calling
the poppler classes directly
2020-12-13 21:31:14 +00:00
Albert Astals Cid 242718a9a2 Only ask for certificate password if really needed 2020-12-13 21:31:14 +00:00
Albert Astals Cid 49f784ecf9 When signing save to a new file, not over the current one 2020-12-13 21:31:14 +00:00
Albert Astals Cid 9728d8b426 We don't do getFoo in Okular API 2020-12-13 21:31:14 +00:00
Albert Astals Cid 6325a4fe0b Make sure you have no unsaved changes before saving 2020-12-13 21:31:14 +00:00
Albert Astals Cid 18ef1349f1 Improvements to adding digital signatures
* Don't make WidgetAnnotation know about signatures stuff, widget
   annotations are for multiple things
 * Don't create an "empty" widget annotation and then call sign on it
   (which is wrong because widget annotations can be multiple things),
   just say sign the document with this data (cert, l&f, etc)
 * Remove the "management" functionality from CertificateTools it was
   only visual, i.e. it didn't really add/remove certificates
 * Ask for the NSS password (if needed)
2020-12-13 21:31:14 +00:00
Albert Astals Cid b09e23f6ab Run clang-format
Attempting to fix the whole chain of commits is not worth it
2020-12-13 21:31:14 +00:00
Albert Astals Cid bcf54ef2f1 These two methods don't need to be slots 2020-12-13 21:31:14 +00:00
Thorsten Behrens 3eedb21a83 Consistenly use CERT nick to refer to signing key 2020-12-13 21:31:14 +00:00
Thorsten Behrens f7d6045b92 Add poppler NSS support
Move certificate config down into generator code
Read available signing certificates from poppler NSS
2020-12-13 21:31:14 +00:00
Thorsten Behrens b96dac6df3 Add certificate store for access to NSS keys
WIP - add interfaces and methods to get access to NSS-via-poppler
sign certificates, and provide them for signing documents.
2020-12-13 21:31:14 +00:00
Thorsten Behrens 847b423e2a Add better diagnostics 2020-12-13 21:31:14 +00:00
Thorsten Behrens e031822744 Adapt to poppler sign api change
Now poppler offers signing via PDFConverter class. Add some error
handling, and store signature in temp file. Document gets reloaded
after replacing original file.
2020-12-13 21:31:14 +00:00
Thorsten Behrens e3e582ee5c Add feature flag for poppler signing API
Test and conditionally-compile pdf signing feature, depending
on poppler new-ness.
2020-12-13 21:31:14 +00:00
Katarina Behrens cc908b9f92 Pass pointer to widget annotation just added down the chain 2020-12-13 21:31:14 +00:00
Katarina Behrens 03381667f6 Pass certificate CN and password down the chain 2020-12-13 21:31:14 +00:00
Katarina Behrens d320fa17ad Stub some iface for signing the document 2020-12-13 21:31:14 +00:00
Nicolas Fella 50e8c4f333 Port an occurence of KMimeTypeTrader
It is about to be deprecated

See https://phabricator.kde.org/T12177
2020-12-12 18:04:26 +00:00
Albert Astals Cid 39846f8c16 Merge remote-tracking branch 'origin/release/20.12' 2020-12-09 21:15:36 +01:00
Albert Astals Cid d1c2eed1b6 Make the CI pass with new clang-tidy
Disable bugprone-suspicious-include since it's triggered by the moc
includes

Disable bugprone-reserved-identifier since it's triggered by all our
_OKULAR defines, and yes even if the spec says that underscore is
reserved, are we going to be that unlucky that the library decides to
start using _OKULAR ? not probably

Add two TODOs for the future to make NormalizedRect/Point faster

Silence a warning about a quick moving QString if we make it non const

Silence a uchar vs char warning that is in decades old code so
experience seems to suggest it's ok.
2020-12-09 19:53:50 +01:00
Albert Astals Cid d9487fc764 Merge remote-tracking branch 'origin/release/20.12' 2020-12-06 19:13:23 +01:00
Albert Astals Cid 4f2c2b2714 Document::openRelativeFile: Double check the url changed when we asked to
If not, open did not succeed and the callers (for example open document
X in page A) would like to know so they don't have to do the "change to
part A" part.

BUGS: 429924
2020-12-06 17:33:34 +00:00
Alexander Lohnau 3c1fa441d9 Remove dead code
A lot of this code has been commented out for over
a decade and adds no value to the project.
It is only annoying when you look over it ;).

Same for the KNS2 support which was commented out.

Also some of the debug statements didn't even build
anymore, because the properties got removed/refactored.
2020-11-14 10:52:00 +01:00
Albert Astals Cid 6bd6714ab0 poppler: Use actual function calls instead of xml to create poppler annotations 2020-11-11 00:43:54 +00:00
Albert Astals Cid becdc7c483 Revert the two last commits
f9841b0f8a and e0f45add55

They break the windows build, which shows there's something defenitely
fishy going on with the current code, but oh well, someone with more
time needs to figure out a proper solution
2020-11-11 01:31:47 +01:00
Albert Astals Cid e0f45add55 Enable -Wweak-vtables in clang
Read https://stackoverflow.com/a/23749273/11956287 for a full
explanation, but basically this is important for headers like the
interfaces/ and kdocumentviewer.h that are supposed to be used by third
partyies where it may happen that wrong things happen because the whole
class is inline in a header

For the classes that are defined in the .cpp or are not installed
headers this would not be necessary but it's not so hard to add a few
default defined destructors, so do that :)
2020-11-08 21:21:06 +00:00
Albert Astals Cid b9c40d709d Fix formatting after Laurent's commit
Please Laurent try to use MR when you do changes that may break our CI
like this one

CCMAIL: montel@kde.org
2020-10-23 22:48:44 +02:00
Laurent Montel 486e05b270 If include is define in .h remove it if it's defined in .cpp too (scripted) 2020-10-23 07:32:28 +02:00
l10n daemon script dc74ffa68c 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"
2020-10-17 06:04:22 +02:00
Nate Graham d78e2ff9e7 Merge branch 'release/20.08' into master 2020-09-29 09:36:56 -06:00
Kezi Olio bdb2df773d Fix forms when inertially scrolling
`setViewport` automatically adds an item to the history if it finds that it
moved for more than a page, which we don't want to do when automatically
scrolling, as with inertial scrolling.

This commit adds a new function `setViewportWithHistory()` which takes an
argument to optionally avoid preserving history. This avoids breaking ABI.
The new history-less functionality is used when inertially scrolling.

BUG: 421354
FIXED-IN: 1.11.2
2020-09-25 15:41:23 +00:00
Friedrich W. H. Kossebau 1784c1d0cb Use more nullptr instead of 0 2020-09-13 11:20:09 +02:00
Thomas Friedrichsmeier 3fda3ba561 Fix build using MinGW 2020-09-11 16:24:44 +02:00
Christoph Cullmann 25984bb2bb add missing export to class
BUG: 426358
2020-09-10 20:51:52 +02:00
Albert Astals Cid 2697105462 Revert cbddcd3273
KJS and KWallet are indeed optional, that's what the ${optionalComponents} variable does
2020-09-09 14:13:09 +02:00
Albert Astals Cid cbddcd3273 kwallet and kjs are mandatory in cmake anyway, remove ifdefs 2020-09-05 23:50:45 +00:00
Albert Astals Cid 511fc7acca Document the valid int values for TextAnnotation::setInplaceAlignment 2020-08-21 15:35:32 +02:00
Albert Astals Cid caa351c723 Bookmarks: Resolve symlinks before using an url
If a symlink points to another file, we should use that file as
canonical source for bookmarks, it doesn't make sense to have two
different sets of bookmarks for two paths that are essentially the same
file

BUGS: 424340
2020-08-07 22:34:30 +00:00
David Hurka 93e67cca93 Port away from QDesktopWidget
This ports Shell from QDesktopWidget to QScreen (trivial),
and removes unused QDesktopWidget includes (super-trivial).
2020-08-05 23:24:36 +00:00
Albert Astals Cid 88bf8a87de Fix compile on FreeBSD 2020-07-11 10:11:31 +02:00
Albert Astals Cid 19d98d6a74 Run clang-format
find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format -i {} \;

If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
2020-07-11 09:17:33 +02:00
Albert Astals Cid b558f7f762 Changes to make clang not mess up the clazy comment 2020-07-11 07:51:27 +02:00
Albert Astals Cid bd57b36c83 Add TODO for the future to fix requestFontData function 2020-07-11 07:50:05 +02:00
Albert Astals Cid 4c150c2889 Disable the overloaded-signal in two signals in TextDocumentGenerator
We already have a TODO for when we can do BIC changes
2020-07-09 21:38:29 +02:00
Laurent Montel 516fb89d94 Use camelcase include. (scripted) 2020-07-08 13:54:37 +02:00
Albert Astals Cid a3c7d81000 Merge remote-tracking branch 'origin/release/20.04' 2020-06-30 19:37:33 +02:00
Albert Astals Cid 795c7cb01f Increase kjs requirement for using the timeout check
Unfortunately with the new timeout code but older than 5.72 will crash on appAlert

So increase the requirement to > 5.71
2020-06-24 12:06:32 +02:00
l10n daemon script 7254c56886 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"
2020-06-18 08:26:04 +02:00
l10n daemon script 90502b2961 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"
2020-06-18 05:35:59 +02:00
l10n daemon script 1f50b2a6b4 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"
2020-06-17 16:48:38 +02:00
l10n daemon script 2857dc241f 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"
2020-06-17 14:03:40 +02:00
Albert Astals Cid 03cee363cd Merge remote-tracking branch 'origin/release/20.04' 2020-06-15 23:41:57 +02:00
Albert Astals Cid d78cbb79c9 Fix/Workaround file where we can't enter values in some fields
The problem was that the JS checker for the field format was using the
willCommit property of event and we don't define it so the JS
interpreter was going "ok nope, out of here" and the field didn't get edited.

I've read the willCommit definition in js_api_reference.pdf for almost
30 minutes, and even it's just 3 lines i don't think i understand it,
but i think that returning true is "safer", i.e. says that this event is
going to actually change the field, which as far as i can see it's what
we always do

BUGS: 421508
2020-06-15 20:45:21 +00:00
l10n daemon script 35e43602d4 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"
2020-06-11 09:34:54 +02:00
l10n daemon script ef53790eba 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"
2020-06-10 05:21:36 +02:00
Nate Graham 4ee6b5066d Merge branch 'release/20.04' 2020-06-09 13:16:33 -06:00
l10n daemon script cc452498e5 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"
2020-06-09 09:16:32 +02:00
Nate Graham d195633b16 Display all of the page sizes in a new tab of the properties dialog
Previously it just said, "Multiple" for multi-page-size documents.
Now it will tell you the most common page size on the "Properties"
tab, and display a full table of all page sizes in a new "Page Sizes" tab.

For documents with only a single page size, there are no changes.
2020-06-02 23:24:26 +00:00
Nate Graham 0e71c95f29 Show page size field in Properties dialog when there are multiple sizes
Currently when a document has multiple page sizes, the Properties dialog
does not show the "Page Size" field at all. This MR populates the field
with the string "Multiple" for documents with multiple page sizes.
2020-05-27 09:40:50 -06:00
Yuri Chornoivan 4d75045cd8 Fix minor EBN issues 2020-04-04 12:17:50 +03:00
Albert Astals Cid 5035f90dd9 Fix forms sometimes showing an old value
If from processFormatAction we call setAppearanceText,
we need to call setAppearanceText from outside too, otherwise when the
formatting action doesn't create a different text we still show the old
old value

CCBUGS: 418445
2020-03-28 23:12:08 +00:00
Albert Astals Cid d3b43b0b1e Implement AFMakeNumber
Also make stringToNumber be stubborn when converting strings to numbers

CCBUGS: 418445
2020-03-28 23:12:08 +00:00
Albert Astals Cid 9084bfaabe Fake implement AFNumber_Keystroke
Needed by the file at bug 418445, since it's a validate kind of thing we
can leave it unimplemented for now
2020-03-28 23:12:08 +00:00
Albert Astals Cid f69e2114e7 Use poppler choicesWithExportValues if available 2020-03-28 23:12:08 +00:00
Albert Astals Cid 9694113a96 Let the user type the hyphen if he wants when searching
It happens that sometimes the hypen is actually "part of the word" like
in one-third, so if there's one- at the end of a line
and third at the beginning of the next, we should still match and not
force the user to type onethird, even we will also match onethird since
there's no way to know if "hyphen at end of line" is supposed to be part
of the word or not

BUGS: 418520
2020-03-28 13:59:01 +00:00
Albert Astals Cid 6a93a033b4 Document::processAction: If the url points to a binary, don't run it 2020-03-10 23:07:55 +01:00
Andre Heinecke ad405165b1 Add AFNumber_Format and l10n AFSimple_Calculate
This adds utility functions to util to work with QLocale
for formatting and Number handling.

At least until we support AFNumber_Keystroke to restrict
what a user enters in Number input fields it is good
behavior to expect the user to enter Numbers in the system's
Locale.

AFNumber_Format is new for formatting and uses the
Locale util functions.
2020-03-08 13:05:36 +01:00
Kevin Slagle 493853667d add global variable kMemCheckTime 2020-03-06 23:45:29 +00:00
Kevin Slagle 8d501fc43a getFreeMemory is called every two seconds when checking to see if the system is low on memory. Before this commit, half of these checks are useless (when okular is idle) since the cache is used when the cache is <=2 seconds old. This means that after they system is out of memory, up to 4 seconds (instead of 2) could go by before okular starts to free memory. 2020-03-06 23:45:29 +00:00
Albert Astals Cid 4964e7e42d Merge remote-tracking branch 'origin/release/19.12' 2020-03-02 22:22:06 +01:00
Albert Astals Cid 81c005710c Fix re-rendering of images when using partial updates
Partial updates trigger when the page is taking "too much" to render (>
500 ms).

When this happens we store a pixmap for the page, this meant that
Page::hasPixmap returned true, so when moving the viewport around we
would think that that page was already rendered, and thus needed no
rendering so we didn't add it to the list of requested pixmaps.

Then on document when seeing the new list of requested pixmaps we would
go and check and say "oh there's one request going on that we don't want
anymore, let's cancel it", so we would cancel the page that we actually
wanted (and clear the partial pixmap)

Then on the next scroll we would realize we did not have that page
pixmap and then request it again which since it's the current page would
immediately stop all other renders and start this one.

Then we would get a temporary pixmap and the loop of cancellations and
requesting again would keep happening as long as the user moved the
viewport.

We fix that my making hasPixmap return false if the pixmap we have is a
partial one, because that's what the function meant "forever" until we
recently introduced partial updates so all the calls to hasPixmap
actually mean "hasNonPartialPixmap"

BUGS: 418086
2020-03-02 21:06:03 +00:00
Kevin Slagle af99a04431 Use screen size when deciding if tile manager should be used 2020-03-01 09:32:27 +00:00
Albert Astals Cid 3720833be4 Enable clazy qstring-allocations 2020-02-21 17:45:03 +01:00
Albert Astals Cid dcf8f79481 Enable clazy isempty-vs-count and qhash-with-char-pointer-key 2020-02-21 17:09:46 +01:00
Albert Astals Cid 46d1ba0e20 Enable clazy missing-qobject-macro 2020-02-21 17:09:46 +01:00
Albert Astals Cid 6d0d61c2ad Enable clazy copyable-polymorphic 2020-02-21 17:09:43 +01:00
Albert Astals Cid 93540ac16d Enable most of clazy level2 2020-02-21 14:57:48 +01:00
Albert Astals Cid 968e9d6073 Enable clazy old-style-connect 2020-02-20 15:48:08 +01:00
Albert Astals Cid 91bce4a0a3 Enable clazy const-signal-or-slot 2020-02-20 12:42:23 +01:00
Albert Astals Cid e03943fae9 Enable clazy qstring-lef 2020-02-20 12:03:31 +01:00
Albert Astals Cid 95e19450c9 Enable clazy fully-qualified-moc-types 2020-02-20 10:59:54 +01:00
Albert Astals Cid 3b4dd35c9f Enable clazy lambda-in-connect 2020-02-20 10:57:47 +01:00
Albert Astals Cid eddbe03128 enable clazy strict-iterators 2020-02-20 10:15:24 +01:00
Albert Astals Cid 468f4b64c2 CI: Enable clazy inefficient-qlist-soft 2020-02-19 23:44:41 +01:00
Albert Astals Cid e2a1705703 CI: Enable clazy connect-not-normalized 2020-02-19 23:44:41 +01:00
Albert Astals Cid 3af705b3d7 CI: Enable clazy qdeleteall 2020-02-19 23:44:41 +01:00
Albert Astals Cid a23709b097 CI: Enable clazy range-loop 2020-02-19 23:44:41 +01:00
Albert Astals Cid 82d5810493 CI: Enable clazy detaching-temporary 2020-02-19 23:44:41 +01:00
Albert Astals Cid 6ddb7e6cc9 CI: Enable clazy qhash-namespace 2020-02-19 23:44:41 +01:00
Albert Astals Cid 96f00a4d29 CI: Enable clazy qstring-arg check 2020-02-19 23:44:37 +01:00
Yuri Chornoivan 5c6a297feb Fix minor EBN issues 2020-02-13 11:47:51 +02:00
Harri Porten c1afa356c0 Restrict time given for JavaScript evaluation to max. 2 seconds.
Possible improvement: alert the user of the timeout and offer
the option to continue or abort execution.
2020-02-11 22:34:46 +00:00
Albert Astals Cid 99b4f276e1 Clear m_openError before opening 2020-02-11 00:27:46 +01:00
Albert Astals Cid 18873d18a2 Document the since for Document::openError 2020-02-11 00:25:04 +01:00
Albert Astals Cid 987abf54d7 Move the private slot to a lambda
This way we don't need a private function in a public class
2020-02-11 00:25:00 +01:00
Andi Sardina Ramos c549d28f7f Solving the creation of an additional tab for a deleted file.
BUG: 412978
BUG: 412979
2020-02-10 23:22:06 +00:00
l10n daemon script a26dd5118a 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"
2020-02-04 10:04:28 +01:00
l10n daemon script 0d5bd0bc43 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"
2020-02-04 06:09:17 +01:00
Albert Astals Cid b82682037e Merge remote-tracking branch 'origin/release/19.12' 2020-01-31 10:22:59 +01:00
Tobias Deiminger 378e99d719 Fix race condition in generator.cpp
The check whether to allocate a new QMutex was unprotected.
Two threads may check and allocate concurrently, but only one pointer gets
remembered, the other one will leak. In worst case the returned
mutex is different for two threads, so that two threads try to
synchronize by using two different mutexes.
2020-01-30 09:42:17 +01:00
Tobias Deiminger 593803b0a1 Fix render stop and high load due to timing issue
Text generation is connected to pixmap generation thread started signal.
However the signal may have been emitted faster than the connect could took place,
and because started is fired only once, the connected lambda never got executed.

generatePixmap tried to sync up with that never happening text generation anyway
by means of scheduling itself. This lead to a infinite loop via a no more sleeping QEventLoop.

Fixed by moving the connect in front of starting the thread.

BUG: 396137
BUG: 396087
CCBUG: 403643
2020-01-30 09:15:40 +01:00
Ahmad Samir 4a4456abd7 Port QRegExp to QRegularExpression in a couple of locations
Some instances of QRegExp are still left:
generators/mobipocket and generators/epub
2020-01-26 11:40:33 +00:00
Albert Astals Cid 2da1cd736a CI: Enable clang-tidy modernize-loop-convert 2020-01-24 17:23:39 +01:00
Laurent Montel 932cec415e Don't use nullptr as flags 2020-01-16 07:15:34 +01:00
Albert Astals Cid 2e46cf22f5 CI: enable clang tidy performance checks 2020-01-02 14:27:11 +01:00
Albert Astals Cid b001ea2019 CI: Enable a bunch of bugprone- clang-tidy warnings 2019-12-24 10:18:16 +00:00
Albert Astals Cid c81392a71c Remove wrong forward declarations
They are not needed and clang-tidy says they are on the wrong namespace
anyway
2019-12-23 13:15:57 +01:00
Albert Astals Cid 0a2287be19 CI: Enable two readability clang-tidy checks
Use jq to filter compile_commands.json to not include the compilation of
autogenerated files, we don't want to check those

Also filter out the synctex folder, since that is imported code
2019-12-23 12:06:49 +01:00
Albert Astals Cid c549acaab0 Move the Q_PRIVATE_SLOTS to lambda connections
Some of the invokeMethods with a queued connection get changed with a
QTimer::SingleShot with 0 which has the same behaviour
2019-12-20 16:42:58 +01:00
Albert Astals Cid 78cf6bd910 CI: enable more modernize checks
Since unfortunately some of the autogenerated includes don't pass the
checks we do a trick of building out of source and then specifying the
.*/okular/.* path as the only includes we care about
2019-12-18 12:51:13 +01:00
Albert Astals Cid a2ac42b9c7 CI: Enable modernize-use-bool-literals 2019-12-18 11:32:46 +01:00
Ahmad Samir ccf3a384c3 [core/*] replace foreach, deprecated, with range-for
The code compiles and okular seems to load and work as before, all unit
tests pass except (parttest and epubgeneratortest, but they fail on master
too).
2019-12-09 13:16:55 +00:00
Albert Astals Cid b588989dba Make AnnotationPrivate::distanceSqr const 2019-12-03 23:24:21 +00:00
Abby Berkers c56a924ab4 Add TeXiFy IDEA support 2019-11-30 01:02:03 +00:00
l10n daemon script 2d90b6210c 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"
2019-11-03 05:15:02 +01:00
Yuri Chornoivan 793d06c95d Fix minor issues found by EBN 2019-10-14 12:13:33 +03:00
Albert Astals Cid da21543a50 Small performance improvements 2019-10-05 22:16:43 +02:00
Christoph Cullmann 34476a6301 merge 19.08 fixes to master 2019-10-04 20:22:30 +02:00
Oliver Sander 8611cd775a Add @since markers for the new ViewCapability values 2019-10-02 13:00:57 +00:00
Felix Mauch bd25d17e70 Save view information per file
Adds the functionality to save the view mode (single page, facing...),
continuous scrolling, and margin trimming  to the document information,
as it is already done with the zoom information.
2019-10-02 13:00:57 +00:00
Laurent Montel 8beef33c05 Port some deprecated methods 2019-09-18 13:41:19 +02:00
Laurent Montel db0f477119 Port deprecated QLayout::setMargin 2019-09-18 13:35:04 +02:00
João Netto f31eb3cb68 Created private functions to avoid duplicated code in Document 2019-08-22 22:38:10 +00:00
João Netto 17814fc304 Implemented validate actions and made formwidgets leave these actions to QLineEdit::Event 2019-08-22 22:38:10 +00:00
João Netto 3081358836 Added support for Form Focus Events 2019-08-22 22:38:10 +00:00
Tobias Deiminger b5b273ad64 Enhance bounds check in TextDocumentGenerator
There's too much upstream / logic involved to statically prove
info.pages is always >= 0. Better check it at runtime.

CCBUG: 410844
2019-08-22 09:17:33 +02:00
João Netto 3eb6a91e25 Changed util.printd to use the default locale on case 2. Also made kjsfunctionstest to be in a consistent locale 2019-08-15 13:21:04 -03:00
João Netto 24fc9defe3 Changed AFTime_Format to work with user locale PM strings 2019-08-14 21:49:04 +00:00
João Netto f54d65ca86 Changed util.printd to work with the default locale set on QLocale::setDefault to allow consistent results in tests 2019-08-14 21:49:04 +00:00
João Netto e7b7f9bd48 Fixed wrong version in description of function 2019-08-14 20:37:11 +00:00
João Netto c7432cdae6 Implemented support for AFSpecial_Format and AFSpecial_Keystroke 2019-08-12 12:47:56 -03:00
João Netto 052662d78d Implemented support for AFTime_Format and AFTime_Keystroke 2019-08-12 11:13:03 -03:00
l10n daemon script b16dcf41aa 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"
2019-08-12 08:33:06 +02:00
l10n daemon script bf7a53d62b 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"
2019-08-12 05:10:27 +02:00
João Netto 6975c67a62 Changed nomenclature and add format action now sets the AP stream text 2019-08-11 14:55:21 +00:00
João Netto 53a8acf813 Removed the use of internalText(), replacing by text() 2019-08-11 14:55:21 +00:00
João Netto b66df68452 Implemented support for setAppearanceText defined on Poppler 2019-08-11 14:55:21 +00:00
João Netto b7249ce8c1 Implemented support for keystroke actions 2019-08-11 14:55:21 +00:00
Andre Heinecke da487f3a94 Add support for form text formatting
Summary:
With formatting there is an internal value, which represents
the true value of a field additionaly to the normal,
visible, text.

For fields which have formatting rules these might differ
and for calculations the internal value is used. The behavior
to format on focus in / focus out events is similar to
that of Acrobat reader.

Test Plan: Needs unit test

Reviewers: aacid

Subscribers: okular-devel

Tags: #okular

Maniphest Tasks: T8886

Differential Revision: https://phabricator.kde.org/D13171
2019-08-11 14:55:19 +00:00
Jan Grulich a738c98c20 Add information about substituting font into properties dialog
Reviewers: aacid

Subscribers: pino, ngraham, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D23027
2019-08-10 02:00:57 +02:00
João Netto f9e6b3e6e6 Extended util.printd support to cover new formats 2019-08-08 21:31:12 +00:00
João Netto 56e52eaf3d Support app.alert and util.printd 2019-08-08 21:31:12 +00:00
João Netto bb6bee53fe Added support for the full name of fields, which is used in the JavaScript 2019-08-07 22:40:50 +00:00
David Hurka 0602576cc5 Improve documentation of area classes
Summary:
This shall improve the documentation of several area classes,
including NormalizedPoint, NormalizedRect, RegularArea, RegularAreaRect.

This shall also clarify when absolute coordinates and when normalized
coordinates are used.

Describes the normalized coordinate system in NormalizedPoint, with a new term “reference area” do describe mapping.

TODO:
Page view rotation.
This is not done consistently in Okular, but can be changed later. I think this documentation will help (me) with that then.

Test Plan: Run doxygen

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: aacid, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21266
2019-07-21 20:00:10 +02:00
David Hurka c61a9587ec Improve documentation of TextEntity stuff
Summary:
This adds some important documentation on TextEntity and other classes, and improves some of the existing documentation.

This includes changing parameter names from ‘rect’ to ‘area’, because I found ‘rect’ misleading.

Test Plan: Run doxygen

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: aacid, yurchor, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21271
2019-07-21 10:49:51 +02:00
João Netto 60ff2f414e Fixed indentation, bad algebra and moved display enum to KJSDisplay 2019-07-20 12:06:42 +02:00
João Netto da01333817 Fixed the KJSPrototype pointers and deleted unused arguments. 2019-07-20 12:06:13 +02:00
João Netto ad858267d1 Implemented display support and updated dependencies to Poppler > 0.79
Moved executeScript to document private and support to display options for JavaScript
2019-07-20 12:06:12 +02:00
João Netto 552e4a3917 Added support for buttonSetIcon and buttonGetIcon.
Added support for the setIcon/getIcon defined in Poppler > 0_78
2019-07-20 12:05:37 +02:00
João Netto 7555212d29 Implemented the getOCGs and OCGs methods to support layer changing by JavaScript.
Implemented more unit tests to cover the OCGs
2019-07-20 12:04:59 +02:00
João Netto cc10164d34 Implemented initial support for animatedPDF
When refreshing, widgets must check if they should be visible

Implemented unit tests to the JavaScript functions.
2019-07-20 12:04:45 +02:00
Yuri Chornoivan e7ead0d3f5 Fix EBN issues 2019-07-14 10:15:45 +03:00
Albert Astals Cid ec51b2f02f Remove QFontDatabase::supportsThreadedFontRendering checks
We require Qt 5.8 and there (and up) it returns true unconditionally and
it's now marked as deprecated
2019-07-04 00:09:04 +02:00
Albert Astals Cid f1ba0d297f Merge remote-tracking branch 'origin/Applications/19.04' 2019-07-03 00:19:08 +02:00
Dr. David Alan Gilbert f4a883ea5d Partial fix for high res displays
Summary:
On high res displays we end up using
the tile manager on single pages, that doesn't work
(for reasons that aren't yet clear) - but it
doesn't make sense if we most of the page anyway.

BUG: 401339

Reviewers: #okular, aacid

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20882
2019-06-22 16:43:20 +02:00
Alexander Volkov 3311ba3a67 Use lambdas instead of QSignalMapper
Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D17481
2019-06-10 14:07:55 +03:00
Laurent Montel 563c8b3465 Fix spectre genrator after my clean forward 2019-06-04 07:12:42 +02:00
Laurent Montel 9f90e14dd1 Fix forward declaration 2019-06-03 08:48:32 +02:00
Laurent Montel cb691f70dc Fix some clazy warning
Summary: fix clazy warning

Reviewers: aacid

Reviewed By: aacid

Subscribers: nicolasfella, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20832
2019-05-27 08:02:57 +02:00
David Hurka 9791d25916 Improve documentation of Document::setPageTextSelection()
Summary:
Improve the documentation of Document::setPageTextSelection()
and PagePrivate::setTextSelections(). Also mention which argument
will be deleted.

Test Plan: Check doxygen output

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21069
2019-05-09 10:50:18 +02:00
Michael Weghorn 748884b4c7 PDF: Implement scaling options for non-rasterized printing
Summary:
This adds another 'FilePrinter::printFile' method that
accepts an additional parameter to specify whether or not to
do scaling and passes the 'fit-to-page' to CUPS dependent
on what is specified.

If FilePrinter is used, The PDF generator now passes this
option depending on the scaling mode that was selected in the
custom print options widget, which is therefore now enabled
for non-rasterized printing as well.

Test Plan:
1) open a PDF document in Okular and open the print dialog
2) go to the "PDF Options" tab
3) verify that "Force rasterisation" is disabled, but the
  "Scale mode" combobox is active.
4) test all the three options available in the "Scale mode"
   combobox do what they say
5) Make sure the three options still work as expected for
   the "Force rasterisation" case.

Reviewers: #okular, ngraham, sander

Reviewed By: ngraham

Subscribers: aacid, fvogt, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D18179
2019-04-14 21:11:36 -06:00
Michael Weghorn 8bf1a91175 Add option to ignore print margins for non-PDF generators
Summary:
This adds a combobox in the print dialog of the non-PDF
generators to allow selecting whether or not to take
print margins into account.

For the PDF case and rasterized printing, new print otions have
been implemented in commit 2e97d58750
already, which adds an additional option to do no scaling at all.

For consistency reasons, the same terms also used for the PDF
case are used in the combobox (i.e. the two of the three that
apply).

This adds a new abstract class 'PrintOptionsWidget' with a
'ignorePrintMargins()' method to indicate whether print margins
should be ignored or not, and a default implementation.
The existing widget for the PDF generator now derives from this
class.

In order to avoid an ABI breakage, the return value of
'Document::printConfigurationWidget' is left as a 'QWidget *'
and a dynamic_cast is done on use.

FilePrinter is adapted to take into account the value set by
'QPrinter::setFullPage()' and the margin options
are now passed accordingly (either the values set in the dialog or '0').

A big thanks to Albert Astals Cid <aacid@kde.org> for showing how
to extend the initial implementation to cover more generators.

Test Plan:
1) Open a PostScript file in Okular (using a document size that matches
  a paper size available on the printer used later makes it easier
  to see things behave as expected)

2) open print dialog, go to "Print options" and notice that there is a new
  "Scale mode" combobox whose value is set to "Fit to printable area"
   by default.

3) don't change any options, print to a printer that has hardware margins

Expected result: the document is scaled to the printable area (e.g.
scaled down so that the printer's hardware margins remain empty) as it
has been without this change.

4) Set the value of the "Print Options" -> "Scale mode" combobox to
   "Fit to full page" and print again

Expected result: The document is scaled to the full page size, i.e. ignoring
the printer's hardware margins.

5) Try steps 1-4 with other document formats supported by Okular and
   observe that they behave the same (except for the PDF case, where
   there's a combobox with three options that has been implemented
   independent of this change).

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: fvogt, rkflx, arthurpeters, ltoscano, okular-devel, aacid, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10974
2019-04-03 08:00:35 -06:00
Albert Astals Cid fe0c8ad7c9 MarkDown: Enable option to disable smartypants formatting
BUGS: 404616

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D19405
2019-03-30 23:51:00 +01:00
Laurent Montel 5a3a49c310 Port qSort to std::sort 2019-03-12 13:13:53 +01:00
Yuri Chornoivan 2b6e75e411 Add TeXstudio support
Summary:
Some people need it because it is now the default TeX editor in distributions.

BUG: 404120

Test Plan: "Settings -> Configure Okular... -> Editor -> TeXstudio". Should work for the reverse search if the tex file is compiled with \usepackage[active]{srcltx}

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, okular-devel, kde-doc-english

Tags: #okular, #documentation

Differential Revision: https://phabricator.kde.org/D19272
2019-02-24 22:22:00 +02:00
Joao Netto 716b234100 Implemented find function from console
Summary:
Implemented feature request to find from console.

BUG: 362038

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: ngraham, aacid, yurchor, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D18144
2019-02-13 23:59:52 +01:00
Yuri Chornoivan 3832a6522f Update Okular developer documentation
Differential Revision: https://phabricator.kde.org/D17801
2019-02-07 08:13:11 +02:00
Albert Astals Cid 014b97fd96 Include cmath for std::floor 2019-01-29 00:04:25 +01:00
Albert Astals Cid 27b76ee7c0 TextDocumentGenerator: Support links that span more than one line
Summary:
If a link spans more than one line we need one rect for each of the lines

BUGS: 403247

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D18303
2019-01-28 22:09:30 +01:00
Albert Astals Cid 5cce9a11fe Small refactor in TextDocumentGeneratorPrivate
add const to a few variables

Make two functions return a qlist instead of using a member qlist to
return the results in them
2019-01-16 19:29:52 +01:00
Yuri Chornoivan 614f580b79 Fix minor typos 2019-01-11 09:09:34 +02:00
Chinmoy Ranjan Pradhan a234a902dc Implement digital signature support for PDF
This is a squash of the original branch

It also contains fixes/rework from Albert Astals Cid

If you're interested in its history have a look at the
gsoc2018_digitalsignature branch

The poppler dependency situation is:
 * With 0.51 you get most signature information
 * With 0.68 you also get signature location/reason information
 * With 0.73 you also get signature certificate information
2019-01-10 23:13:54 +01:00
Albert Astals Cid ab96e0c07d Remove support for RegularArea template to have ptr as first typename
We don't use it and it had problems if you tried to use the copy
constructor or the assignment operator so better just remove it.

I'm unusure if this is binary incompatible, but oh well
2019-01-10 00:58:12 +01:00
Albert Astals Cid 4fb7582093 Obey rule-of-three in NormalizedPoint and NormalizedRect
I.e. make sure they have destructor, copy constructor and asignment
operator

They don't really need them since it's plain data that can be copied
with the defaul implementations (which is actually what i am using) but
since we had some of them implemented and some not, clazy was
complaining that this is generally a bad idea, so implement them all
2019-01-10 00:44:41 +01:00
Albert Astals Cid 47d7d04b5e delete copy constructor and assignment operator of some internal classes
they are unused(except the PageViewItem one), but if anyone would use
them things would go wrong, so protect us from it

Actually fixes a bug in PageView::slotFitWindowToPage in which we were
copying constructing PageViewItem and that's bad
2019-01-10 00:28:49 +01:00
Albert Astals Cid 7254c1826c K_PLUGIN_FACTORY_WITH_JSON -> K_PLUGIN_CLASS_WITH_JSON
Now that we require KF5 5.44
2019-01-07 00:56:08 +01:00
Albert Astals Cid a4a1978516 Merge remote-tracking branch 'origin/Applications/18.12' 2018-12-18 22:49:46 +01:00
Albert Astals Cid ba5ec662a2 Fix crash when writing to some forms
typo type typeo :D

BUGS: 402307
2018-12-18 22:48:04 +01:00
Yuri Chornoivan 6102c65d6e Minor fixes to API docs 2018-11-20 19:43:11 +02:00
Yuri Chornoivan 5478b2ec92 Fix minor typos 2018-11-14 21:12:15 +02:00
Albert Astals Cid ec692e459b Remove unused variables 2018-11-02 18:03:26 +01:00
Yuri Chornoivan e7cd4bf9c7 Fix doxygen markup 2018-10-27 10:43:35 +03:00
Albert Astals Cid 93b9615597 Remove #ifdef for Qt 5.8 since it is required for some time 2018-10-26 23:45:00 +02:00
Albert Astals Cid 9b96848720 Merge remote-tracking branch 'origin/Applications/18.08' 2018-10-21 22:27:16 +02:00
Albert Astals Cid 27197b5f76 Fix crash if processing a link closes the document
BUGS: 400104
2018-10-21 22:25:47 +02:00
Yuri Chornoivan 69c7b834d1 Fix minor API docs EBN issues 2018-10-19 09:00:06 +03:00