Commit graph

2014 commits

Author SHA1 Message Date
Pratham Gandhi bdb048666e Implemented numItems property for combobox and listbox 2024-07-21 23:39:44 +00:00
Pratham Gandhi 21a8cc7dbb Implemented getItemAt method for comboboxes and listboxes 2024-07-21 23:39:44 +00:00
Pratham Gandhi 43199de411 Fixed implementation of value for combo box and list box 2024-07-21 23:39:44 +00:00
Pratham Gandhi 43b536bdf9 Implement DocClose, DocWillPrint, DocDidPrint, DocWillSave and
DocDidSave methods.
2024-07-21 23:33:41 +00:00
Pratham Gandhi e6d9ead5b5 Implement AFDate_KeystrokeEx and AFDate_FormatEx methods. 2024-07-09 23:14:34 +00:00
Sune Vuorela 40433777fa Move textdocumentsettings to the right place
For some reason, it has been placed in part, but is used by things in
core.

Given it generates a header-only thing, it still works but is weird.
2024-07-09 22:57:36 +00:00
Pratham Gandhi 0520b64fed Fix numerical interpretation in form fields
With the previous implementations of AFNumber_Keystroke [MR 988](https://invent.kde.org/graphics/okular/-/merge_requests/988), we ensure that during a keystroke event, a user does not enter thousands separator. With this in mind, numerical fields can always be first converted to en_US format and then used for calculations. This ensures that all numbers are correctly interpreted.

BUG: 474661
2024-07-09 22:57:16 +00:00
Pratham Gandhi c4c98e9958 Added option to save committed values and restore them if not accepted.
Also did some refactoring on the keystroke, format, validate methods.
Created new methods that can accept any generalized form field to allow
for the operations on FormFieldChoice as well.
2024-07-08 21:32:08 +00:00
Sune Vuorela 3610aad389 cppcheck: simplify suppressions
the d_func hierarchy is quite common and should just be generalized.
That way, the suppressions might be able to be moved centrally

Also function argument pointers constness is something one should really
consider if it is worth fixing (it often isn't) due to issues with
binary compatibility or if the base or interface class might define it
without const pointers.
2024-07-03 17:36:01 +00:00
Sune Vuorela d211a6a9e9 More cppcheck fixes 2024-06-26 12:48:44 +00:00
Sune Vuorela 0bd2c9cfa0 Use async signature validation
Also, show information about the validity of the certificate used for
the signature

BUG: 446298
2024-06-26 14:02:04 +02:00
Pratham Gandhi e5900f9a4f created global qobject 2024-06-24 10:39:38 +05:30
Pratham Gandhi 160be52119 Implemented AFNumber_Keystroke and AFPercent_Keystroke 2024-06-19 21:55:38 +00:00
Sune Vuorela 71957e02f6 Fix crash on certain pdf actions
The Qt6 port left sometimes a deleted pointer behind to be dereferenced
later.

Fix this by leveraging smartpointers.

Also clean up the related code to be a bit more specific about data
deletion
2024-06-19 18:05:21 +00:00
Pratham Gandhi a0babd7fa4 Implemented AFSpecial_Keystroke 2024-06-19 17:28:06 +00:00
Pratham Gandhi 68cb2edb8a Implemented AFTime_Keystroke 2024-06-17 14:54:13 +05:30
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