Commit graph

1998 commits

Author SHA1 Message Date
Pratham Gandhi a9efa78941 implemented AFMergeChange 2024-06-17 14:54:08 +05:30
Pratham Gandhi 2fe492891f Fixed cursor position and undo/redo merges
Fixes two things:

1. Cursor positions are being incorrectly calculated in scenarios where keystroke actions reject some input text.
2. Undo/redo operations were buggy and the commands would not merge often leading to single character undo/redo most of the times.
2024-06-15 18:26:51 +00:00
Joe Dight 2a78dba3ca BookmarkManager: name new bookmarks by page labels if available 2024-06-11 22:50:11 +00:00
Joe Dight 5b90fcb34d remove BookmarkManager::setPageBookmark
It is only used by addBookmark(int page), which can be implemented in terms of addBookmark(DocumentViewport)
2024-06-11 22:50:11 +00:00
Pratham Gandhi 1b78471a41 Made event.change evaluate to whole incoming text.
Currently event.change evaluates from first point of difference to end of the string. This MR modifies it to evaluate to whole incoming text. Now we evaluate whatever change is coming in, even if that change contains some common substring with original string (not considering only from the first point of difference).

The current definition makes it difficult to evaluate the final value from event.value and event.change within Javascript. This change is also better from compatibility POV as other readers such as Adobe and PDF.js make similar calculations.
2024-06-11 22:41:59 +00:00
Pratham Gandhi 51980dd07e Implemented DocOpen event and fixed doc() function of JSField 2024-06-11 08:52:35 +00:00
Pratham Gandhi 667d615582 Added selStart and selEnd properties to event object 2024-05-31 19:43:12 +00:00
Pratham Gandhi a86fd58690 Implemented AFPercent_Format 2024-05-28 23:25:50 +00:00
Wendi Gan 322fd2d54e fix Unicode Normalization: replace NFKC to NFC
Use NFC in copy, makeWord, and export functions, and NFKC for search operations.
NFKC may alter characters when copied or exported. For example ⑥ in pdf will be pasted as 6. So most instances are replaced with NFC.
To simplify matching during search operation, NFKC is used.

BUG: 466521
CCBUG: 473495
2024-05-24 10:02:50 +00:00
Pratham Gandhi a475974024 Typo fix for correct doc rendering in form.h 2024-05-13 10:45:23 +00:00
Sune Vuorela 4509b7bc42 Various minor fixes
Mostly derived from cppcheck runs
2024-04-16 15:44:19 +02:00
Sune Vuorela 56a2a8d3bd cleanups: Sprinkle in a bit unique_ptr
Document memory ownership with unique_ptr's and do a bit of code
cleanups.
2024-03-06 21:57:08 +00:00
Sune Vuorela 8bcafd80bb Clean up TextSelection and remove unused parts 2024-03-05 00:11:27 +00:00
Sune Vuorela 6cc2a08d6b Use std::swap 2024-03-04 23:56:46 +00:00
Sune Vuorela 1d93a42263 Newer clazy: More potential detaching temporary 2024-03-04 16:49:25 +01:00
l10n daemon script df3bfa005d 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"
2024-02-18 01:13:47 +00:00
Sune Vuorela 2e008d437c Simplify textentity memory management
After trying to measure the effect of switching TinyTextEntity from a
custom SBO string type to just QString and getting a barely measurable
gain, TinyTextEntity kind of looked like TextEntity, so merge those two.

Also reduce the amount of new/deletes around TextEntities

Implement a string pool for some tiny strings, and various memory optimizations
2024-02-07 14:07:08 +00:00
Sune Vuorela 12e40e0d36 Button groups can span multiple pages
The code needs to be aware of that.

BUG: 479942
2024-01-25 22:14:54 +00:00
Alexis Murzeau 2609f4001a Add support for app.popUpMenu and submenus in popUpMenuEx
These functions from `app` are JS functions that can be used by PDF
files.

Based on popUpMenuEx, the implementation of popUpMenu converts arguments
to app.popUpMenuEx format and then call it.

The popMenuEx function is improved to handle submenus as well using
`oSubMenu`.

app.popUpMenu is used in Altium Designer and EasyEDA exported PDFs.
See an example here:
https://www.st.com/en/evaluation-tools/32f723ediscovery.html#cad-resources
https://www.st.com/resource/en/schematic_pack/mb1260-f723e-d03_schematic.pdf

BUGS: 479777
2024-01-17 19:01:08 +00:00
Sune Vuorela dc88b5873a Don't put slashes in plugin prefix
It complicates stuff further down the line and we don't gain much for
it, so work with the rest of the stack rather than work around it.

One of the complications is that if bindir contains both plugins and executable, we will have okular and okular/ in the same folder and that doesn't really work.
2024-01-09 14:12:45 +00:00
l10n daemon script 651098cf5a 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"
2024-01-08 02:08:32 +00:00
Nicolas Fella f7b1b3b032 Remove unused caller arg from KBookmarkManager::changed 2024-01-03 21:02:38 +01:00
Sune Vuorela 2fad5243ab Remove setUpdate call; it doesn't do anything
And it defaults to true
2024-01-03 19:49:53 +00:00
Sune Vuorela 611dea4c0d Remove deprecated functions. Porting is needed anyways 2023-12-22 23:25:44 +00:00
Sune Vuorela 0cb6dace0c Fix qHash(NormalizedRect) 2023-12-21 23:24:58 +00:00
Sune Vuorela 7e07b41e06 document diff; port from deprecated
Use std::u32string for ucs4 representation. That can non-deprecated be
fed back into QString. Unfortunately the data from toUcs4 can't.
2023-12-21 13:38:58 +00:00
Sune Vuorela db728684e1 Port deprecated QLocale country 2023-12-19 12:18:28 +00:00
Sune Vuorela 792425fc77 s/qAsConst/std::as_const/
We now definitely has std::as_const available and Qt has started nagging
about converting to std::as_const.

Implementation is the same for both functions, and qAsConst was a
stop-gap measure until std::as_const was sufficiently available.
2023-12-19 11:46:24 +00:00
Sune Vuorela a72ad046f7 Remove ifdef'ed out code 2023-12-18 22:56:22 +00:00
Sune Vuorela 18200c87f7 Clazy: small and trivial things should be taken by copy 2023-12-18 22:56:22 +00:00
Sune Vuorela be29ae5eec Make some RegularExpressions static 2023-12-18 22:56:22 +00:00
Carl Schwan 946a8aa386 Port away from QTextStream::setCodec 2023-12-18 22:56:22 +00:00
Carl Schwan 514640923b Port to newer KBookmark API 2023-12-18 22:56:22 +00:00
Carl Schwan c02926d213 Port away from KRun::isExcecutableFile
This method moved to KIO::OpenUrlJob
2023-12-18 22:56:22 +00:00
Sune Vuorela a9717a8e5f Use CI environment for clang/clazy
In order to be able to also do this with Qt6 we can't currently rely on
'random distro' to be able to give us an environment sufficient for
running clang and clazy, so use the CI system setup instead

A side effect is that we get a newer clazy and clang-tidy and thus is a
few more issues to either ignore or fix.

Also, ask ninja to continue as long as possible rather than stop at
first error to be able to get succes in as few runs as possible
2023-12-15 09:39:03 +00:00
l10n daemon script 20a5bb2b5c 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"
2023-12-14 01:15:39 +00:00
Sune Vuorela b4a95259e2 Remove some unused parts of FilePrinter 2023-12-13 10:27:13 +00:00
Sune Vuorela ffe522af8c Include QFlags in global.h. It references the macros from there 2023-12-13 10:03:51 +00:00
Sune Vuorela ddbbe12c84 Fix since notation in signatureutils keylocation 2023-12-07 15:01:57 +00:00
Sune Vuorela 3e1842a923 Show an icon depending on the storage location of the signature 2023-12-07 12:15:03 +00:00
Sune Vuorela c94d47b07f Fix a qprinter deprecation warning
Co-Authored-By: Carl Schwan <carl@carlschwan.eu>
2023-12-07 11:46:59 +00:00
Sune Vuorela 32c804296a Get rid of QStringRef 2023-12-06 19:12:43 +00:00
Sune Vuorela 69943b5819 Fix deprecated warning QMap::unite
It looks like we mostly come with new values, and if we actually end up
with duplication we want the newest found and not do multi inserts.
2023-12-06 17:28:23 +00:00
Nicolas Fella 1b479dfb7b Port away from deprecated KRun 2023-12-06 09:22:16 +00:00
l10n daemon script 1641c47234 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"
2023-11-07 02:06:23 +00:00
l10n daemon script c16357bebf 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"
2023-11-04 11:46:37 +00:00
l10n daemon script e11183bfb9 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"
2023-10-20 01:19:41 +00:00
Nicolas Fella d4a344a189 Port away from deprecated KPluginLoader 2023-09-11 19:29:44 +00:00
Nicolas Fella 4addfcc4ec Remove kdelibs4 migration code when using Qt6
Upgrading 4->6 is not supported by KF6
2023-09-11 17:46:07 +00:00
Volker Krause e41f682b3d Fix creation of new JS objects
A default constructed QJSValue is undefined, not an object.

BUG: 474256
FIXED-IN: 23.08.1
2023-09-11 17:36:01 +00:00