diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2020-03-01 14:08:20 -0500 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2020-03-15 18:50:08 +0100 |
commit | 8c3af6240d5765fb8954025226477670e1d2a7c7 (patch) | |
tree | 6e4bf6b99b90291bdce8b2f4147b44f6f7cdc484 /include | |
parent | 998c0845e6a4fdcfdfee59af59dd997fc99a23f0 (diff) |
editeng: lok: send cursor visibility event when restoring update mode
When the default text is removed from a TextBox within a slide,
the cursor visibility is inadvertendly set to false and never
restored (because the LOK notification is disabled due to treating
the ShowCursor during SetUpdateMode as an activation of the TextBox,
and that is supressed to avoid messing up the cursor when creating
a new view).
We add a new flag to SetUpdateMode to flag whether this is an
activation or we are restoring a previously active window (TextBox)
due to a temporary disabling (to clear the default text).
Four unit-tests added not just to check and validate the fix,
but to also simulate two different ways of entering edit mode,
first by single-clicking on the text and then double-clicking
outside the text, but within the TextBox.
Change-Id: Icaaabc2a897f614f5ce162b71fadccff22ecda02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90301
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 6b84dfabbb5f6930f9ac582f8c1dd9f467fd068c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90298
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/editeng.hxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 5f45dd1fbf29..20c15e6539e1 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -209,7 +209,11 @@ public: void SetRefMapMode( const MapMode& rMapMode ); MapMode const & GetRefMapMode() const; - void SetUpdateMode( bool bUpdate ); + /// Change the update mode per bUpdate and potentially trigger FormatAndUpdate. + /// bRestoring is used for LOK to update cursor visibility, specifically, + /// when true, it means we are restoring the update mode after internally + /// disabling it (f.e. during SetText to set/delete default text in Impress). + void SetUpdateMode(bool bUpdate, bool bRestoring = false); bool GetUpdateMode() const; void SetBackgroundColor( const Color& rColor ); |