Commit graph

12 commits

Author SHA1 Message Date
Laurent Montel 6cbbc7f7a9 Fix mem leak found by asan
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f4fa41e3900 in operator new(unsigned long)
(/usr/lib64/libasan.so.5+0xed900)
    #1 0x7f4f96a455b2 in Okular::Annotation::Window::Window()
/compile/kde5/framework/kde/kdegraphics/okular/core/annotations.cpp:341
    #2 0x7f4f96a46207 in Okular::AnnotationPrivate::AnnotationPrivate()
/compile/kde5/framework/kde/kdegraphics/okular/core/annotations.cpp:493
    #3 0x7f4f96a7f605 in
Okular::TextAnnotationPrivate::TextAnnotationPrivate()
(libOkular5Core.so.9+0xb9605)
    #4 0x7f4f96a57ceb in Okular::TextAnnotation::TextAnnotation()
/compile/kde5/framework/kde/kdegraphics/okular/core/annotations.cpp:1042
    #5 0x7f4f96e3e04f in EditAnnotToolDialog::createStubAnnotation()
/compile/kde5/framework/kde/kdegraphics/okular/conf/editannottooldialog.cpp:300
    #6 0x7f4f96e2aa8b in
EditAnnotToolDialog::EditAnnotToolDialog(QWidget*, QDomElement const&)
/compile/kde5/framework/kde/kdegraphics/okular/conf/editannottooldialog.cpp:97
    #7 0x7f4f96e52bbb in WidgetAnnotTools::slotAdd()
/compile/kde5/framework/kde/kdegraphics/okular/conf/widgetannottools.cpp:151
    #8 0x7f4f96e5799c in
QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>,
void, void (WidgetConfigurationToolsBase::*)()>::call(void
(WidgetConfigurationToolsBase::*)(),
2018-11-21 13:25:59 +01:00
Dileep Sankhla e44ff38706 Support setting text color for typewriter annotations
Summary:
Changing typewriter text color can be done in the typewriter properties dialog, or programmatically via new okular API methods TextAnnotation::textColor and TextAnnotation::setTextColor.

poppler >= 0.69 is required to store text color natively inside PDF documents. For other document types, text color is stored as metadata inside the document archive.

This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.

Test Plan:
- properties dialog of typewriter annotation has "Font Color" picker
- saving to PDF results in <r> <g> <b> rg operation in /DA
- saving to archive results in fontColor="rrggbb" attribute in metadata.xml

Reviewers: sander

Reviewed By: sander

Subscribers: kde-doc-english, sander, okular-devel

Tags: #okular, #documentation

Differential Revision: https://phabricator.kde.org/D15205
2018-10-04 20:02:55 +02:00
Dileep Sankhla 6dd7cf662d Add typewriter annotation tool
Summary:
Typewriter is originally specified by the PDF reference as special FreeText annotation, where Intent=FreeTextTypewriter. It features opaque letters on transparent background, so that users can fill non interactive forms. Herewith typewriter is implemented natively for PDF, and there's also an Okular specific implementation for other document types. The added tool reuses the inline note UI.

This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.

FEATURE: 353401

Test Plan:
- okularpartrc is generated (if not yet existing) with typewriter as 10th tool
- typewriter tool is also available in Annotation Tools -> Add, Typ "Typewriter"
- selecting the tool and left click into document opens inline note input dialog
- finishing creates an annotation similar to inline note, but with transparent background
- saving into PDF results in /Subtype FreeText /IT /FreeTextTypeWriter
- saving typewriter into archive stores color with alpha channel = 0x00
- opening annotated archive works, if archive was created with old Okular, and opened in patched Okular
- opening annotated archive works, if archive was created with patched Okular, and opened in old Okular

Reviewers: sander

Reviewed By: sander

Subscribers: ngraham, sander, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D15204
2018-09-25 22:47:01 +02:00
Dileep Sankhla d61cef693d Store all annotation color attributes as ARGB string
Summary:
This is mainly preparation for D15204 (typewriter), where storing RGB won't be sufficient any longer.
Typewriter will need transparent background (alpha=0x00), which can only be expressed as ARGB string.

Current code handles name format identical for all annotations. It doesn't hurt to store all annotations in ARGB format, so instead of introducing special handling for typewriter, let's store all annotation color attributes as ARGB string.

Note: In case of previously existing okularpartrc, configuration will be reused without conversion. New color format will be written when new settings are saved. This has no bad effect.

Test Plan:
- when [Reviews] section in okularpartrc is initially generated, all annotation color attributes are in #AARRGGBB format
- saving into archive stores color with alpha channel (#AARRGGBB), for all kind of annotations

Reviewers: sander

Reviewed By: sander

Subscribers: dileepsankhla, sander, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D15279
2018-09-07 18:33:16 +02:00
Yuri Chornoivan 39b6e8147d Fix minor EBN issues 2018-09-01 11:25:57 +03:00
Yuri Chornoivan c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Yuri Chornoivan c7722c4078 Fix minor EBN issues 2018-08-17 21:05:01 +03:00
Kevin Funk a53a2402ca clang-tidy: modernize-use-nullptr run
Semi-ACK'd by Albert :)
2017-09-06 00:19:48 +02:00
Martin T. H. Sandsmark 67e7ada311 Fix build without implicit cast to/from ascii
See the previous commits for details. This is the last part.
2016-07-11 22:11:43 +02:00
Albert Vaca 67f69c8871 Merge branch 'master' into frameworks
# Conflicts:
#	CMakeLists.txt
#	active/app/package/metadata.desktop
#	conf/widgetannottools.cpp
#	core/version.h
#	generators/poppler/libokularGenerator_poppler.desktop
#	generators/txt/libokularGenerator_txt.desktop
#	generators/xps/libokularGenerator_xps.desktop
#	ui/annotationwidgets.cpp
#	ui/presentationwidget.cpp
2016-02-22 03:50:54 -08:00
Montel Laurent 466eb79615 Use QStringLiteral 2015-10-29 13:37:11 +01:00
Tobias Koenig 81f80ac3a4 Implement drawing quick selection tool for presentation mode
REVIEW: 124687
2015-08-22 22:17:40 +02:00