From fb62052d5ac069d700a5410db35d6949a4c4008b Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 3 Oct 2015 09:35:26 +0300 Subject: tdf#94679 Writer: fix lost selection with Shift-PageDown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Push/Pop-ing the cursor led to selection loss. SelectHiddenRange() immediately returns false if the current cursor hasMark(), so avoid all of the bugs and expensive push/pop routines when there is a mark already. Change-Id: I4624a3e0b2267942812d0429d527ad97962ec7fc Reviewed-on: https://gerrit.libreoffice.org/19108 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/uibase/shells/textsh.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index c9b9aadb5b20..d8adc8d98ca0 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -660,9 +660,13 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) SfxObjectCreateMode eCreateMode = GetView().GetDocShell()->GetCreateMode(); - rSh.Push(); - const bool bCrsrInHidden = rSh.SelectHiddenRange(); - rSh.Pop(); + bool bCrsrInHidden = false; + if( !rSh.HasMark() ) + { + rSh.Push(); + bCrsrInHidden = rSh.SelectHiddenRange(); + rSh.Pop(); + } while ( nWhich ) { -- cgit v1.2.3