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
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
......
......@@ -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();
......
......@@ -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 );
......
......@@ -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 ),
......
......@@ -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();
......
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