diff options
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index d334d8908455..58140974a862 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -168,18 +168,13 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq ) if( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr) { sal_Int8 nAction = DND_ACTION_COPY; - SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC ); - bool bSelectionReplaced(false); + SdrObject* pPickObj; - if( pPickObj ) + if( ( ( pPickObj = mpView->GetSelectedSingleObject( mpView->GetPage() ) ) && mbReplaceExistingImage ) || (pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC ) ) ) { nAction = DND_ACTION_LINK; - } - else if(mbReplaceExistingImage && mpView->GetMarkedObjectCount() == 1) - { - pPickObj = mpView->GetMarkedObjectByIndex(0); - nAction = DND_ACTION_MOVE; - bSelectionReplaced = true; + } else { + pPickObj = nullptr; } Point aPos = mpWindow->GetVisibleCenter(); @@ -202,11 +197,6 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq ) } pGrafObj->SetGraphicLink(aFileName, aReferer, aFilterName); } - - if(bSelectionReplaced && pGrafObj) - { - mpView->MarkObj(pGrafObj, mpView->GetSdrPageView()); - } } } else |