summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-02-14 10:34:35 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-02-15 08:00:13 +0100
commite756b6f310f309ac29bb2bce92309bb74edd788d (patch)
treeb8d67f1cde33ad117a8f8ab82348b786338511a2 /sc/source/core
parent954397df73b182e105e3ae5dff40c36a96239b08 (diff)
tdf#122982 Remove image from cell when cutting the cell
Change-Id: Idd73dcc88a8cd76eb4011bb26efdd5c712d16e5e Reviewed-on: https://gerrit.libreoffice.org/67844 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/drwlayer.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index fa7a784fbb4a..259e76fe08fa 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1446,11 +1446,18 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark )
if (!IsNoteCaption( pObject ))
{
tools::Rectangle aObjRect = pObject->GetCurrentBoundRect();
- if ( aMarkBound.IsInside( aObjRect ) )
+ ScRange aRange = pDoc->GetRange(nTab, aObjRect);
+ bool bObjectInMarkArea
+ = aMarkBound.IsInside(aObjRect) && rMark.IsAllMarked(aRange);
+ const ScDrawObjData* pObjData = ScDrawLayer::GetObjData(pObject);
+ ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObject);
+ bool bObjectAnchoredToMarkedCell
+ = ((aAnchorType == SCA_CELL || aAnchorType == SCA_CELL_RESIZE)
+ && rMark.IsCellMarked(pObjData->maStart.Col(),
+ pObjData->maStart.Row()));
+ if (bObjectInMarkArea || bObjectAnchoredToMarkedCell)
{
- ScRange aRange = pDoc->GetRange( nTab, aObjRect );
- if (rMark.IsAllMarked(aRange))
- ppObj[nDelCount++] = pObject;
+ ppObj[nDelCount++] = pObject;
}
}