diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-06-27 14:45:20 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-06-27 14:45:20 +0000 |
commit | af89c2e73bdb17fbcd3540c2295b59b9b0dfd01a (patch) | |
tree | 3811e25d331f78969cfa8057506d50d2fba27bf0 /sd/source/ui/slidesorter/controller/SlsClipboard.cxx | |
parent | dc5438eb050a3c8d44e5b2b888b22ad00bbb9117 (diff) |
INTEGRATION: CWS impress122 (1.24.50); FILE MERGED
2007/06/13 15:25:23 af 1.24.50.1: #i76707# Made copy the default drop action for dragging pages to another document.
Diffstat (limited to 'sd/source/ui/slidesorter/controller/SlsClipboard.cxx')
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index c65929904677..44fba0cfe5db 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -4,9 +4,9 @@ * * $RCSfile: SlsClipboard.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: rt $ $Date: 2007-04-03 16:16:50 $ + * last change: $Author: hr $ $Date: 2007-06-27 15:45:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -74,6 +74,7 @@ #include "DrawDocShell.hxx" #include "sdpage.hxx" +#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp> #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/bindings.hxx> @@ -511,6 +512,20 @@ sal_Int8 Clipboard::AcceptDrop ( // Accept a drop. nResult = rEvent.mnAction; + // Use the copy action when the drop action is the default, i.e. not + // explicitly set to move or link, and when the source and + // target models are not the same. + const SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + if (pDragTransferable != NULL + && pDragTransferable->IsPageTransferable() + && ((rEvent.maDragEvent.DropAction + & ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_DEFAULT) != 0) + && (mrController.GetModel().GetDocument()->GetDocSh() + != pDragTransferable->GetPageDocShell())) + { + nResult = DND_ACTION_COPY; + } + // Show the insertion marker and the substitution for a drop. Point aPosition = pTargetWindow->PixelToLogic (rEvent.maPosPixel); view::ViewOverlay& rOverlay (mrController.GetView().GetOverlay()); |