summaryrefslogtreecommitdiff
path: root/sw/source/uibase/wrtsh/select.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 10:41:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 12:18:29 +0200
commit6af041b8160a7193ed24df9a1adc117dda61cd65 (patch)
treed20461bf221a60e36af256617a545fcfe5caa1e7 /sw/source/uibase/wrtsh/select.cxx
parentfd80650672d5d3a0b585d6d46a1b1b0cd4012faf (diff)
loplugin:flatten in sw/uibase/utl..sw/uibase/wrtsh
Change-Id: I9010524952ce3b99a62e53dbf715a72c86a89b01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/wrtsh/select.cxx')
-rw-r--r--sw/source/uibase/wrtsh/select.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index a5c1ecbb7299..dc47cb73acdb 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -478,26 +478,26 @@ void SwWrtShell::ExtSelWrd(const Point *pPt, bool )
SwCursorShell::Pop(SwCursorShell::PopMode::DeleteCurrent); // restore the saved cursor
- if( bMoveCursor )
+ if( !bMoveCursor )
+ return;
+
+ // select to Top but cursor select to Bottom? or
+ // select to Bottom but cursor select to Top? --> swap the cursor
+ if( bToTop )
+ SwapPam();
+
+ SwCursorShell::Push(); // save cur cursor
+ if( SwCursorShell::SelectWord( pPt )) // select the current word
{
- // select to Top but cursor select to Bottom? or
- // select to Bottom but cursor select to Top? --> swap the cursor
if( bToTop )
SwapPam();
-
- SwCursorShell::Push(); // save cur cursor
- if( SwCursorShell::SelectWord( pPt )) // select the current word
- {
- if( bToTop )
- SwapPam();
- Combine();
- }
- else
- {
- SwCursorShell::Pop(SwCursorShell::PopMode::DeleteCurrent);
- if( bToTop )
- SwapPam();
- }
+ Combine();
+ }
+ else
+ {
+ SwCursorShell::Pop(SwCursorShell::PopMode::DeleteCurrent);
+ if( bToTop )
+ SwapPam();
}
}