[Libreoffice-commits] core.git: sc/source
Samuel Mehrbrodt
Samuel.Mehrbrodt at cib.de
Sat Jan 13 10:03:44 UTC 2018
sc/source/ui/drawfunc/fuins1.cxx | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 3e9bea4dcb6b780a3ef720858bb5dca92b065a39
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date: Thu Dec 14 21:14:09 2017 +0100
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 at libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
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 );
More information about the Libreoffice-commits
mailing list