diff options
-rw-r--r-- | compilerplugins/clang/unusedenumconstants.readonly.results | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/undobase.hxx | 6 | ||||
-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 |
5 files changed, 10 insertions, 24 deletions
diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results b/compilerplugins/clang/unusedenumconstants.readonly.results index 8b78a97df024..0ad6cb92a0c2 100644 --- a/compilerplugins/clang/unusedenumconstants.readonly.results +++ b/compilerplugins/clang/unusedenumconstants.readonly.results @@ -1180,8 +1180,6 @@ sc/source/filter/lotus/lotread.cxx:41 enum STATE S_WK1 sc/source/filter/oox/formulabase.cxx:63 enum FuncFlags BIFFIMPORTONLY -sc/source/ui/inc/undobase.hxx:135 - enum ScMoveUndoMode SC_UNDO_REFFIRST sc/source/ui/inc/viewdata.hxx:43 enum ScSplitMode SC_SPLIT_MODE_MAX_ENUM sc/source/ui/inc/viewdata.hxx:45 diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx index fea28529fd7d..903b63ec51f3 100644 --- a/sc/source/ui/inc/undobase.hxx +++ b/sc/source/ui/inc/undobase.hxx @@ -132,21 +132,17 @@ public: void EndRedo(); }; -enum ScMoveUndoMode { SC_UNDO_REFFIRST, SC_UNDO_REFLAST }; - class ScMoveUndo: public ScSimpleUndo // with references { public: ScMoveUndo( ScDocShell* pDocSh, - ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData, - ScMoveUndoMode eRefMode ); + ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData ); virtual ~ScMoveUndo() override; protected: std::unique_ptr<SdrUndoAction> pDrawUndo; ScDocumentUniquePtr pRefUndoDoc; std::unique_ptr<ScRefUndoData> pRefUndoData; - ScMoveUndoMode const eMode; void BeginUndo(); void EndUndo(); 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(); |