diff options
author | Armin Le Grand <alg@apache.org> | 2013-01-09 14:49:01 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2013-01-09 14:49:01 +0000 |
commit | 5f81e1134607ae67d7c598f695bd0997cd9c9284 (patch) | |
tree | 5ae49b092dc1ce3d74bba2293a9d44c43efe8db2 /sd | |
parent | 75f37694c9c55f7a80eaddca8e1cecce138705e4 (diff) |
#121603# corrected D&D on existing shapes (CTRL+SHIFT pressed)
Notes
Notes:
merged as: 501e0246bc72783f2dc830ea6b29f4a9e7c3045f
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 16 | ||||
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 16 |
2 files changed, 18 insertions, 14 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index ff4acd656c61..173c42a33da1 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sd.hxx" @@ -60,7 +58,6 @@ #include <vcl/metaact.hxx> #include <svx/svxids.hrc> #include <toolkit/helper/vclunohelper.hxx> - #include "DrawDocShell.hxx" #include "fupoor.hxx" #include "Window.hxx" @@ -75,13 +72,13 @@ #include "strmname.h" #include "unomodel.hxx" #include "ViewClipboard.hxx" - #include <sfx2/ipclient.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/processfactory.hxx> #include <tools/stream.hxx> #include <vcl/cvtgrf.hxx> #include <svx/sdrhittesthelper.hxx> +#include <svx/xbtmpit.hxx> // -------------- // - Namespaces - @@ -764,6 +761,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, BegUndo( String( SdResId( STR_UNDO_DRAGDROP ) ) ); AddUndo( mpDoc->GetSdrUndoFactory().CreateUndoAttrObject( *pPickObj ) ); } + aSet.Put( pObj->GetMergedItemSet() ); // Eckenradius soll nicht uebernommen werden. @@ -772,6 +770,16 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, // nicht auf das Objekt uebertragen werden. aSet.ClearItem( SDRATTR_ECKENRADIUS ); + const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pObj); + + if(pSdrGrafObj) + { + // If we have a graphic as source object, use it's graphic + // content as fill style + aSet.Put(XFillStyleItem(XFILL_BITMAP)); + aSet.Put(XFillBitmapItem(&mpDoc->GetPool(), pSdrGrafObj->GetGraphic())); + } + pPickObj->SetMergedItemSetAndBroadcast( aSet ); if( pPickObj->ISA( E3dObject ) && pObj->ISA( E3dObject ) ) diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 7e836d4036e9..139b5686de71 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sd.hxx" @@ -57,15 +55,14 @@ #include "sdpage.hxx" #include "view/SlideSorterView.hxx" #include "undo/undoobjects.hxx" - #include <comphelper/processfactory.hxx> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/XEmbedPersist.hpp> #include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> #include <svtools/soerr.hxx> - #include <sfx2/ipclient.hxx> +#include <svx/svdoashp.hxx> #include "glob.hrc" using namespace com::sun::star; @@ -112,8 +109,9 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, if( mnAction == DND_ACTION_LINK && pPickObj && pPV ) { - const bool bIsGraphic = pPickObj->ISA( SdrGrafObj ); - if( bIsGraphic || (pObj->IsEmptyPresObj() && !bOnMaster) ) + const bool bIsGraphic(0 != dynamic_cast< SdrGrafObj* >(pPickObj)); + + if(bIsGraphic || (pPickObj->IsEmptyPresObj() && !bOnMaster)) // #121603# Do not use pObj, it may be NULL { if( IsUndoEnabled() ) BegUndo(String(SdResId(STR_INSERTGRAPHIC))); @@ -155,11 +153,9 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, if( IsUndoEnabled() ) EndUndo(); } - else if (pPickObj->IsClosedObj() && !pPickObj->ISA(SdrOle2Obj)) + else if(pPickObj->IsClosedObj()) { - /****************************************************************** - * Das Objekt wird mit der Graphik gefuellt - ******************************************************************/ + // fill object with graphic if( IsUndoEnabled() ) { BegUndo(String(SdResId(STR_UNDO_DRAGDROP))); |