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
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
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
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
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
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
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
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
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
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
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