Kaydet (Commit) 1ab34cdb authored tarafından Noel Grandin's avatar Noel Grandin

remove ScMoveUndoMode enum

we only use one value

Change-Id: I7a0f3760615111adcd8b925234f53fafa46a0bd7
Reviewed-on: https://gerrit.libreoffice.org/63942
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst d806e793
...@@ -1180,8 +1180,6 @@ sc/source/filter/lotus/lotread.cxx:41 ...@@ -1180,8 +1180,6 @@ sc/source/filter/lotus/lotread.cxx:41
enum STATE S_WK1 enum STATE S_WK1
sc/source/filter/oox/formulabase.cxx:63 sc/source/filter/oox/formulabase.cxx:63
enum FuncFlags BIFFIMPORTONLY enum FuncFlags BIFFIMPORTONLY
sc/source/ui/inc/undobase.hxx:135
enum ScMoveUndoMode SC_UNDO_REFFIRST
sc/source/ui/inc/viewdata.hxx:43 sc/source/ui/inc/viewdata.hxx:43
enum ScSplitMode SC_SPLIT_MODE_MAX_ENUM enum ScSplitMode SC_SPLIT_MODE_MAX_ENUM
sc/source/ui/inc/viewdata.hxx:45 sc/source/ui/inc/viewdata.hxx:45
......
...@@ -132,21 +132,17 @@ public: ...@@ -132,21 +132,17 @@ public:
void EndRedo(); void EndRedo();
}; };
enum ScMoveUndoMode { SC_UNDO_REFFIRST, SC_UNDO_REFLAST };
class ScMoveUndo: public ScSimpleUndo // with references class ScMoveUndo: public ScSimpleUndo // with references
{ {
public: public:
ScMoveUndo( ScDocShell* pDocSh, ScMoveUndo( ScDocShell* pDocSh,
ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData, ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData );
ScMoveUndoMode eRefMode );
virtual ~ScMoveUndo() override; virtual ~ScMoveUndo() override;
protected: protected:
std::unique_ptr<SdrUndoAction> pDrawUndo; std::unique_ptr<SdrUndoAction> pDrawUndo;
ScDocumentUniquePtr pRefUndoDoc; ScDocumentUniquePtr pRefUndoDoc;
std::unique_ptr<ScRefUndoData> pRefUndoData; std::unique_ptr<ScRefUndoData> pRefUndoData;
ScMoveUndoMode const eMode;
void BeginUndo(); void BeginUndo();
void EndUndo(); void EndUndo();
......
...@@ -407,12 +407,10 @@ void ScMultiBlockUndo::ShowBlock() ...@@ -407,12 +407,10 @@ void ScMultiBlockUndo::ShowBlock()
} }
} }
ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData, ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData ) :
ScMoveUndoMode eRefMode ) :
ScSimpleUndo( pDocSh ), ScSimpleUndo( pDocSh ),
pRefUndoDoc( std::move(pRefDoc) ), pRefUndoDoc( std::move(pRefDoc) ),
pRefUndoData( std::move(pRefData) ), pRefUndoData( std::move(pRefData) )
eMode( eRefMode )
{ {
ScDocument& rDoc = pDocShell->GetDocument(); ScDocument& rDoc = pDocShell->GetDocument();
if (pRefUndoData) if (pRefUndoData)
...@@ -433,10 +431,7 @@ void ScMoveUndo::UndoRef() ...@@ -433,10 +431,7 @@ void ScMoveUndo::UndoRef()
ScRange aRange(0,0,0, MAXCOL,MAXROW,pRefUndoDoc->GetTableCount()-1); ScRange aRange(0,0,0, MAXCOL,MAXROW,pRefUndoDoc->GetTableCount()-1);
pRefUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::FORMULA, false, rDoc, nullptr, false); pRefUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::FORMULA, false, rDoc, nullptr, false);
if (pRefUndoData) if (pRefUndoData)
pRefUndoData->DoUndo( &rDoc, (eMode == SC_UNDO_REFFIRST) ); pRefUndoData->DoUndo( &rDoc, false );
// 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..
} }
void ScMoveUndo::BeginUndo() void ScMoveUndo::BeginUndo()
...@@ -444,16 +439,13 @@ void ScMoveUndo::BeginUndo() ...@@ -444,16 +439,13 @@ void ScMoveUndo::BeginUndo()
ScSimpleUndo::BeginUndo(); ScSimpleUndo::BeginUndo();
EnableDrawAdjust( &pDocShell->GetDocument(), false ); EnableDrawAdjust( &pDocShell->GetDocument(), false );
if (pRefUndoDoc && eMode == SC_UNDO_REFFIRST)
UndoRef();
} }
void ScMoveUndo::EndUndo() void ScMoveUndo::EndUndo()
{ {
DoSdrUndoAction( pDrawUndo.get(), &pDocShell->GetDocument() ); // must also be called when pointer is null DoSdrUndoAction( pDrawUndo.get(), &pDocShell->GetDocument() ); // must also be called when pointer is null
if (pRefUndoDoc && eMode == SC_UNDO_REFLAST) if (pRefUndoDoc)
UndoRef(); UndoRef();
EnableDrawAdjust( &pDocShell->GetDocument(), true ); EnableDrawAdjust( &pDocShell->GetDocument(), true );
......
...@@ -73,7 +73,7 @@ ScUndoInsertCells::ScUndoInsertCells( ScDocShell* pNewDocShell, ...@@ -73,7 +73,7 @@ ScUndoInsertCells::ScUndoInsertCells( ScDocShell* pNewDocShell,
SCTAB nNewCount, std::unique_ptr<SCTAB[]> pNewTabs, std::unique_ptr<SCTAB[]> pNewScenarios, SCTAB nNewCount, std::unique_ptr<SCTAB[]> pNewTabs, std::unique_ptr<SCTAB[]> pNewScenarios,
InsCellCmd eNewCmd, ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData, InsCellCmd eNewCmd, ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData,
bool bNewPartOfPaste ) : bool bNewPartOfPaste ) :
ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), SC_UNDO_REFLAST ), ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) ),
aEffRange( rRange ), aEffRange( rRange ),
nCount( nNewCount ), nCount( nNewCount ),
pTabs( std::move(pNewTabs) ), pTabs( std::move(pNewTabs) ),
...@@ -341,7 +341,7 @@ ScUndoDeleteCells::ScUndoDeleteCells( ScDocShell* pNewDocShell, ...@@ -341,7 +341,7 @@ ScUndoDeleteCells::ScUndoDeleteCells( ScDocShell* pNewDocShell,
const ScRange& rRange, const ScRange& rRange,
SCTAB nNewCount, std::unique_ptr<SCTAB[]> pNewTabs, std::unique_ptr<SCTAB[]> pNewScenarios, SCTAB nNewCount, std::unique_ptr<SCTAB[]> pNewTabs, std::unique_ptr<SCTAB[]> pNewScenarios,
DelCellCmd eNewCmd, ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData ) : 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 ), aEffRange( rRange ),
nCount( nNewCount ), nCount( nNewCount ),
pTabs( std::move(pNewTabs) ), pTabs( std::move(pNewTabs) ),
...@@ -626,7 +626,7 @@ ScUndoDeleteMulti::ScUndoDeleteMulti( ...@@ -626,7 +626,7 @@ ScUndoDeleteMulti::ScUndoDeleteMulti(
bool bNewRows, bool bNeedsRefresh, SCTAB nNewTab, bool bNewRows, bool bNeedsRefresh, SCTAB nNewTab,
const std::vector<sc::ColRowSpan>& rSpans, const std::vector<sc::ColRowSpan>& rSpans,
ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData ) : 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), mbRows(bNewRows),
mbRefresh(bNeedsRefresh), mbRefresh(bNeedsRefresh),
nTab( nNewTab ), nTab( nNewTab ),
...@@ -1172,7 +1172,7 @@ bool ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const ...@@ -1172,7 +1172,7 @@ bool ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const
ScUndoDragDrop::ScUndoDragDrop( ScDocShell* pNewDocShell, ScUndoDragDrop::ScUndoDragDrop( ScDocShell* pNewDocShell,
const ScRange& rRange, const ScAddress& aNewDestPos, bool bNewCut, const ScRange& rRange, const ScAddress& aNewDestPos, bool bNewCut,
ScDocumentUniquePtr pUndoDocument, bool bScenario ) : ScDocumentUniquePtr pUndoDocument, bool bScenario ) :
ScMoveUndo( pNewDocShell, std::move(pUndoDocument), nullptr, SC_UNDO_REFLAST ), ScMoveUndo( pNewDocShell, std::move(pUndoDocument), nullptr ),
mnPaintExtFlags( 0 ), mnPaintExtFlags( 0 ),
aSrcRange( rRange ), aSrcRange( rRange ),
bCut( bNewCut ), bCut( bNewCut ),
......
...@@ -247,7 +247,7 @@ bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& rTarget) const ...@@ -247,7 +247,7 @@ bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& rTarget) const
ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell, const vector<SCTAB> &aTab, ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell, const vector<SCTAB> &aTab,
ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData ) : 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() ); theTabs.insert(theTabs.end(), aTab.begin(), aTab.end() );
SetChangeTrack(); SetChangeTrack();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment