diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-22 15:37:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-24 19:04:55 +0100 |
commit | 1ab34cdb4a8bf255ba6a0eb96b2a30c7be5e451b (patch) | |
tree | eb34ada2ccb688e6b877535062d89fbabc4ceb63 /sc/source/ui/undo | |
parent | d806e7937c277cabc06ed40c6ed1d3efd805e15a (diff) |
remove ScMoveUndoMode enum
we only use one value
Change-Id: I7a0f3760615111adcd8b925234f53fafa46a0bd7
Reviewed-on: https://gerrit.libreoffice.org/63942
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r-- | sc/source/ui/undo/undobase.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/undo/undotab.cxx | 2 |
3 files changed, 9 insertions, 17 deletions
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index feb652e8a6c2..a14410e399bb 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -407,12 +407,10 @@ void ScMultiBlockUndo::ShowBlock() } } -ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData, - ScMoveUndoMode eRefMode ) : +ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData ) : ScSimpleUndo( pDocSh ), pRefUndoDoc( std::move(pRefDoc) ), - pRefUndoData( std::move(pRefData) ), - eMode( eRefMode ) + pRefUndoData( std::move(pRefData) ) { ScDocument& rDoc = pDocShell->GetDocument(); if (pRefUndoData) @@ -433,10 +431,7 @@ void ScMoveUndo::UndoRef() ScRange aRange(0,0,0, MAXCOL,MAXROW,pRefUndoDoc->GetTableCount()-1); pRefUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::FORMULA, false, rDoc, nullptr, false); if (pRefUndoData) - pRefUndoData->DoUndo( &rDoc, (eMode == SC_UNDO_REFFIRST) ); - // HACK: ScDragDropUndo is the only one with REFFIRST. - // If not, results possibly in a too frequent adjustment - // of ChartRefs. Not that pretty, but not too bad either.. + pRefUndoData->DoUndo( &rDoc, false ); } void ScMoveUndo::BeginUndo() @@ -444,16 +439,13 @@ void ScMoveUndo::BeginUndo() ScSimpleUndo::BeginUndo(); EnableDrawAdjust( &pDocShell->GetDocument(), false ); - - if (pRefUndoDoc && eMode == SC_UNDO_REFFIRST) - UndoRef(); } void ScMoveUndo::EndUndo() { DoSdrUndoAction( pDrawUndo.get(), &pDocShell->GetDocument() ); // must also be called when pointer is null - if (pRefUndoDoc && eMode == SC_UNDO_REFLAST) + if (pRefUndoDoc) UndoRef(); EnableDrawAdjust( &pDocShell->GetDocument(), true ); diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 4e982824e2ea..e2862e5b3294 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -73,7 +73,7 @@ ScUndoInsertCells::ScUndoInsertCells( ScDocShell* pNewDocShell, SCTAB nNewCount, std::unique_ptr<SCTAB[]> pNewTabs, std::unique_ptr<SCTAB[]> pNewScenarios, InsCellCmd eNewCmd, ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData, bool bNewPartOfPaste ) : - ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), SC_UNDO_REFLAST ), + ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) ), aEffRange( rRange ), nCount( nNewCount ), pTabs( std::move(pNewTabs) ), @@ -341,7 +341,7 @@ ScUndoDeleteCells::ScUndoDeleteCells( ScDocShell* pNewDocShell, const ScRange& rRange, SCTAB nNewCount, std::unique_ptr<SCTAB[]> pNewTabs, std::unique_ptr<SCTAB[]> pNewScenarios, DelCellCmd eNewCmd, ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData ) : - ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), SC_UNDO_REFLAST ), + ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) ), aEffRange( rRange ), nCount( nNewCount ), pTabs( std::move(pNewTabs) ), @@ -626,7 +626,7 @@ ScUndoDeleteMulti::ScUndoDeleteMulti( bool bNewRows, bool bNeedsRefresh, SCTAB nNewTab, const std::vector<sc::ColRowSpan>& rSpans, ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData ) : - ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), SC_UNDO_REFLAST ), + ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) ), mbRows(bNewRows), mbRefresh(bNeedsRefresh), nTab( nNewTab ), @@ -1172,7 +1172,7 @@ bool ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const ScUndoDragDrop::ScUndoDragDrop( ScDocShell* pNewDocShell, const ScRange& rRange, const ScAddress& aNewDestPos, bool bNewCut, ScDocumentUniquePtr pUndoDocument, bool bScenario ) : - ScMoveUndo( pNewDocShell, std::move(pUndoDocument), nullptr, SC_UNDO_REFLAST ), + ScMoveUndo( pNewDocShell, std::move(pUndoDocument), nullptr ), mnPaintExtFlags( 0 ), aSrcRange( rRange ), bCut( bNewCut ), diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index aff057b84354..24e784feea75 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -247,7 +247,7 @@ bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& rTarget) const ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell, const vector<SCTAB> &aTab, ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData ) : - ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), SC_UNDO_REFLAST ) + ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) ) { theTabs.insert(theTabs.end(), aTab.begin(), aTab.end() ); SetChangeTrack(); |