Commit graph

231 commits

Author SHA1 Message Date
Albert Astals Cid d0beae60a9 Make signunsignedfieldtest pass again
the fake cert had expired ^_^
2022-11-20 01:25:46 +01:00
Albert Astals Cid b935e24876 Make the CloseDialogHelper work better on my setup 2022-11-19 20:39:55 +01:00
Albert Astals Cid 366464c012 parttext: Don't require pdflatex to run test
We can just run commit the files needed for it, makes life a bit easier
2022-11-19 20:39:51 +01:00
Albert Astals Cid 91afa74342 Set minimum requirement to Ubuntu 22.04 2022-11-19 09:48:15 +00:00
Nicolas Fella 80afe26873 Implement event.change
This represents the newly entered data for each keystroke. This is often a single added character, but for cases like pasting text it can be more complex.

The PDF API reference doesn't specify any algorithm to use.

The algorithm used here works by iterating through both strings from the start until the first different character is encountered. Then the rest of the new text is considered the difference.

This doesn't produce the theoretically optimal/minimal diff, but seems to work well enough for practical application.

When text is removed the diff is empty
2022-09-13 21:51:15 +00:00
Albert Astals Cid 44304b32a5 Use the poppler version includes instead of check_cxx_source_compiles 2022-05-04 01:16:35 +02:00
Albert Astals Cid d3dc35e159 Try to fix randomly failing jenkins 2022-04-08 10:46:46 +02:00
Albert Astals Cid 0d40301d50 Add a few definitions that will come with ECM 5.85
Better enforce them now, so that the work to port doesn't increase over
time

Not a super fan of this for regular applications, but oh well the ship
has sailed
2022-04-07 23:02:12 +00:00
M  B  8aa96484da Markdown: Fix images with special chars in URLs not loaded
If an image URL contains a non-ASCII character (e.g. `kartöffelchen.jpg`), the html returned by the markdown parser contains the encoded path `kart%C3%B6ffelchen.jpg`. We must decode the path before checking if the image file exists.
2022-04-03 16:02:44 +00:00
Albert Astals Cid 252236d413 Port a few more QLinkedList to QList
We don't need the special properties of QLinkedList in any of those and
QLinkedList is deprecated, so move away from it
2022-03-31 17:08:01 +02:00
Albert Astals Cid 0741ef1838 Port away from more QLinkedLists
QLinkedList is gone from Qt6

The almost 1:1 port is std::list but we don't need iterator stability on
removal/insertion so just port to QList
2022-03-22 12:58:59 +01:00
Albert Astals Cid 04c21b9c70 Fix cmake warning 2022-03-19 18:44:26 +01:00
Albert Astals Cid 6767b8739e Port a few QLinkedList to QList
QLinkedList is deprecated in later Qt5 and gone in Qt6

The 1:1 port is std::list but in this cases all we ever do
is create the lists, push back to them, and pass then around
to be read, for that a QList is more than enough
2022-03-19 11:22:55 +00:00
Albert Astals Cid 2d007f27d3 foreach -> for
A future ECM update is going to force that on us, so do it now anyway
2022-03-19 10:58:47 +00:00
Albert Astals Cid 6747e7fe8b signals-> Q_SIGNALS
A future ECM update is going to force that on us, so do it now anyway
2022-03-19 10:58:47 +00:00
Albert Astals Cid a2e1043149 slots -> Q_SLOTS
A future ECM update is going to force that on us, so do it now anyway
2022-03-19 10:58:47 +00:00
Volker Krause 50d0703ae0 Enable readability-braces-around-statements 2022-03-09 23:29:56 +01:00
Jiří Wolker f24aa63a97 Create welcome screen
This screen is similar to the one in Ark, but also shows you a list of
recently-opened documents.
2022-03-08 04:24:45 +00:00
Nicolas Fella d1ecad897c Implement keystroke commit events
When a form field loses focus a special keystroke event with
willCommit=true is sent.

This is based on work by Joao Netto <joaonetto901@gmail.com>
2022-03-07 22:14:26 +00:00
Nicolas Fella 6c8cafbb1c Simplify keystroke event handling
Make it more similar to how we handle the format event.

We pass the new value to processKeystrokeAction, that calls the script
and sets the new value for the form object according to the result. If
needed the widget is refreshed to reflect the new text
2022-02-24 16:10:22 +01:00
Andreas Naumann 147a638619 Adds option editor-cmd to the commandline
Adds the option "editor-cmd" for the [feature request](https://bugs.kde.org/show_bug.cgi?id=263732) .

BUG: 263732
2022-02-18 13:33:28 +00:00
Albert Astals Cid a8e5f6e9f7 PDF: Allow signing unsigned signature fields 2022-01-24 13:18:36 +01:00
Albert Astals Cid d11a7d42cb Merge remote-tracking branch 'origin/release/21.08' 2021-09-18 00:08:46 +02:00
Albert Astals Cid 6b978a554c annotationtoolbartest: Remove unneded cast
Also allows us not to compile a ./part/toggleactionmenu.cpp in the test, which seems to fix
the crashes in freebsd, makes some sense since we end up with two
ToggleActionMenu in the test, the one provided by the okularpart
library and the other compiled in
2021-09-17 15:46:18 +00:00
Albert Astals Cid c8a439132d Merge remote-tracking branch 'origin/release/21.08' 2021-09-09 21:28:12 +02:00
Albert Astals Cid 376925a10d Remove \n if it's the last char of the selected text
BUGS: 342874
2021-09-09 17:33:28 +00:00
Albert Astals Cid 0c659a5466 clang-tidy: Enable google-explicit-constructor 2021-08-29 08:52:35 +00:00
Simone Gaiarin 230a68d537 Uncheck mouse mode action when annotation tool selected
When the annotation is unchecked the previous mouse mode is restored.

The slot slotMouseNormalToggled is changed back to its original version
of slotSetMouseNormal given that we needed to pass the checked state
only to detach the annotations, and we do it in the lambda now.

BUG: 398108

BUG: 437377

FIXED-IN: 21.08
2021-06-19 14:12:19 +00:00
Alexander Lohnau ac083e44e3 Make meaning of sponsoring note more clear 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 2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +00:00
Simone Gaiarin 87fa366c4a Adapt annotation toolbar tests to new toggleable quick annotation 2021-05-10 05:36:29 +00:00
Albert Astals Cid 34b8c1e72e Merge remote-tracking branch 'origin/release/21.04' 2021-05-07 23:40:46 +02:00
Albert Astals Cid be1f0de196 try to stabilize test 2021-05-07 18:24:02 +00:00
Gerd Wachsmuth 6a6b6ca345 Fix bug: select browse tool after trim select 2021-04-25 13:43:18 -06:00
shenleban tongying 1855f9e4b1 Patch: Let form and sign interface to respect the OSD setting 2021-04-23 03:44:44 +00:00
David Hurka 5a58d3bb8e Simplify ToggleActionMenu
* Remove the ImplicitDefaultAction intelligence, so ToggleActionMenu is
  not more than a KActionMenu with setDefaultAction().
* Instead, reset the default action when it gets removed from the menu().
  This is done by filtering QActionEvent from menu().
* Add an autotest for ToggleActionMenu.

This replaces prior efforts to fix problems in ToggleActionMenu
in !245 and !254, following the discussion on the virtual meeting
at 2021-02-26.

6b26a2b4b and 1786e6c99 have already ported PageView and
AnnotationActionHandler to the simplified interface.
2021-04-23 01:54:42 +00:00
Gerd Wachsmuth f6b58ed804 Fix bug: select browse tool after trim select 2021-04-21 08:01:10 +02:00
Gerd Wachsmuth 61551d2356 Fix: Viewport coords normalized w.r.t. full page
The coordinates in Viewport.rePos are normalized on the full page. In
two functions within pageview.cpp, these were treated as coordinates on
the cropped page.

CCBUG: 198427

This partially fixes the bug 198427 in the case that the cropping of the
target pages (and the pages around the target) is known at the time the
link is clicked. That is, it works if

- One uses 'Trim To Selection'
- One uses 'Trim To Margin' and has already viewed at the target
page(s).

In the case that the cropping of the page at the target is unknown, we
still end up at the wrong position.
2021-04-20 07:48:51 +02:00
Albert Astals Cid 0584660125 partest: Fix one test interfering with the next
Cleanup settings and docdata in between tests
2021-04-10 08:48:15 +00:00
Gerd Wachsmuth 0a23d4a001 Fix a bug with zoom levels on cropped pages
BUG: 342003

Uses ideas of https://bugs.kde.org/show_bug.cgi?id=342003#c5
2021-04-08 22:27:20 +02:00
Nate Graham 157377b007 Fix multi-document open test failure
Fixes the test failure introduced with
d0b9b138cc.
2021-03-17 16:28:50 -06: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 084631d11e Use more standard cmake functionality to search for discount
Instead of rolling our own, that's harder to understand and buggy anyway

BUGS: 431311
2021-01-24 11:16:49 +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 35590a273d Fix CI
Laurent please use MR like everyone else does, otherwise you break the
build for the rest of us.

CCMAIL: montel@kde.org
2020-12-13 21:59:08 +01:00
Laurent Montel dd1938755e Don't include QtTest as it includes all QtCore includes 2020-12-13 17:51:28 +01:00
Albert Astals Cid 239827baad Rework how we open urls that have a #
Previously if it was a remote url that had # and a . after the # we
assumed the url had no fragment and everything was filename.

We don't do that anymore, what we do now is try to open the url as
parsed, i.e. before the # is the filename after is the fragment, and if
that fails we try to open everything as filename and nothing as
fragment.

Unfortunately given how kpart internals handle opening local vs remote
urls we need to do this in two places.

Also we have to remove the test that checked that the url was mangled at
the shell level because we don't do that anymore. Unfortunately can't
add a test for the new codepage since it would involve starting an http
server ^_^

Filenames:
  source2e.pdf
  foo#bar.pdf

What works:
 * okular http://localhost/source2e.pdf#subsection.68.3
 * okular file:///srv/http/source2e.pdf#subsection.68.3
 * okular source2e.pdf#subsection.68.3 (in the /srv/http folder)
 * okular source2e.pdf#2
 * okular http://localhost/foo#bar.pdf
 * okular file:///srv/http/foo#bar.pdf
 * okular foo#bar.pdf (in the /srv/http folder)

What doesn't work:
 * okular http://localhost/foo#bar.pdf#2

I think it's a fair limitation that if you want to open a file that contains # in the name and also use a # page marker you need to use the encoded url like okular http://localhost/foo%23bar.pdf#2
after all things like firefox will totally fail opening http://localhost/foo#bar.pdf and will just work if you give the encoded url

BUGS: 426976
2020-11-26 10:07:58 +00:00
David Hurka 19d5dd8ec7 New part/ directory for okularpart sources from /, ui/, conf/
Source files are no longer separated by UI and non-UI and similar,
but only by their build target.

* ui/ -> part/
* Move all source files from conf/ to part/
* Keep config skeleton definitions in conf/, needed for the mobile target too
* Move editdrawingtooldialogtest.h from conf/autotests/ to autotests/
* ui/data/icons/ -> icons/
* Move /part.cpp, /part.rc and similar files to part/
* Adapt include paths in source files
* Adapt CMakeLists.txt files (in / and in subdirectories)
* Adapt /Messages.sh
2020-11-18 19:32:56 +00:00