sw/source/core/edit/eddel.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit 0fb4adcff534e3841cf6df0e2363fb0797af7022 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue Sep 17 16:11:09 2013 +0200 fdo#37606 SwEditShell::DeleteSel(): handle document starting with a table If the whole document is selected and the document starts with a table, then we used to delete the contents of the document, except the starting table, which was just cleared. Change this and do what is expected: remove the table as well, so the document will have a single empty paragraph only. Change-Id: I47d3fab462e2a4149f6459d61e487fee8c5c30ed diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index 2d7adb6..8ea582c 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -35,6 +35,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo ) { + bool bSelectAll = StartsWithTable() && ExtendedSelectedAll(); // only for selections if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark()) return; @@ -42,10 +43,11 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo ) // Is the selection in a table? Then delete only the content of the selected boxes. // Here, there are two cases: // 1. Point and Mark are in one box, delete selection as usual - // 2. Point and Mare are in different boxes, search all selected boxes and delete content + // 2. Point and Mark are in different boxes, search all selected boxes and delete content + // 3. Point and Mark are at the document start and end, Point is in a table: delete selection as usual if( rPam.GetNode()->FindTableNode() && rPam.GetNode()->StartOfSectionNode() != - rPam.GetNode(sal_False)->StartOfSectionNode() ) + rPam.GetNode(sal_False)->StartOfSectionNode() && !bSelectAll ) { // group the Undo in the table if( pUndo && !*pUndo ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits