sc/source/ui/view/cliputil.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit dbd104083dc4cc22075556811e67b5c81ef688ae Author: Thierry Emery <thierryalem...@gmail.com> AuthorDate: Mon Aug 8 22:07:40 2022 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Aug 15 13:17:04 2022 +0200 tdf#133299 Anchor pasted images 'to cell' by default This is already the default when inserting images via menu, do this also when pasting images from other applications (currently it would anchor 'to page'). Change-Id: I5e1d010b026fc8eba2d3a7cca80ea96814a2ebe8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138005 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> diff --git a/sc/source/ui/view/cliputil.cxx b/sc/source/ui/view/cliputil.cxx index bbf80bce33ad..770e309dbe97 100644 --- a/sc/source/ui/view/cliputil.cxx +++ b/sc/source/ui/view/cliputil.cxx @@ -81,7 +81,19 @@ void ScClipUtil::PasteFromClipboard( ScViewData& rViewData, ScTabViewShell* pTab // normal paste weld::WaitObject aWait( rViewData.GetDialogParent() ); if (!pOwnClip) + { pTabViewShell->PasteFromSystem(); + // Anchor To Cell rather than To Page + ScDrawView* pDrawView = pTabViewShell->GetScDrawView(); + if(pDrawView && 1 == pDrawView->GetMarkedObjectCount()) + { + SdrObject* pPickObj = pDrawView->GetMarkedObjectByIndex(0); + if(pPickObj) + { + ScDrawLayer::SetCellAnchoredFromPosition( *pPickObj, rThisDoc, nThisTab, false ); + } + } + } else { ScDocument* pClipDoc = pOwnClip->GetDocument();