diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-19 10:27:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-19 12:47:14 +0200 |
commit | 9049c94b32f00b8239cd2b50e5ac29dabf41cb61 (patch) | |
tree | 08324bdea83257803a0bba679555a222bb7b33f9 | |
parent | 1658bd231bc662504a072097dc614c29fe2e116d (diff) |
convert UndoOrRedo_t to scoped enum
Change-Id: I8d4dec9a3a861a45e41f8c8699ae5f8d81211369
-rw-r--r-- | sw/source/core/inc/UndoManager.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/undo/docundo.cxx | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/inc/UndoManager.hxx b/sw/source/core/inc/UndoManager.hxx index 74ce2b341a60..62649df04dc5 100644 --- a/sw/source/core/inc/UndoManager.hxx +++ b/sw/source/core/inc/UndoManager.hxx @@ -113,8 +113,8 @@ private: SwDocShell* m_pDocShell; SwView* m_pView; - typedef enum { UNDO = int(true), REDO = int(false) } UndoOrRedo_t; - bool impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo); + enum class UndoOrRedoType { Undo, Redo }; + bool impl_DoUndoRedo(UndoOrRedoType undoOrRedo); // UGLY: should not be called using SdrUndoManager::Repeat; diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index cc45eb82bed1..7b982903520e 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -542,7 +542,7 @@ private: bool const m_bSaveCursor; }; -bool UndoManager::impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo) +bool UndoManager::impl_DoUndoRedo(UndoOrRedoType undoOrRedo) { SwDoc & rDoc(*GetUndoNodes().GetDoc()); @@ -573,7 +573,7 @@ bool UndoManager::impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo) ::sw::UndoRedoContext context(rDoc, *pEditShell); // N.B. these may throw! - if (UNDO == undoOrRedo) + if (UndoOrRedoType::Undo == undoOrRedo) { bRet = SdrUndoManager::UndoWithContext(context); } @@ -608,7 +608,7 @@ bool UndoManager::Undo() } else { - return impl_DoUndoRedo(UNDO); + return impl_DoUndoRedo(UndoOrRedoType::Undo); } } @@ -620,7 +620,7 @@ bool UndoManager::Redo() } else { - return impl_DoUndoRedo(REDO); + return impl_DoUndoRedo(UndoOrRedoType::Redo); } } |