diff options
author | Thierry Emery <thierryalemery@gmail.com> | 2022-08-08 22:07:40 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-08-15 13:17:04 +0200 |
commit | dbd104083dc4cc22075556811e67b5c81ef688ae (patch) | |
tree | 6f8da726af4ff996f1f54269ecd31c9fa6598c4d /sc/source/ui | |
parent | 203eaefb4ac012c36a1ecdd3753e1cb2c5876efc (diff) |
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.mehrbrodt@allotropia.de>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/view/cliputil.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
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(); |