Summary:
in drawPixmap(source, sourceRect) the source rect is in native pixels.
In this code the size was scaled by the DPR, but the location was not.
blendRect is the contents of a selection rectangle, offset from the
bounding darker blue rectangle. Hence we haven't really noticed.
This completely fixes the rectangle when the scale == 2.0/3.0
Some smaller artifacts remain on fractional scale factors, which is a
separate code bug with the same symptoms.
CCBUG: 386111
Reviewers: aacid, rkflx
Reviewed By: rkflx
Subscribers: sander, rkflx, anthonyfieroni, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8980
Some more tweaks to path resolving.
Don't prepend a / in entryPath if path already starts with /
Fonts can also have relative paths, so use the absolutePath before
calling getFontByName
BUGS: 392826
Summary:
Seems like someone forgot to consistently apply a change. Maybe the path
construction should be factored into a reusable lambda?
Test Plan:
Open Okular, open settings > configure Okular. Without the patch, you'll get a
"QFSFileEngine::open: No file name specified" warning, with the patch it
disappears. Note that there is also an unrelated "Illegal icon group: 7"
warning from KIconThemes, but I'm 99% certain that this is on KIconThemes doing
a bogus check in KIconEffect::apply, not on Okular
Reviewers: #okular, hetzenecker, aacid
Reviewed By: #okular, aacid
Subscribers: aacid, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D12001
Summary:
Seems like someone forgot to consistently apply a change. Maybe the path
construction should be factored into a reusable lambda?
Test Plan:
Open Okular, open settings > configure Okular. Without the patch, you'll get a
"QFSFileEngine::open: No file name specified" warning, with the patch it
disappears. Note that there is also an unrelated "Illegal icon group: 7"
warning from KIconThemes, but I'm 99% certain that this is on KIconThemes doing
a bogus check in KIconEffect::apply, not on Okular
Reviewers: #okular, hetzenecker, aacid
Reviewed By: #okular, aacid
Subscribers: aacid, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D12001
There's no need to continue generating something that won't be useful.
Also fixes a crash if the request would report partial updates since at that stage it uses the observer and that is gone
This fix smells a lot like a workaround for a bug in Qt but i could not
write down a sufficiently small testcase for it to report it to Qt, and
this is not wrong anyway since we eventually add playerPage to a
layout for this. What I tracked down was that since playerPage had no
parent, at some point a nativeId for it was being created and that
broke sizing back to the default 100x30 used in Qt instead of the
size we had given it.
For some reason i needed a PDF file with more than one video to
reproduce this problem, the first video was correctly sized but the
second one was 100x30.
The crash would happen because we were setting partial updates to true on requests
that were synchronous, because that sync request was cancelling an async one (prerender)
so now we only set newRequest partial updates to true when cancellingm another one if it's asynchronous
And a sync but with partial updates request would make stuff crash because the request
would all be processed on the main thread but generator_pdf.cpp cakks signalPartialPixmapRequest
with a queued connection so we that function was called the request would have already gone
Summary:
It's a real world screnario to have checkboxes that toggle
the read only state for other fields.
The test is a parttest because we need to trigger activiation
action when changing the field, this is handled through the
formwidgetscontroller.
Reviewers: #okular
Tags: #okular
Maniphest Tasks: T8097
Differential Revision: https://phabricator.kde.org/D10869
Summary:
This implements setting / getting the value of buttons,
which is important for checkboxes in scripts. It also moves
the checkbox activate action after the value is set so that
the correct value is used when the activation script is
executed.
Reviewers: #okular
Tags: #okular
Maniphest Tasks: T8097
Differential Revision: https://phabricator.kde.org/D10868
Summary:
This makes it possible to set the read only state from
scripts. Requires Poppler master with the patch attached to the parent task.
Reviewers: #okular
Subscribers: aacid
Tags: #okular
Maniphest Tasks: T8097
Differential Revision: https://phabricator.kde.org/D10867
Summary:
The FormWidgetInterface now has a generic slotRefresh that
refreshes what all widgets have in common. This is the read-only state for now.
Reviewers: #okular
Tags: #okular
Maniphest Tasks: T8097
Differential Revision: https://phabricator.kde.org/D10866
Summary:
This is more of a cleanup patch that removes the obsolete m_canBeEnabled
member variable which was a leftover IMO from a time where readOnly fields were
shown as disabled. readOnly fields are invisible, not disabled, and the code no longer assumes that
readOnly does not change over time.
Test Plan: Tested manually and with a unittest which is part of the series.
Reviewers: #okular
Subscribers: aacid
Tags: #okular
Maniphest Tasks: T8097
Differential Revision: https://phabricator.kde.org/D10865
Summary:
When running okular with the parameter --print to directly open the print mode, it doesn't exit after acknowledging the print dialog. Hence adding --print_and_exit option exits Okular after acknowledging the print dialog and thus is useful for the command line batch processing or a Dolphin service as the issue suggests.
FEATURE: 318998
Test Plan:
1. open a file in Okular using the parameter --print. It will open Okular in print mode with the print dialog
2. Either print the file or cancel the print dialog
3. You will find that Okular stays open
4. Now using this patch, see for available options with the --help parameter. You will find --print_and_exit option
5. Now open a file in Okular using the parameter --print_and_exit. It will open Okular in print mode with the print dialog
6. Either print the file or cancel the print dialog
7. You will find that Okular closes after acknowledging the dialog
Reviewers: aacid, #okular, ngraham
Subscribers: ltoscano, ngraham, aacid, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D10249
Summary:
BUG: 388228
Diff applies to Applications/17.12, and should be easy to merge to master. It's kept quite minimal as suggested by Albert.
Albert also suggested to add a dedicated unit test and I'd agree, but am not yet sure how to do it. The original bug involves several classes, including UI: Document, Page, AddAnnotationCommand, PageView, PageViewAnnotator, MouseAnnotation - to name a few. So a test for the exact bug scenario would become a bigger integration test rather than an isolated unit test. The other approach would be to do a real unit test on MouseAnnotation. But again, MouseAnnotation has nasty dependencies (e.g., needs a parent PageView) which I'd have to mock. Any ideas? I'd be interested in a discussion on this topic.
Test Plan:
# Load a document (e.g. [[ http://www.philipebert.info/resources/WhatMathematicalKnowledgeCouldNotBe.pdf | linked PDF from bug report ]]) and enable highlight toolbar (F6).
# Create highlight annotation.
# Move the view port so that the annotation position is right beside the highlight tool icon.
# Move the mouse over the annotation, and then horizontally left until you reach the tool icon; it's important to stay over the highlight annotation as long as in viewport.
# Press ctrl-z for undo.
# Click on highlight tool, move right into the document, create new highlight annotation.
# Okular doesn't crash.
Reviewers: #okular
Subscribers: aacid, ngraham
Tags: #okular
Differential Revision: https://phabricator.kde.org/D9852
Applications using Okular as a KPart might set a file's mime type in the OpenUrlArguments.
Okular currently clears the arguments while opening a document. This revision fixes this, allowing
applications to actually pass a file's mime type to Okular.
BUG: 386600
Summary:
notifyFormChanged is called by documentcommands when
Form fields are changed. E.g. by Undo / Redo.
We need to recalculate after such changes.
Test Plan:
Tested with simple_calculate example.
Run the unit test with the added line commented out and it failed, with the added line it passes.
Reviewers: #okular
Subscribers: aacid, ltoscano
Tags: #okular
Maniphest Tasks: T7805
Differential Revision: https://phabricator.kde.org/D10547