diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-16 22:51:49 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-16 23:50:19 -0400 |
commit | c5cf5f700f53f5742bb8f3080083454c9623dadc (patch) | |
tree | 52bd8babc49313f60d276a8f21993c5bffaf5b93 /editeng | |
parent | e57525b61af70a6ee33c26f979e724740cca8655 (diff) |
Have EditUndo also return EditEngine*.
This is the first step toward having the undo classes use EditEngine
instead of ImpEditEngine.
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/inc/editeng/editund2.hxx | 12 | ||||
-rw-r--r-- | editeng/source/editeng/editundo.cxx | 19 |
2 files changed, 21 insertions, 10 deletions
diff --git a/editeng/inc/editeng/editund2.hxx b/editeng/inc/editeng/editund2.hxx index 554fb32f2c22..85ad570e5b10 100644 --- a/editeng/inc/editeng/editund2.hxx +++ b/editeng/inc/editeng/editund2.hxx @@ -32,6 +32,7 @@ #include "editeng/editengdllapi.h" #include <svl/undo.hxx> +class EditEngine; class ImpEditEngine; class EDITENG_DLLPRIVATE EditUndoManager : public SfxUndoManager @@ -55,14 +56,15 @@ class EDITENG_DLLPUBLIC EditUndo : public SfxUndoAction { private: sal_uInt16 nId; - ImpEditEngine* pImpEE; + ImpEditEngine* mpEditEngine; public: - TYPEINFO(); - EditUndo( sal_uInt16 nI, ImpEditEngine* pImpEE ); - virtual ~EditUndo(); + TYPEINFO(); + EditUndo(sal_uInt16 nI, ImpEditEngine* pEE); + virtual ~EditUndo(); - ImpEditEngine* GetImpEditEngine() const { return pImpEE; } + EditEngine* GetEditEngine(); + ImpEditEngine* GetImpEditEngine(); virtual void Undo() = 0; virtual void Redo() = 0; diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index 81bce92cef6b..f39572907285 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -140,11 +140,10 @@ sal_Bool EditUndoManager::Redo() return bDone; } -EditUndo::EditUndo( sal_uInt16 nI, ImpEditEngine* p ) +EditUndo::EditUndo(sal_uInt16 nI, ImpEditEngine* pEE) : + nId(nI), mpEditEngine(pEE) { DBG_CTOR( EditUndo, 0 ); - nId = nI; - pImpEE = p; } EditUndo::~EditUndo() @@ -152,6 +151,16 @@ EditUndo::~EditUndo() DBG_DTOR( EditUndo, 0 ); } +EditEngine* EditUndo::GetEditEngine() +{ + return mpEditEngine->GetEditEnginePtr(); +} + +ImpEditEngine* EditUndo::GetImpEditEngine() +{ + return mpEditEngine; +} + sal_uInt16 EditUndo::GetId() const { DBG_CHKTHIS( EditUndo, 0 ); @@ -166,9 +175,9 @@ sal_Bool EditUndo::CanRepeat(SfxRepeatTarget&) const XubString EditUndo::GetComment() const { XubString aComment; - if ( pImpEE ) + if ( mpEditEngine ) { - EditEngine* pEditEng = pImpEE->GetEditEnginePtr(); + EditEngine* pEditEng = mpEditEngine->GetEditEnginePtr(); aComment = pEditEng->GetUndoComment( GetId() ); } return aComment; |