[okular] [Bug 388228] Okular crashes when annotating a piece of text

Albert Astals Cid bugzilla_noreply at kde.org
Sun Feb 25 18:09:32 UTC 2018


https://bugs.kde.org/show_bug.cgi?id=388228

Albert Astals Cid <aacid at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://commits.kde.org/oku
                   |                            |lar/3c4f16ea4b7e57b57e34830
                   |                            |cd4ecf3f0ff80b399
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED

--- Comment #12 from Albert Astals Cid <aacid at kde.org> ---
Git commit 3c4f16ea4b7e57b57e34830cd4ecf3f0ff80b399 by Albert Astals Cid, on
behalf of Tobias Deiminger.
Committed on 25/02/2018 at 18:11.
Pushed by aacid into branch 'Applications/17.12'.

Fix crash due to dangling pointer in MouseAnnotation

Summary:

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

M  +1    -5    ui/pageview.cpp
M  +41   -3    ui/pageviewmouseannotation.cpp
M  +6    -2    ui/pageviewmouseannotation.h

https://commits.kde.org/okular/3c4f16ea4b7e57b57e34830cd4ecf3f0ff80b399

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list