diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2012-12-16 19:29:20 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2012-12-16 19:29:20 +0100 |
commit | e7453c4f1ae0b0d6fc695e665fd271b53e0cc90f (patch) | |
tree | d4d841c196c52526fb08dd3d554d6a42193987f7 /sd | |
parent | 789ec89fceb949eee482ecb7731a3d7b1ac0660e (diff) |
Compress graphics dialog converted to new widget layout.
Change-Id: Ibcf6338f33c40fbe6682a843b4771d51ea5a6845
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(); } } } |