diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-15 15:50:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-16 06:09:55 +0000 |
commit | 64ea8306b0ceb001132ac9cbc945a12afc01b8cd (patch) | |
tree | f77f453a43c8ce388b45b460193d608399ecaa47 /sw | |
parent | 4f786274be8f9b01b34ad0772bcf718d5259bdc0 (diff) |
drop GetId() from SfxUndoAction
mostly so that the subclasses can use proper enum types for their own
IDs.
It turns out that nothing at the svl/sfx2 level needs an ID anyhow.
Change-Id: I3c020aeafb812fa30d896216d4e3bc1a82cbfeab
Reviewed-on: https://gerrit.libreoffice.org/35222
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/undobj.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/doc/dbgoutsw.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/undo/docundo.cxx | 8 |
3 files changed, 7 insertions, 18 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 26625731ad22..3f0e521213e7 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -72,9 +72,6 @@ protected: */ virtual SwRewriter GetRewriter() const; - // return type is sal_uInt16 because this overrides SfxUndoAction::GetId() - virtual sal_uInt16 GetId() const override { return static_cast<sal_uInt16>(m_nId); } - // the 4 methods that derived classes have to override // base implementation does nothing virtual void RepeatImpl( ::sw::RepeatContext & ); @@ -97,6 +94,8 @@ public: SwUndo(SwUndoId const nId, const SwDoc* pDoc); virtual ~SwUndo() override; + SwUndoId GetId() const { return m_nId; } + /** Returns textual comment for this undo object. diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index 79c0b9707f90..d4c95ac7936e 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -768,16 +768,8 @@ const char * dbg_out(SwNodes & rNodes) static OUString lcl_dbg_out(const SwUndo & rUndo) { - OUString aStr("[ "); - - aStr += OUString::number( - static_cast<SfxUndoAction const&>(rUndo).GetId()); - aStr += ": "; - - aStr += rUndo.GetComment(); - aStr += " ]"; - - return aStr; + return "[ " + OUString::number(rUndo.GetId()) + + ": " + rUndo.GetComment() + " ]"; } const char * dbg_out(const SwUndo & rUndo) diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index 4d117dac50ae..e1ca5244c782 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -387,8 +387,7 @@ UndoManager::GetLastUndoInfo( } if (o_pId) { - sal_uInt16 const nId(pAction->GetId()); - *o_pId = static_cast<SwUndoId>(nId); + *o_pId = static_cast<const SwUndo*>(pAction)->GetId(); } return true; @@ -446,8 +445,7 @@ bool UndoManager::GetFirstRedoInfo(OUString *const o_pStr, } if (o_pId) { - sal_uInt16 const nId(pAction->GetId()); - *o_pId = static_cast<SwUndoId>(nId); + *o_pId = static_cast<const SwUndo*>(pAction)->GetId(); } return true; @@ -655,7 +653,7 @@ bool UndoManager::Repeat(::sw::RepeatContext & rContext, OUString const comment(pRepeatAction->GetComment()); OUString const rcomment(pRepeatAction->GetRepeatComment(rContext)); - sal_uInt16 const nId(pRepeatAction->GetId()); + SwUndoId const nId(static_cast<const SwUndo*>(pRepeatAction)->GetId()); if (DoesUndo()) { int nViewShellId = -1; |