summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewfunc.cxx
diff options
context:
space:
mode:
authorIlhan Yesil <ilhanyesil@gmx.de>2019-03-18 15:29:11 +0100
committerEike Rathke <erack@redhat.com>2019-05-15 00:07:11 +0200
commitd2fa9c0d657877c967e41fdd0091f81d1b7ca048 (patch)
treeab5783141915b91209cd5ff57bab03be58be5329 /sc/source/ui/view/viewfunc.cxx
parentc9b31caf3a33618dd2c9272bb528f8567b428fe5 (diff)
tdf#123762 Cell anchored object is deleted if cell is deleted
If an object is anchored to a cell, then it is expected that this object belongs to this cell and it's survive after a deletion of the cell makes no sense. So the anchored object will be deleted together with the cell. Objects anchored to the page are not affected. Change-Id: I91f24bf92ab5329aba1d053b3cf5fba77bf16e4f Reviewed-on: https://gerrit.libreoffice.org/69390 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/view/viewfunc.cxx')
-rw-r--r--sc/source/ui/view/viewfunc.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 991e3637480f..ec73df529d72 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1838,15 +1838,22 @@ void ScViewFunc::DeleteMulti( bool bRows )
}
std::vector<sc::ColRowSpan>::const_reverse_iterator ri = aSpans.rbegin(), riEnd = aSpans.rend();
+ aFuncMark.SelectOneTable(nTab);
for (; ri != riEnd; ++ri)
{
SCCOLROW nEnd = ri->mnEnd;
SCCOLROW nStart = ri->mnStart;
if (bRows)
- rDoc.DeleteRow( 0,nTab, MAXCOL,nTab, nStart, static_cast<SCSIZE>(nEnd-nStart+1) );
+ {
+ rDoc.DeleteObjectsInArea(0, nStart, MAXCOL, nEnd, aFuncMark, true);
+ rDoc.DeleteRow(0, nTab, MAXCOL, nTab, nStart, static_cast<SCSIZE>(nEnd - nStart + 1));
+ }
else
- rDoc.DeleteCol( 0,nTab, MAXROW,nTab, static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd-nStart+1) );
+ {
+ rDoc.DeleteObjectsInArea(nStart, 0, nEnd, MAXROW, aFuncMark, true);
+ rDoc.DeleteCol(0, nTab, MAXROW, nTab, static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd - nStart + 1));
+ }
}
if (bNeedRefresh)