summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-14 15:49:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-14 15:52:22 +0000
commitb5eb7921a002d9e5a002013af83bc135b4efbb20 (patch)
tree9dcaab849f7577884aa2fafc0f62a49cecea0ed6 /sd
parenta6278bc3a9a7de6de5802fc4cbceb739bc0720d6 (diff)
inserting a picture in a blank placeholder is setting its bg
which isn't probably what we want here, we want to replace it fully like we always did. The old behaviour that if the frame is non-empty then we fill its bg with the color is still the case after this change. regression since 5c75cd95178e3d57e53fee64a9d64023c6d18acf Change-Id: Ib670a7f0dae5809d6936910b6ba4886a99fb7e64
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/sdview4.cxx45
1 files changed, 25 insertions, 20 deletions
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 1d6dd3fa9f0f..6b7ad96e73fc 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -95,24 +95,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
const bool bIsGraphic(0 != dynamic_cast< SdrGrafObj* >(pPickObj));
- if(pPickObj && !bIsGraphic && pPickObj->IsClosedObj() && !dynamic_cast< SdrOle2Obj* >(pPickObj))
- {
- // fill style change (fill object with graphic), independent of mnAction
- // and thus of DND_ACTION_LINK or DND_ACTION_MOVE
- if( IsUndoEnabled() )
- {
- BegUndo(OUString(SdResId(STR_UNDO_DRAGDROP)));
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
- EndUndo();
- }
-
- SfxItemSet aSet(mpDocSh->GetPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
-
- aSet.Put(XFillStyleItem(XFILL_BITMAP));
- aSet.Put(XFillBitmapItem(&mpDocSh->GetPool(), rGraphic));
- pPickObj->SetMergedItemSetAndBroadcast(aSet);
- }
- else if(DND_ACTION_LINK == mnAction
+ if (DND_ACTION_LINK == mnAction
&& pPickObj
&& pPV
&& (bIsGraphic || (pPickObj->IsEmptyPresObj() && !bOnMaster))) // #121603# Do not use pObj, it may be NULL
@@ -125,7 +108,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if( bIsGraphic )
{
- // Das Objekt wird mit der Bitmap gefuellt
+ // We fill the object with the Bitmap
pNewGrafObj = (SdrGrafObj*) pPickObj->Clone();
pNewGrafObj->SetGraphic(rGraphic);
}
@@ -145,7 +128,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if (pPage && pPage->IsPresObj(pPickObj))
{
- // Neues PresObj in die Liste eintragen
+ // Insert new PresObj into the list
pPage->InsertPresObj( pNewGrafObj, PRESOBJ_GRAPHIC );
pNewGrafObj->SetUserCall(pPickObj->GetUserCall());
}
@@ -158,6 +141,28 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if( IsUndoEnabled() )
EndUndo();
}
+ else if (DND_ACTION_LINK == mnAction
+ && pPickObj
+ && !bIsGraphic
+ && pPickObj->IsClosedObj()
+ && !dynamic_cast< SdrOle2Obj* >(pPickObj))
+ {
+ // fill style change (fill object with graphic), independent of mnAction
+ // and thus of DND_ACTION_LINK or DND_ACTION_MOVE
+ if( IsUndoEnabled() )
+ {
+ BegUndo(OUString(SdResId(STR_UNDO_DRAGDROP)));
+ AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
+ EndUndo();
+ }
+
+ SfxItemSet aSet(mpDocSh->GetPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
+
+ aSet.Put(XFillStyleItem(XFILL_BITMAP));
+ aSet.Put(XFillBitmapItem(&mpDocSh->GetPool(), rGraphic));
+ pPickObj->SetMergedItemSetAndBroadcast(aSet);
+ }
+
else if ( pPV )
{
// create new object