summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/source/ui/view/sdview3.cxx14
-rw-r--r--sd/source/ui/view/sdview4.cxx12
-rw-r--r--svx/source/svdraw/svdoashp.cxx1
-rw-r--r--svx/source/svdraw/svdoole2.cxx9
4 files changed, 22 insertions, 14 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 123a3f4629a1..38079c51e968 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -53,7 +53,6 @@
#include <vcl/metaact.hxx>
#include <svx/svxids.hrc>
#include <toolkit/helper/vclunohelper.hxx>
-
#include "DrawDocShell.hxx"
#include "fupoor.hxx"
#include "Window.hxx"
@@ -68,13 +67,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 -
@@ -731,6 +730,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
BegUndo( String( SdResId( STR_UNDO_DRAGDROP ) ) );
AddUndo( mrDoc.GetSdrUndoFactory().CreateUndoAttrObject( *pPickObj ) );
}
+
aSet.Put( pObj->GetMergedItemSet() );
/* Do not take over corner radius. There are
@@ -739,6 +739,16 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
object. */
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(&mrDoc.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 53d414cbd701..067b677a1f0c 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -50,15 +50,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;
@@ -96,8 +95,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 && pObj->IsEmptyPresObj() && !bOnMaster) )
+ const bool bIsGraphic(0 != dynamic_cast< SdrGrafObj* >(pPickObj));
+
+ if(bIsGraphic || (pPickObj && pPickObj->IsEmptyPresObj() && !bOnMaster)) // #i121603# Do not use pObj, it may be NULL
{
if( IsUndoEnabled() )
BegUndo(String(SdResId(STR_INSERTGRAPHIC)));
@@ -139,9 +139,9 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if( IsUndoEnabled() )
EndUndo();
}
- else if (pPickObj->IsClosedObj() && !pPickObj->ISA(SdrOle2Obj))
+ else if(pPickObj->IsClosedObj())
{
- // we fill the object with the graphic
+ // fill object with graphic
if( IsUndoEnabled() )
{
BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 15aaa0173cb9..e930d31017b9 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -855,6 +855,7 @@ SdrObjCustomShape::SdrObjCustomShape() :
fObjectRotation( 0.0 ),
mpLastShadowGeometry(0L)
{
+ bClosedObj = true; // custom shapes may be filled
bTextFrame = sal_True;
}
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index af194c0f2f58..d00e0b8fa548 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -770,8 +770,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubStri
SetResizeProtect(sal_True);
// For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
+ SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
}
// -----------------------------------------------------------------------------
@@ -1508,8 +1507,7 @@ void SdrOle2Obj::SetObjRef( const com::sun::star::uno::Reference < com::sun::sta
SetResizeProtect(sal_True);
// For math objects, set closed state to transparent
- if( ImplIsMathObj( rNewObjRef ) )
- SetClosedObj( false );
+ SetClosedObj(!ImplIsMathObj( rNewObjRef ));
Connect();
}
@@ -2015,8 +2013,7 @@ void SdrOle2Obj::GetObjRef_Impl()
}
// For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
+ SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
}
if ( xObjRef.is() )