diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2012-12-09 22:34:32 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2012-12-09 22:43:06 +0100 |
commit | fdb7fe63db5ba17036a71fe4f7f25f834bef8f95 (patch) | |
tree | a5380ca6f87e27022781dbe236ea7fd4e5880941 /sd | |
parent | 38364f5adc77c516721ad26297562d0b1bb66b8d (diff) |
Compress graphics dialog converted to new widget layout.
Change-Id: Iff1ffba10c5aaf3d438acf0a69467a0ac9e0f7cf
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 1ac1f0dbace8..30ac76500c9b 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1017,25 +1017,20 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); + if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) { - GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() ); + SdrGrafObj* pGraphicObj = (SdrGrafObj*) pObj; + CompressGraphicsDialog dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() ); + if ( dialog.Execute() == RET_OK ) { - CompressGraphicsDialog dialog( GetParentWindow(), aGraphicObject.GetGraphic(), pObj->GetLogicRect().GetSize(), GetViewFrame()->GetBindings() ); - if ( dialog.Execute() == RET_OK ) - { - SdrGrafObj* pNewObject = (SdrGrafObj*) pObj->Clone(); - const Graphic aNewGraphic = dialog.GetCompressedGraphic(); - SdrPageView* pPageView = mpDrawView->GetSdrPageView(); - pNewObject->SetEmptyPresObj( sal_False ); - pNewObject->SetGraphic( aNewGraphic ); - String aUndoString( mpDrawView->GetDescriptionOfMarkedObjects() ); - aUndoString += (sal_Unicode) ( ' ' ); - aUndoString += String( "Compress" ); - mpDrawView->BegUndo( aUndoString ); - mpDrawView->ReplaceObjectAtView( pObj, *pPageView, pNewObject ); - mpDrawView->EndUndo(); - } + SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj(); + SdrPageView* pPageView = mpDrawView->GetSdrPageView(); + String aUndoString( mpDrawView->GetDescriptionOfMarkedObjects() ); + aUndoString += String( " Compress" ); + mpDrawView->BegUndo( aUndoString ); + mpDrawView->ReplaceObjectAtView( pObj, *pPageView, pNewObject ); + mpDrawView->EndUndo(); } } } |