summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/sdview4.cxx
diff options
context:
space:
mode:
authorChristian Lippka <christian.lippka@sun.com>2010-02-25 18:04:05 +0100
committerChristian Lippka <christian.lippka@sun.com>2010-02-25 18:04:05 +0100
commit55525d4462565f4e47e92854158c5fe7a7e457ab (patch)
treeefaca9a09eabaf26521652c1037020ae2057548a /sd/source/ui/view/sdview4.cxx
parent3c69551e7713eb9ad2da6e55d17c3de501d4c907 (diff)
more fixes for new presentation layout shapes
Diffstat (limited to 'sd/source/ui/view/sdview4.cxx')
-rw-r--r--sd/source/ui/view/sdview4.cxx21
1 files changed, 12 insertions, 9 deletions
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 49496086e084..aeebb7d63f69 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -123,6 +123,9 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
const bool bIsGraphic = pPickObj->ISA( SdrGrafObj );
if( bIsGraphic || pObj->IsEmptyPresObj() )
{
+ if( IsUndoEnabled() )
+ BegUndo(String(SdResId(STR_INSERTGRAPHIC)));
+
SdPage* pPage = (SdPage*) pPickObj->GetPage();
if( bIsGraphic )
@@ -157,10 +160,8 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
ReplaceObjectAtView(pPickObj, *pPV, pNewGrafObj); // maybe ReplaceObjectAtView
- if( !IsUndoEnabled() && pPickObj )
- {
- SdrObject::Free( pPickObj );
- }
+ if( IsUndoEnabled() )
+ EndUndo();
}
else if (pPickObj->IsClosedObj() && !pPickObj->ISA(SdrOle2Obj))
{
@@ -329,13 +330,14 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
pNewMediaObj = new SdrMediaObj( aRect );
+ bool bIsPres = false;
if( pPickObj )
{
SdPage* pPage = static_cast< SdPage* >(pPickObj->GetPage());
- if(pPage && pPage->IsPresObj(pPickObj))
+ bIsPres = pPage && pPage->IsPresObj(pPickObj);
+ if( bIsPres )
{
pPage->InsertPresObj( pNewMediaObj, PRESOBJ_MEDIA );
- pNewMediaObj->SetUserCall(pPickObj->GetUserCall());
}
}
@@ -347,10 +349,11 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
pNewMediaObj->setURL( rMediaURL );
if( pPickObj )
+ {
pNewMediaObj->AdjustToMaxRect( pPickObj->GetLogicRect() );
-
- if( !IsUndoEnabled() )
- SdrObject::Free( pPickObj );
+ if( bIsPres )
+ pNewMediaObj->SetUserCall(pPickObj->GetUserCall());
+ }
}
rAction = mnAction;