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
First issue:
- The "document is totally signed" was based on the last signature of
the last page (that had signatures) that is not correct and needs to
be based in the last signature by date
- The "Rev #" number was based on the signature on the page, so if we
had two pages with one signature each the model showed "Rev 1" for
both
It adds new API which is not awesome in a stable branch, but the first
issue is important enough that warrants this to go to the stable branch
I'm going to need to break binary compatibility to add a new feature
so may as well cleanup all the TODOs regarding that
Changes:
* Moving a few destructors to the header
* Removing a few unnecessary & in params
* Adding a few necessary & in params
* Making print return an enum instead of a bool and then having another
function that returns the enum
* Make Generator::requestFontData be a virtual
* Remove unused enum
* Remove a few filePrinter unneeded functions
* Remove unused TextDocumentGenerator::addMetaData signal
We did not take sepStyle 3 into account.
Also sepStyle 1 and 0 where mixed up and it didn't work either because
replace() needs to be assigned back to the string
BUGS: 445868
By using Poppler 20.10 new custom image stamps APIs
Instead of the incompatible hack we used before that only worked for Okular.
This is done by modifying the update function used by PopplerAnnotationProxy in order to load the image in
the correct dimensions and send it to the poppler-Qt5 frontend.
We temporarily store the stamp annotation appearance when deleting it so that we can set it again when doing an undo undo.
The bounding rect is *visual* and it can happen that we have
invisible text and thus the algorithm will get super confused
because there will be text items that are outside the text area
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.
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
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.
...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
* 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)
Now poppler offers signing via PDFConverter class. Add some error
handling, and store signature in temp file. Document gets reloaded
after replacing original file.
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.
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
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.
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
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 :)
`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
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
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)
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
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.
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.
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
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
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.
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
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.
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
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
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
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).
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.
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
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
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