diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-08 13:04:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-09 08:09:58 +0200 |
commit | e9a3b06f4e2b22f26006e0df730ad23d715ecbb6 (patch) | |
tree | 75d02d9b233a997c4bb139effd9637f36f130d89 /sd | |
parent | 33e596e03cd486ebb992327988f4bebebd23a0c9 (diff) |
use unique_ptr in SdrUndoGroup
Change-Id: I569c56b6114e07b2a227ad0f906c1a5188a94af4
Reviewed-on: https://gerrit.libreoffice.org/61528
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 5d753fe4aaa5..bd5411a88157 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -886,7 +886,7 @@ void View::SetMarkedOriginalSize() { ::tools::Rectangle aDrawRect( pObj->GetLogicRect() ); - pUndoGroup->AddAction( mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) ); + pUndoGroup->AddAction( std::unique_ptr<SdrUndoAction>(mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj )) ); pObj->Resize( aDrawRect.TopLeft(), Fraction( aOleSize.Width(), aDrawRect.GetWidth() ), Fraction( aOleSize.Height(), aDrawRect.GetHeight() ) ); } @@ -896,7 +896,7 @@ void View::SetMarkedOriginalSize() { const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj); const Size aSize = pSdrGrafObj->getOriginalSize( ); - pUndoGroup->AddAction( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj ) ); + pUndoGroup->AddAction( std::unique_ptr<SdrUndoAction>(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj )) ); ::tools::Rectangle aRect( pObj->GetLogicRect() ); aRect.SetSize( aSize ); pObj->SetLogicRect( aRect ); @@ -1334,8 +1334,7 @@ void View::ChangeMarkedObjectsBulletsNumbering( pOutliner->SetText(*(pText->GetOutlinerParaObject())); if (bUndoEnabled) { - SdrUndoObjSetText* pTxtUndo = dynamic_cast< SdrUndoObjSetText* >(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, nCellIndex)); - pUndoGroup->AddAction(pTxtUndo); + pUndoGroup->AddAction(std::unique_ptr<SdrUndoAction>(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, nCellIndex))); } if ( !bToggleOn ) { @@ -1365,8 +1364,8 @@ void View::ChangeMarkedObjectsBulletsNumbering( pOutliner->SetText(*pParaObj); if (bUndoEnabled) { - SdrUndoObjSetText* pTxtUndo = dynamic_cast< SdrUndoObjSetText* >(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, 0)); - pUndoGroup->AddAction(pTxtUndo); + pUndoGroup->AddAction( + std::unique_ptr<SdrUndoAction>(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, 0))); } if ( !bToggleOn ) { |