summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-09-07 21:23:07 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-09-08 09:11:24 +0200
commitda4f9b77a6cd39b1ae5babdd476d1575c8b9371c (patch)
treef79896adf655b2ab5c0dc1d0b41ad44fa9b3599e /sw/source
parentce76618e83d895fcc57bf271e4684e7df77228d2 (diff)
tdf#135149 sw: fix deleting textbox of as-char shapes
Regression from 7596e26fd259ce5445212949403e7cd32303b2bd (Add SwTextBoxHelper::findShapes, 2014-06-24), the problem was that in case the shape is as-char anchored, then DeleteSelection() returns false, and so the textboxes of the deleted shapes are not deleted. There is no real reason why deletion should be conditional on the DeleteSelection() result, so just move it outside that block, so textboxes are always deleted. Change-Id: Ib3bd444e9e96f9de0f68a9162ab39255ec5a6807 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102198 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/draw/dview.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index f3f92be2b3f0..2dcda1dc1df3 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -972,15 +972,16 @@ void SwDrawView::DeleteMarked()
{
FmFormView::DeleteMarked();
::FrameNotify( Imp().GetShell(), FLY_DRAG_END );
+ }
- // Only delete these now: earlier deletion would clear the mark list as well.
- // Delete in reverse order, assuming that the container is sorted by anchor positions.
- for (int i = aTextBoxesToDelete.size() - 1; i >= 0; --i)
- {
- SwFrameFormat*& rpTextBox = aTextBoxesToDelete[i];
- pDoc->getIDocumentLayoutAccess().DelLayoutFormat(rpTextBox);
- }
+ // Only delete these now: earlier deletion would clear the mark list as well.
+ // Delete in reverse order, assuming that the container is sorted by anchor positions.
+ for (int i = aTextBoxesToDelete.size() - 1; i >= 0; --i)
+ {
+ SwFrameFormat*& rpTextBox = aTextBoxesToDelete[i];
+ pDoc->getIDocumentLayoutAccess().DelLayoutFormat(rpTextBox);
}
+
pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr);
if( pTmpRoot )
pTmpRoot->EndAllAction();