diff options
author | Justin Luth <justin_luth@sil.org> | 2020-07-14 14:18:36 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-07-14 15:38:08 +0200 |
commit | cef5a2d780ad01105dae860f6293f6f137603027 (patch) | |
tree | 51dc64b562a9c4361810b7c2b049ad869c270c1f /sw | |
parent | 5b2dcb95710391c6e0d33e5ed4b743c01929d436 (diff) |
tdf#134654 sw: Alt-X - end keyboard selection too
The selection itself was cancelled, but not the fact that
a keyboard selection was "in progress".
EndSelect is slightly heavy, so wrap it in a
very lightweight if statement.
ClearMark also checks HasMark, so real purpose
in first checking it.
Change-Id: I969a694c46d92201f3c3f2121e3fa3a2af27253c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98719
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 6a5cd8b3f42a..228a8a4b9210 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -365,7 +365,11 @@ void SwTextShell::Execute(SfxRequest &rReq) aRewriter.AddRule( UndoArg3, sReplacement ); rWrtSh.StartUndo(SwUndoId::REPLACE, &aRewriter); rWrtSh.GetCursor()->Normalize(false); + rWrtSh.ClearMark(); + if( rWrtSh.IsInSelect() ) // cancel any in-progress keyboard selection as well + rWrtSh.EndSelect(); + for( sal_uInt32 i=aToggle.CharsToDelete(); i > 0; --i ) rWrtSh.DelLeft(); rWrtSh.Insert2( sReplacement ); |