diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-06-15 13:11:29 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-06-15 15:58:59 +0200 |
commit | 2d89b9929e85bede4c72684a12e7508751875f0e (patch) | |
tree | fcfa0397afabff393ed3c4c09fd4c5119c289cbe /sw/source/core/edit | |
parent | 786d0b9abf76b2f84d333e18c902a374ab3b3090 (diff) |
tdf#133957 sw: SelectAll should select fly in empty section
Ctrl+A should select everything in the section; if the section is empty,
there's no text to select, and then the shell will cancel the selection
because SwCursorShell::HasSelection() returns false - so check if
there are flys anchored there, which fixes the Copy.
To fix Delete, a few more checks for empty selection need to be changed.
Change-Id: If54160bdca976ad5f153b89cf8492f4da1e774b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96324
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/source/core/edit')
-rw-r--r-- | sw/source/core/edit/eddel.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index af9a8e4d5674..b32f72c5fa6d 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -24,6 +24,7 @@ #include <editsh.hxx> #include <pam.hxx> #include <swundo.hxx> +#include <undobj.hxx> #include <SwRewriter.hxx> #include <osl/diagnose.h> @@ -34,8 +35,12 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo ) { bool bSelectAll = StartsWithTable() && ExtendedSelectedAll(); // only for selections - if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark()) + if (!rPam.HasMark() + || (*rPam.GetPoint() == *rPam.GetMark() + && !IsFlySelectedByCursor(*GetDoc(), *rPam.Start(), *rPam.End()))) + { return; + } // Is the selection in a table? Then delete only the content of the selected boxes. // Here, there are two cases: |