You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/01/09 16:49:01 UTC
svn commit: r1430910 - in /openoffice/trunk/main:
sd/source/ui/view/sdview3.cxx sd/source/ui/view/sdview4.cxx
svx/source/svdraw/svdoashp.cxx svx/source/svdraw/svdoole2.cxx
Author: alg
Date: Wed Jan 9 15:49:01 2013
New Revision: 1430910
URL: http://svn.apache.org/viewvc?rev=1430910&view=rev
Log:
#121603# corrected D&D on existing shapes (CTRL+SHIFT pressed)
Modified:
openoffice/trunk/main/sd/source/ui/view/sdview3.cxx
openoffice/trunk/main/sd/source/ui/view/sdview4.cxx
openoffice/trunk/main/svx/source/svdraw/svdoashp.cxx
openoffice/trunk/main/svx/source/svdraw/svdoole2.cxx
Modified: openoffice/trunk/main/sd/source/ui/view/sdview3.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sd/source/ui/view/sdview3.cxx?rev=1430910&r1=1430909&r2=1430910&view=diff
==============================================================================
--- openoffice/trunk/main/sd/source/ui/view/sdview3.cxx (original)
+++ openoffice/trunk/main/sd/source/ui/view/sdview3.cxx Wed Jan 9 15:49:01 2013
@@ -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 Transfe
BegUndo( String( SdResId( STR_UNDO_DRAGDROP ) ) );
AddUndo( mpDoc->GetSdrUndoFactory().CreateUndoAttrObject( *pPickObj ) );
}
+
aSet.Put( pObj->GetMergedItemSet() );
// Eckenradius soll nicht uebernommen werden.
@@ -772,7 +770,17 @@ sal_Bool View::InsertData( const Transfe
// nicht auf das Objekt uebertragen werden.
aSet.ClearItem( SDRATTR_ECKENRADIUS );
- pPickObj->SetMergedItemSetAndBroadcast( aSet );
+ 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 ) )
{
Modified: openoffice/trunk/main/sd/source/ui/view/sdview4.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sd/source/ui/view/sdview4.cxx?rev=1430910&r1=1430909&r2=1430910&view=diff
==============================================================================
--- openoffice/trunk/main/sd/source/ui/view/sdview4.cxx (original)
+++ openoffice/trunk/main/sd/source/ui/view/sdview4.cxx Wed Jan 9 15:49:01 2013
@@ -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 G
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 G
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)));
Modified: openoffice/trunk/main/svx/source/svdraw/svdoashp.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/svdraw/svdoashp.cxx?rev=1430910&r1=1430909&r2=1430910&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/svdraw/svdoashp.cxx (original)
+++ openoffice/trunk/main/svx/source/svdraw/svdoashp.cxx Wed Jan 9 15:49:01 2013
@@ -645,6 +645,7 @@ SdrObjCustomShape::SdrObjCustomShape() :
fObjectRotation( 0.0 ),
mpLastShadowGeometry(0L)
{
+ bClosedObj = true; // custom shapes may be filled
bTextFrame = sal_True;
}
Modified: openoffice/trunk/main/svx/source/svdraw/svdoole2.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/svdraw/svdoole2.cxx?rev=1430910&r1=1430909&r2=1430910&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/svdraw/svdoole2.cxx (original)
+++ openoffice/trunk/main/svx/source/svdraw/svdoole2.cxx Wed Jan 9 15:49:01 2013
@@ -782,8 +782,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::Embed
SetResizeProtect(sal_True);
// #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
+ SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
}
// -----------------------------------------------------------------------------
@@ -805,8 +804,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::Embed
SetResizeProtect(sal_True);
// #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
+ SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
}
// -----------------------------------------------------------------------------
@@ -829,8 +827,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::Embed
SetResizeProtect(sal_True);
// #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
+ SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
}
// -----------------------------------------------------------------------------
@@ -1584,8 +1581,7 @@ void SdrOle2Obj::SetObjRef( const com::s
SetResizeProtect(sal_True);
// #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( rNewObjRef ) )
- SetClosedObj( false );
+ SetClosedObj(!ImplIsMathObj( rNewObjRef ));
Connect();
}
@@ -2117,8 +2113,7 @@ void SdrOle2Obj::GetObjRef_Impl()
}
// #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
+ SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
}
if ( xObjRef.is() )