diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-08 11:22:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-09 12:09:55 +0200 |
commit | f7ce839c7844f029c0a1ac83a5638e83356b4c4b (patch) | |
tree | c93a342a577133b384a3ccc088d7d0675d4fb9e3 /editeng | |
parent | 4ba06560e33f17ca1ed72ad722c80eae5ffd4277 (diff) |
use unique_ptr in SfxUndoManager::AddUndoAction
Change-Id: I11483e3cece12a7373f4276972b4c899edf1ce15
Reviewed-on: https://gerrit.libreoffice.org/61566
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 27 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/impedit5.cxx | 30 | ||||
-rw-r--r-- | editeng/source/outliner/outleeng.cxx | 3 | ||||
-rw-r--r-- | editeng/source/outliner/outlin2.cxx | 4 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 21 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 5 |
8 files changed, 51 insertions, 49 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 16deb64c85f2..4a5daed2c2bf 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -546,11 +546,11 @@ private: void TextModified(); void CalcHeight( ParaPortion* pPortion ); - void InsertUndo( EditUndo* pUndo, bool bTryMerge = false ); + void InsertUndo( std::unique_ptr<EditUndo> pUndo, bool bTryMerge = false ); void ResetUndoManager(); bool HasUndoManager() const { return pUndoManager != nullptr; } - EditUndoSetAttribs* CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ); + std::unique_ptr<EditUndoSetAttribs> CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ); std::unique_ptr<EditTextObject> GetEmptyTextObject(); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index e331006de1d3..c15f0fde7cbf 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2088,12 +2088,11 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_Int32 nChars ) { EditSelection aSel( rPaM ); aSel.Max().SetIndex( aSel.Max().GetIndex() + nChars ); - EditUndoSetAttribs* pAttrUndo = CreateAttribUndo( aSel, GetEmptyItemSet() ); - InsertUndo( pAttrUndo ); + InsertUndo( CreateAttribUndo( aSel, GetEmptyItemSet() ) ); break; // for } } - InsertUndo(new EditUndoRemoveChars(pEditEngine, CreateEPaM(rPaM), aStr)); + InsertUndo(o3tl::make_unique<EditUndoRemoveChars>(pEditEngine, CreateEPaM(rPaM), aStr)); } aEditDoc.RemoveChars( rPaM, nChars ); @@ -2152,7 +2151,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n aBeginMovingParagraphsHdl.Call( aMoveParagraphsInfo ); if ( IsUndoEnabled() && !IsInUndo()) - InsertUndo(new EditUndoMoveParagraphs(pEditEngine, aOldPositions, nNewPos)); + InsertUndo(o3tl::make_unique<EditUndoMoveParagraphs>(pEditEngine, aOldPositions, nNewPos)); // do not lose sight of the Position ! ParaPortion* pDestPortion = GetParaPortions().SafeGetObject( nNewPos ); @@ -2238,7 +2237,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR if ( IsUndoEnabled() && !IsInUndo() ) { - InsertUndo( new EditUndoConnectParas(pEditEngine, + InsertUndo( o3tl::make_unique<EditUndoConnectParas>(pEditEngine, aEditDoc.GetPos( pLeft ), pLeft->Len(), pLeft->GetContentAttribs().GetItems(), pRight->GetContentAttribs().GetItems(), pLeft->GetStyleSheet(), pRight->GetStyleSheet(), bBackward ) ); @@ -2488,7 +2487,7 @@ void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara ) ParaAttribsChanged( pNextNode ); if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(new EditUndoDelContent(pEditEngine, pNode, nPara)); + InsertUndo(o3tl::make_unique<EditUndoDelContent>(pEditEngine, pNode, nPara)); else { aEditDoc.RemoveItemsFromPool(*pNode); @@ -2654,9 +2653,9 @@ EditPaM ImpEditEngine::InsertTextUserInput( const EditSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { - EditUndoInsertChars* pNewUndo = new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), OUString(c)); + std::unique_ptr<EditUndoInsertChars> pNewUndo(new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), OUString(c))); bool bTryMerge = !bDoOverwrite && ( c != ' ' ); - InsertUndo( pNewUndo, bTryMerge ); + InsertUndo( std::move(pNewUndo), bTryMerge ); } aEditDoc.InsertText( aPaM, OUString(c) ); @@ -2723,7 +2722,7 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin aLine = aLine.copy( 0, nMaxNewChars ); // Delete the Rest... } if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), aLine)); + InsertUndo(o3tl::make_unique<EditUndoInsertChars>(pEditEngine, CreateEPaM(aPaM), aLine)); // Tabs ? if ( aLine.indexOf( '\t' ) == -1 ) aPaM = aEditDoc.InsertText( aPaM, aLine ); @@ -2781,7 +2780,7 @@ EditPaM ImpEditEngine::ImpFastInsertText( EditPaM aPaM, const OUString& rStr ) if ( ( aPaM.GetNode()->Len() + rStr.getLength() ) < MAXCHARSINPARA ) { if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), rStr)); + InsertUndo(o3tl::make_unique<EditUndoInsertChars>(pEditEngine, CreateEPaM(aPaM), rStr)); aPaM = aEditDoc.InsertText( aPaM, rStr ); TextModified(); @@ -2806,7 +2805,7 @@ EditPaM ImpEditEngine::ImpInsertFeature(const EditSelection& rCurSel, const SfxP return aPaM; if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(new EditUndoInsertFeature(pEditEngine, CreateEPaM(aPaM), rItem)); + InsertUndo(o3tl::make_unique<EditUndoInsertFeature>(pEditEngine, CreateEPaM(aPaM), rItem)); aPaM = aEditDoc.InsertFeature( aPaM, rItem ); UpdateFields(); @@ -2840,7 +2839,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttrib } if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(new EditUndoSplitPara(pEditEngine, aEditDoc.GetPos(rPaM.GetNode()), rPaM.GetIndex())); + InsertUndo(o3tl::make_unique<EditUndoSplitPara>(pEditEngine, aEditDoc.GetPos(rPaM.GetNode()), rPaM.GetIndex())); EditPaM aPaM( aEditDoc.InsertParaBreak( rPaM, bKeepEndingAttribs ) ); @@ -2899,10 +2898,10 @@ EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_Int32 nPara ) if ( nPara ) { OSL_ENSURE( aEditDoc.GetObject( nPara-1 ), "FastInsertParagraph: Prev does not exist" ); - InsertUndo(new EditUndoSplitPara(pEditEngine, nPara-1, aEditDoc.GetObject( nPara-1 )->Len())); + InsertUndo(o3tl::make_unique<EditUndoSplitPara>(pEditEngine, nPara-1, aEditDoc.GetObject( nPara-1 )->Len())); } else - InsertUndo(new EditUndoSplitPara(pEditEngine, 0, 0)); + InsertUndo(o3tl::make_unique<EditUndoSplitPara>(pEditEngine, 0, 0)); } ContentNode* pNode = new ContentNode( aEditDoc.GetItemPool() ); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index c57ba48bd237..66cd22344d0c 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2686,7 +2686,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, bool bChanges = false; bool bLenChanged = false; - EditUndoTransliteration* pUndo = nullptr; + std::unique_ptr<EditUndoTransliteration> pUndo; utl::TransliterationWrapper aTransliterationWrapper( ::comphelper::getProcessComponentContext(), nTransliterationMode ); bool bConsiderLanguage = aTransliterationWrapper.needLanguageForTheMode(); @@ -2919,7 +2919,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, aNewSel = aSel; ESelection aESel( CreateESel( aSel ) ); - pUndo = new EditUndoTransliteration(pEditEngine, aESel, nTransliterationMode); + pUndo.reset(new EditUndoTransliteration(pEditEngine, aESel, nTransliterationMode)); const bool bSingleNode = aSel.Min().GetNode()== aSel.Max().GetNode(); const bool bHasAttribs = aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() ); @@ -2959,7 +2959,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, { ESelection aESel( CreateESel( aNewSel ) ); pUndo->SetNewSelection( aESel ); - InsertUndo( pUndo ); + InsertUndo( std::move(pUndo) ); } if ( bChanges ) diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index aa34f0db573c..e9e7c67046ce 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -24,6 +24,7 @@ #include <svl/hint.hxx> #include <editeng/lrspitem.hxx> #include <sfx2/app.hxx> +#include <o3tl/make_unique.hxx> void ImpEditEngine::SetStyleSheetPool( SfxStyleSheetPool* pSPool ) { @@ -79,7 +80,7 @@ void ImpEditEngine::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle ) aNewStyleName = pStyle->GetName(); InsertUndo( - new EditUndoSetStyleSheet(pEditEngine, aEditDoc.GetPos( pNode ), + o3tl::make_unique<EditUndoSetStyleSheet>(pEditEngine, aEditDoc.GetPos( pNode ), aPrevStyleName, pCurStyle ? pCurStyle->GetFamily() : SfxStyleFamily::Para, aNewStyleName, pStyle ? pStyle->GetFamily() : SfxStyleFamily::Para, pNode->GetContentAttribs().GetItems() ) ); @@ -175,7 +176,7 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) Dispose(); } -EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ) +std::unique_ptr<EditUndoSetAttribs> ImpEditEngine::CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ) { DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "CreateAttribUndo: Incorrect selection "); aSel.Adjust( aEditDoc ); @@ -187,16 +188,16 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S DBG_ASSERT( nStartNode <= nEndNode, "CreateAttribUndo: Start > End ?!" ); - EditUndoSetAttribs* pUndo = nullptr; + std::unique_ptr<EditUndoSetAttribs> pUndo; if ( rSet.GetPool() != &aEditDoc.GetItemPool() ) { SfxItemSet aTmpSet( GetEmptyItemSet() ); aTmpSet.Put( rSet ); - pUndo = new EditUndoSetAttribs(pEditEngine, aESel, aTmpSet); + pUndo.reset( new EditUndoSetAttribs(pEditEngine, aESel, aTmpSet) ); } else { - pUndo = new EditUndoSetAttribs(pEditEngine, aESel, rSet); + pUndo.reset( new EditUndoSetAttribs(pEditEngine, aESel, rSet) ); } SfxItemPool* pPool = pUndo->GetNewAttribs().GetPool(); @@ -261,16 +262,15 @@ void ImpEditEngine::UndoActionEnd() } } -void ImpEditEngine::InsertUndo( EditUndo* pUndo, bool bTryMerge ) +void ImpEditEngine::InsertUndo( std::unique_ptr<EditUndo> pUndo, bool bTryMerge ) { DBG_ASSERT( !IsInUndo(), "InsertUndo in Undo mode!" ); if ( pUndoMarkSelection ) { - EditUndoMarkSelection* pU = new EditUndoMarkSelection(pEditEngine, *pUndoMarkSelection); - GetUndoManager().AddUndoAction( pU ); + GetUndoManager().AddUndoAction( o3tl::make_unique<EditUndoMarkSelection>(pEditEngine, *pUndoMarkSelection) ); pUndoMarkSelection.reset(); } - GetUndoManager().AddUndoAction( pUndo, bTryMerge ); + GetUndoManager().AddUndoAction( std::move(pUndo), bTryMerge ); mbLastTryMerge = bTryMerge; } @@ -501,9 +501,9 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, SetA if ( IsUndoEnabled() && !IsInUndo() && aStatus.DoUndoAttribs() ) { - EditUndoSetAttribs* pUndo = CreateAttribUndo( aSel, rSet ); + std::unique_ptr<EditUndoSetAttribs> pUndo = CreateAttribUndo( aSel, rSet ); pUndo->SetSpecial( nSpecial ); - InsertUndo( pUndo ); + InsertUndo( std::move(pUndo) ); } bool bCheckLanguage = false; @@ -593,11 +593,11 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, bool bRemoveParaAttri if ( IsUndoEnabled() && !IsInUndo() && aStatus.DoUndoAttribs() ) { // Possibly a special Undo, or itemset* - EditUndoSetAttribs* pUndo = CreateAttribUndo( aSel, GetEmptyItemSet() ); + std::unique_ptr<EditUndoSetAttribs> pUndo = CreateAttribUndo( aSel, GetEmptyItemSet() ); pUndo->SetRemoveAttribs( true ); pUndo->SetRemoveParaAttribs( bRemoveParaAttribs ); pUndo->SetRemoveWhich( nWhich ); - InsertUndo( pUndo ); + InsertUndo( std::move(pUndo) ); } // iterate over the paragraphs ... @@ -691,11 +691,11 @@ void ImpEditEngine::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) { SfxItemSet aTmpSet( GetEmptyItemSet() ); aTmpSet.Put( rSet ); - InsertUndo(new EditUndoSetParaAttribs(pEditEngine, nPara, pNode->GetContentAttribs().GetItems(), aTmpSet)); + InsertUndo(o3tl::make_unique<EditUndoSetParaAttribs>(pEditEngine, nPara, pNode->GetContentAttribs().GetItems(), aTmpSet)); } else { - InsertUndo(new EditUndoSetParaAttribs(pEditEngine, nPara, pNode->GetContentAttribs().GetItems(), rSet)); + InsertUndo(o3tl::make_unique<EditUndoSetParaAttribs>(pEditEngine, nPara, pNode->GetContentAttribs().GetItems(), rSet)); } } diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx index 8fb8f7ee7284..9eb6f792340e 100644 --- a/editeng/source/outliner/outleeng.cxx +++ b/editeng/source/outliner/outleeng.cxx @@ -33,6 +33,7 @@ #include <editeng/eeitem.hxx> #include <editeng/editstat.hxx> #include "outlundo.hxx" +#include <o3tl/make_unique.hxx> OutlinerEditEng::OutlinerEditEng( Outliner* pEngOwner, SfxItemPool* pPool ) : EditEngine( pPool ) @@ -96,7 +97,7 @@ void OutlinerEditEng::ParagraphConnected( sal_Int32 /*nLeftParagraph*/, sal_Int3 Paragraph* pPara = pOwner->GetParagraph( nRightParagraph ); if( pPara && Outliner::HasParaFlag( pPara, ParaFlag::ISPAGE ) ) { - pOwner->InsertUndo( new OutlinerUndoChangeParaFlags( pOwner, nRightParagraph, ParaFlag::ISPAGE, ParaFlag::NONE ) ); + pOwner->InsertUndo( o3tl::make_unique<OutlinerUndoChangeParaFlags>( pOwner, nRightParagraph, ParaFlag::ISPAGE, ParaFlag::NONE ) ); } } } diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index bff245863eea..2e3e495a6c97 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -308,9 +308,9 @@ void Outliner::UndoActionEnd() pEditEngine->UndoActionEnd(); } -void Outliner::InsertUndo( EditUndo* pUndo ) +void Outliner::InsertUndo( std::unique_ptr<EditUndo> pUndo ) { - pEditEngine->GetUndoManager().AddUndoAction( pUndo ); + pEditEngine->GetUndoManager().AddUndoAction( std::move(pUndo) ); } bool Outliner::IsInUndo() diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 01f4a218708a..42715dad0511 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -52,6 +52,7 @@ #include <svl/itempool.hxx> #include <libxml/xmlwriter.h> #include <sal/log.hxx> +#include <o3tl/make_unique.hxx> // calculate if it's RTL or not #include <unicode/ubidi.h> @@ -275,7 +276,7 @@ void Outliner::SetNumberingStartValue( sal_Int32 nPara, sal_Int16 nNumberingStar if( pPara && pPara->GetNumberingStartValue() != nNumberingStartValue ) { if( IsUndoEnabled() && !IsInUndo() ) - InsertUndo( new OutlinerUndoChangeParaNumberingRestart( this, nPara, + InsertUndo( o3tl::make_unique<OutlinerUndoChangeParaNumberingRestart>( this, nPara, pPara->GetNumberingStartValue(), nNumberingStartValue, pPara->IsParaIsNumberingRestart(), pPara->IsParaIsNumberingRestart() ) ); @@ -299,7 +300,7 @@ void Outliner::SetParaIsNumberingRestart( sal_Int32 nPara, bool bParaIsNumbering if( pPara && (pPara->IsParaIsNumberingRestart() != bParaIsNumberingRestart) ) { if( IsUndoEnabled() && !IsInUndo() ) - InsertUndo( new OutlinerUndoChangeParaNumberingRestart( this, nPara, + InsertUndo( o3tl::make_unique<OutlinerUndoChangeParaNumberingRestart>( this, nPara, pPara->GetNumberingStartValue(), pPara->GetNumberingStartValue(), pPara->IsParaIsNumberingRestart(), bParaIsNumberingRestart ) ); @@ -737,7 +738,7 @@ void Outliner::ImplInitDepth( sal_Int32 nPara, sal_Int16 nDepth, bool bCreateUnd if ( bUndo ) { - InsertUndo( new OutlinerUndoChangeDepth( this, nPara, nOldDepth, nDepth ) ); + InsertUndo( o3tl::make_unique<OutlinerUndoChangeDepth>( this, nPara, nOldDepth, nDepth ) ); } pEditEngine->SetUpdateMode( bUpdate ); @@ -759,19 +760,19 @@ bool Outliner::Expand( Paragraph const * pPara ) { if ( pParaList->HasHiddenChildren( pPara ) ) { - OLUndoExpand* pUndo = nullptr; + std::unique_ptr<OLUndoExpand> pUndo; bool bUndo = IsUndoEnabled() && !IsInUndo(); if( bUndo ) { UndoActionStart( OLUNDO_EXPAND ); - pUndo = new OLUndoExpand( this, OLUNDO_EXPAND ); + pUndo.reset( new OLUndoExpand( this, OLUNDO_EXPAND ) ); pUndo->nCount = pParaList->GetAbsPos( pPara ); } pParaList->Expand( pPara ); InvalidateBullet(pParaList->GetAbsPos(pPara)); if( bUndo ) { - InsertUndo( pUndo ); + InsertUndo( std::move(pUndo) ); UndoActionEnd(); } return true; @@ -783,7 +784,7 @@ bool Outliner::Collapse( Paragraph const * pPara ) { if ( pParaList->HasVisibleChildren( pPara ) ) // expanded { - OLUndoExpand* pUndo = nullptr; + std::unique_ptr<OLUndoExpand> pUndo; bool bUndo = false; if( !IsInUndo() && IsUndoEnabled() ) @@ -791,7 +792,7 @@ bool Outliner::Collapse( Paragraph const * pPara ) if( bUndo ) { UndoActionStart( OLUNDO_COLLAPSE ); - pUndo = new OLUndoExpand( this, OLUNDO_COLLAPSE ); + pUndo.reset( new OLUndoExpand( this, OLUNDO_COLLAPSE ) ); pUndo->nCount = pParaList->GetAbsPos( pPara ); } @@ -799,7 +800,7 @@ bool Outliner::Collapse( Paragraph const * pPara ) InvalidateBullet(pParaList->GetAbsPos(pPara)); if( bUndo ) { - InsertUndo( pUndo ); + InsertUndo( std::move(pUndo) ); UndoActionEnd(); } return true; @@ -1991,7 +1992,7 @@ void Outliner::SetParaFlag( Paragraph* pPara, ParaFlag nFlag ) if( pPara && !pPara->HasFlag( nFlag ) ) { if( IsUndoEnabled() && !IsInUndo() ) - InsertUndo( new OutlinerUndoChangeParaFlags( this, GetAbsPos( pPara ), pPara->nFlags, pPara->nFlags|nFlag ) ); + InsertUndo( o3tl::make_unique<OutlinerUndoChangeParaFlags>( this, GetAbsPos( pPara ), pPara->nFlags, pPara->nFlags|nFlag ) ); pPara->SetFlag( nFlag ); } diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index f86f707c4c35..f214ca3fe06d 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -45,6 +45,7 @@ #include <svl/eitem.hxx> #include <editeng/editstat.hxx> #include <sal/log.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; @@ -403,7 +404,7 @@ void OutlinerView::SetAttribs( const SfxItemSet& rAttrs ) pOwner->ImplCalcBulletText( nPara, false, false ); if( !pOwner->IsInUndo() && pOwner->IsUndoEnabled() ) - pOwner->InsertUndo( new OutlinerUndoCheckPara( pOwner, nPara ) ); + pOwner->InsertUndo( o3tl::make_unique<OutlinerUndoCheckPara>( pOwner, nPara ) ); } if( !pOwner->IsInUndo() && pOwner->IsUndoEnabled() ) @@ -476,7 +477,7 @@ void OutlinerView::Indent( short nDiff ) pOwner->pEditEngine->QuickMarkInvalid( ESelection( nPara, 0, nPara, 0 ) ); if( bUndo ) - pOwner->InsertUndo( new OutlinerUndoChangeParaFlags( pOwner, nPara, nPrevFlags, pPara->nFlags ) ); + pOwner->InsertUndo( o3tl::make_unique<OutlinerUndoChangeParaFlags>( pOwner, nPara, nPrevFlags, pPara->nFlags ) ); continue; } |