sc/source/ui/drawfunc/futext3.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit d001492faddb0b95356c7744aa4d193aacb38d7d
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon Jul 22 13:58:57 2019 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Jul 22 19:43:06 2019 +0200

    tdf#106000 sc ui: fix missing invalidation when cancelling note creation
    
    Regression from commit dca01def7885ad69cf66edd75cf8207a5adb64f9
    (refactor ListBox/ComboBox to use RenderContext, 2015-05-07),
    invalidating the area of note anchors worked like this in the past:
    
    - user ended text edit of a new, empty comment
    - the Calc shell was updated from shape text edit to the tab view, which
      called ImplListBoxWindow::SelectEntry()
    - this called ImplPaint(), which invoked maUserDrawHdl (if it was set)
    - and at the end this invoked ScViewFunc::UpdateSelectionArea(), all
      triggered by the font name and font size listboxes
    
    So the update of the cell of the former note depended on the presence of
    font name/size listboxes, by accident.
    
    This broke, because ImplListBoxWindow::SelectEntry() now calls
    Invalidate(), and Paint() calls ImplDoPaint(), which doesn't invoke
    maUserDrawHdl anymore. Fix the problem by invalidating the cell
    explicitly, so in case the user customizes the toolbar to not have these
    listboxes, the behavior is still correct.
    
    Do this in FuText::StopEditMode(), because there we know the position of
    the deleted note and that's where we delete the matching SdrCaptionObj
    (via the RemoveLastUndoAction()).
    
    Change-Id: Iaa4b609477ac6c7f23efc575fddac6e39aa6a7b5
    Reviewed-on: https://gerrit.libreoffice.org/76120
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sc/source/ui/drawfunc/futext3.cxx 
b/sc/source/ui/drawfunc/futext3.cxx
index 5c1d3a6ed00b..cbdcefb7d893 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -157,6 +157,11 @@ void FuText::StopEditMode()
             if( bNewNote && bDeleteNote )
             {
                 pUndoMgr->RemoveLastUndoAction();
+
+                // Make sure the former area of the note anchor is invalidated.
+                ScRangeList aRangeList(aNotePos);
+                ScMarkData aMarkData(aRangeList);
+                rViewShell.UpdateSelectionArea(aMarkData);
             }
             else if( bNewNote || bDeleteNote )
             {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to