diff options
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/spelldialog.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun4.cxx | 28 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 14 |
4 files changed, 27 insertions, 27 deletions
diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx index 9b498b6b820c..0678f8aea6b1 100644 --- a/sc/source/ui/view/spelldialog.cxx +++ b/sc/source/ui/view/spelldialog.cxx @@ -126,8 +126,8 @@ void ScSpellDialogChildWindow::Reset() SCROW nNewRow = mpViewData->GetCurY(); mpDocShell->GetUndoManager()->AddUndoAction( new ScUndoConversion( mpDocShell, mpViewData->GetMarkData(), - nOldCol, nOldRow, nTab, mxUndoDoc.release(), - nNewCol, nNewRow, nTab, mxRedoDoc.release(), + nOldCol, nOldRow, nTab, std::move(mxUndoDoc), + nNewCol, nNewRow, nTab, std::move(mxRedoDoc), ScConversionParam( SC_CONVERSION_SPELLCHECK ) ) ); sc::SetFormulaDirtyContext aCxt; diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index dfa2728d2486..1fd9ca6ab7f3 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1558,11 +1558,11 @@ void ScViewFunc::FillTab( InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool else aMarkRange = ScRange( GetViewData().GetCurX(), GetViewData().GetCurY(), nTab ); - ScDocument* pUndoDoc = nullptr; + ScDocumentUniquePtr pUndoDoc; if (bUndo) { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); pUndoDoc->InitUndo( &rDoc, nTab, nTab ); ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end(); @@ -1592,7 +1592,7 @@ void ScViewFunc::FillTab( InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool new ScUndoFillTable( pDocSh, rMark, aMarkRange.aStart.Col(), aMarkRange.aStart.Row(), nTab, aMarkRange.aEnd.Col(), aMarkRange.aEnd.Row(), nTab, - pUndoDoc, bMulti, nTab, nFlags, nFunction, bSkipEmpty, bAsLink ) ); + std::move(pUndoDoc), bMulti, nTab, nFlags, nFunction, bSkipEmpty, bAsLink ) ); } pDocSh->PostPaintGridAll(); @@ -1841,7 +1841,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, GetViewData().GetDocShell()->GetUndoManager()->AddUndoAction( new ScUndoReplace( GetViewData().GetDocShell(), *pUndoMark, nCol, nRow, nTab, - aUndoStr, pUndoDoc.release(), pSearchItem ) ); + aUndoStr, std::move(pUndoDoc), pSearchItem ) ); } if (nCommand == SvxSearchCmd::FIND_ALL || nCommand == SvxSearchCmd::REPLACE_ALL) diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 5bc8f11db602..dbcf8352622e 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -209,10 +209,10 @@ void ScViewFunc::DoRefConversion() ScDocShell* pDocSh = GetViewData().GetDocShell(); bool bOk = false; - ScDocument* pUndoDoc = nullptr; + ScDocumentUniquePtr pUndoDoc; if (bRecord) { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc.reset( new ScDocument( SCDOCMODE_UNDO ) ); SCTAB nTab = aMarkRange.aStart.Tab(); pUndoDoc->InitUndo( pDoc, nTab, nTab ); @@ -282,7 +282,7 @@ void ScViewFunc::DoRefConversion() } if (bRecord) { - ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); + ScDocumentUniquePtr pRedoDoc(new ScDocument( SCDOCMODE_UNDO )); SCTAB nTab = aMarkRange.aStart.Tab(); pRedoDoc->InitUndo( pDoc, nTab, nTab ); @@ -300,7 +300,7 @@ void ScViewFunc::DoRefConversion() pDocSh->GetUndoManager()->AddUndoAction( new ScUndoRefConversion( pDocSh, - aMarkRange, rMark, pUndoDoc, pRedoDoc, bMulti) ); + aMarkRange, rMark, std::move(pUndoDoc), std::move(pRedoDoc), bMulti) ); } pDocSh->PostPaint( aMarkRange, PaintPartFlags::Grid ); @@ -485,13 +485,13 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam ) } } - ScDocument* pUndoDoc = nullptr; - ScDocument* pRedoDoc = nullptr; + ScDocumentUniquePtr pUndoDoc; + ScDocumentUniquePtr pRedoDoc; if (bRecord) { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc.reset( new ScDocument( SCDOCMODE_UNDO ) ); pUndoDoc->InitUndo( &rDoc, nTab, nTab ); - pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); + pRedoDoc.reset( new ScDocument( SCDOCMODE_UNDO ) ); pRedoDoc->InitUndo( &rDoc, nTab, nTab ); if ( rMark.GetSelectCount() > 1 ) @@ -518,12 +518,12 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam ) { case SC_CONVERSION_SPELLCHECK: pEngine.reset(new ScSpellingEngine( - rDoc.GetEnginePool(), rViewData, pUndoDoc, pRedoDoc, LinguMgr::GetSpellChecker() )); + rDoc.GetEnginePool(), rViewData, pUndoDoc.get(), pRedoDoc.get(), LinguMgr::GetSpellChecker() )); break; case SC_CONVERSION_HANGULHANJA: case SC_CONVERSION_CHINESE_TRANSL: pEngine.reset(new ScTextConversionEngine( - rDoc.GetEnginePool(), rViewData, rConvParam, pUndoDoc, pRedoDoc )); + rDoc.GetEnginePool(), rViewData, rConvParam, pUndoDoc.get(), pRedoDoc.get() )); break; default: OSL_FAIL( "ScViewFunc::DoSheetConversion - unknown conversion type" ); @@ -557,8 +557,8 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam ) rViewData.GetDocShell()->GetUndoManager()->AddUndoAction( new ScUndoConversion( pDocSh, rMark, - nCol, nRow, nTab, pUndoDoc, - nNewCol, nNewRow, nTab, pRedoDoc, rConvParam ) ); + nCol, nRow, nTab, std::move(pUndoDoc), + nNewCol, nNewRow, nTab, std::move(pRedoDoc), rConvParam ) ); } sc::SetFormulaDirtyContext aCxt; @@ -568,8 +568,8 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam ) } else { - delete pUndoDoc; - delete pRedoDoc; + pUndoDoc.reset(); + pRedoDoc.reset(); } // *** final cleanup *** -------------------------------------------------- diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index a1baca741e0e..818ef89ab361 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1063,7 +1063,7 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem if (bRecord) { - ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO )); SCTAB nStartTab = aMarkRange.aStart.Tab(); SCTAB nTabCount = pDoc->GetTableCount(); bool bCopyOnlyMarked = false; @@ -1082,10 +1082,10 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem pDocSh->GetUndoManager()->AddUndoAction( new ScUndoSelectionAttr( - pDocSh, aFuncMark, - aMarkRange.aStart.Col(), aMarkRange.aStart.Row(), aMarkRange.aStart.Tab(), - aMarkRange.aEnd.Col(), aMarkRange.aEnd.Row(), aMarkRange.aEnd.Tab(), - pUndoDoc, bCopyOnlyMarked, &rAttr, &rNewOuter, pNewInner, &aMarkRangeWithEnvelope ) ); + pDocSh, aFuncMark, + aMarkRange.aStart.Col(), aMarkRange.aStart.Row(), aMarkRange.aStart.Tab(), + aMarkRange.aEnd.Col(), aMarkRange.aEnd.Row(), aMarkRange.aEnd.Tab(), + std::move(pUndoDoc), bCopyOnlyMarked, &rAttr, &rNewOuter, pNewInner, &aMarkRangeWithEnvelope ) ); } sal_uInt16 nExt = SC_PF_TESTMERGE; @@ -1180,7 +1180,7 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursor aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO )); pUndoDoc->InitUndo( &rDoc, nStartTab, nStartTab ); itr = aFuncMark.begin(); for (; itr != itrEnd; ++itr) @@ -1192,7 +1192,7 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursor pUndoAttr = new ScUndoSelectionAttr( pDocSh, aFuncMark, nStartCol, nStartRow, nStartTab, - nEndCol, nEndRow, nEndTab, pUndoDoc, bMulti, &rAttr ); + nEndCol, nEndRow, nEndTab, std::move(pUndoDoc), bMulti, &rAttr ); pDocSh->GetUndoManager()->AddUndoAction(pUndoAttr); pEditDataArray = pUndoAttr->GetDataArray(); } |