diff options
authorSamuel Mehrbrodt <>2017-12-14 21:14:09 +0100
committerThorsten Behrens <>2018-01-13 11:03:06 +0100
commit3e9bea4dcb6b780a3ef720858bb5dca92b065a39 (patch)
parent35ad7482af49ab80d348b619b6d420ee170d3e5d (diff)
tdf#86739 Anchor inserted images to cell by default
As Calc is all about cells, many users expect images to be also anchored to cells, not the page. This is in preparation for tdf#98931 where we also want to keep images attached to their cell when users sort the cells. Change-Id: I5ba19f2524504ec018990c60098900d99e0db1c9 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Thorsten Behrens <>
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 36cecff0384a..3672faf98788 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -164,6 +164,9 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
OUString aName = pLayer->GetNewGraphicName(); // "Graphics"
+ // Anchor images to cell by default, tdf#86739
+ ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *(rData.GetDocument()), rData.GetTabNo());
// don't select if from (dispatch) API, to allow subsequent cell operations
SdrInsertFlags nInsOptions = bApi ? SdrInsertFlags::DONTMARK : SdrInsertFlags::NONE;
pView->InsertObjectAtView( pObj, *pPV, nInsOptions );