sd/source/ui/view/sdview4.cxx | 45 +++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 20 deletions(-)
New commits: commit b5eb7921a002d9e5a002013af83bc135b4efbb20 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Feb 14 15:49:45 2014 +0000 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 diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 1d6dd3f..6b7ad96e 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
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits