summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-12-14 21:14:09 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-01-13 11:03:06 +0100
commit3e9bea4dcb6b780a3ef720858bb5dca92b065a39 (patch)
tree916b42853e358dbefdfbf44c89fc18370c840b05
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: https://gerrit.libreoffice.org/46488 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx3
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"
pObj->SetName(aName);
+ // 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 );