diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-12 09:42:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-13 08:39:15 +0200 |
commit | 2d71dd52b6d91660cda6cb8f9457463439f56e20 (patch) | |
tree | f894d34e604eee2db24978c85ba67b9da0a4d573 /sfx2 | |
parent | ddef60b9c26b1d2990c6c49dbbda73e7831f21fb (diff) |
merge IUndoManager into SfxUndoManager
SfxUndoManager is the only implementation of the IUnderManager
"interface", and it lives in the same header.
Plus this way we can get rid of some covariant parameters,
which will make using std::unique_ptr easier.
Change-Id: I6661b9876b18da830bead78794d237886cd3c5c9
Reviewed-on: https://gerrit.libreoffice.org/57317
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appcfg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/shell.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/docundomanager.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 4 |
5 files changed, 11 insertions, 14 deletions
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 1ebe1e35ac4a..e9a7c76efca6 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -622,7 +622,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) pSh; ++nIdx, pSh = pDispat->GetShell(nIdx) ) { - ::svl::IUndoManager *pShUndoMgr = pSh->GetUndoManager(); + SfxUndoManager *pShUndoMgr = pSh->GetUndoManager(); if ( pShUndoMgr ) pShUndoMgr->SetMaxUndoActionCount( nUndoCount ); } diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index 970ca26c3260..3c48c749625e 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -201,12 +201,12 @@ SfxInterface* SfxShell::GetInterface() const return GetStaticInterface(); } -::svl::IUndoManager* SfxShell::GetUndoManager() +SfxUndoManager* SfxShell::GetUndoManager() { return pUndoMgr; } -void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr ) +void SfxShell::SetUndoManager( SfxUndoManager *pNewUndoMgr ) { OSL_ENSURE( ( pUndoMgr == nullptr ) || ( pNewUndoMgr == nullptr ) || ( pUndoMgr == pNewUndoMgr ), "SfxShell::SetUndoManager: exchanging one non-NULL manager with another non-NULL manager? Suspicious!" ); diff --git a/sfx2/source/doc/docundomanager.cxx b/sfx2/source/doc/docundomanager.cxx index 25a7082a1ef9..fe1baa263e68 100644 --- a/sfx2/source/doc/docundomanager.cxx +++ b/sfx2/source/doc/docundomanager.cxx @@ -48,15 +48,12 @@ namespace sfx2 using ::com::sun::star::lang::NoSupportException; using ::com::sun::star::frame::XModel; - using ::svl::IUndoManager; - - //= DocumentUndoManager_Impl struct DocumentUndoManager_Impl : public ::framework::IUndoManagerImplementation { DocumentUndoManager& rAntiImpl; - IUndoManager* pUndoManager; + SfxUndoManager* pUndoManager; ::framework::UndoManagerHelper aUndoHelper; explicit DocumentUndoManager_Impl( DocumentUndoManager& i_antiImpl ) @@ -73,7 +70,7 @@ namespace sfx2 }; // IUndoManagerImplementation - virtual ::svl::IUndoManager& getImplUndoManager() override; + virtual SfxUndoManager& getImplUndoManager() override; virtual Reference< XUndoManager > getThis() override; void disposing() @@ -86,9 +83,9 @@ namespace sfx2 void invalidateXDo_nolck(); private: - static IUndoManager* impl_retrieveUndoManager( SfxBaseModel& i_baseModel ) + static SfxUndoManager* impl_retrieveUndoManager( SfxBaseModel& i_baseModel ) { - IUndoManager* pUndoManager( nullptr ); + SfxUndoManager* pUndoManager( nullptr ); SfxObjectShell* pObjectShell = i_baseModel.GetObjectShell(); if ( pObjectShell != nullptr ) pUndoManager = pObjectShell->GetUndoManager(); @@ -99,7 +96,7 @@ namespace sfx2 }; - ::svl::IUndoManager& DocumentUndoManager_Impl::getImplUndoManager() + SfxUndoManager& DocumentUndoManager_Impl::getImplUndoManager() { ENSURE_OR_THROW( pUndoManager != nullptr, "DocumentUndoManager_Impl::getImplUndoManager: no access to the doc's UndoManager implementation!" ); diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index ad53b1a7bb56..0c17b7e45722 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1110,7 +1110,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) } case SID_DOC_REPAIR: { - svl::IUndoManager* pIUndoMgr = GetUndoManager(); + SfxUndoManager* pIUndoMgr = GetUndoManager(); if (pIUndoMgr) rSet.Put( SfxBoolItem(nWhich, pIUndoMgr->IsEmptyActions()) ); else diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index a0c34c36d0bf..9d4cebb64562 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -898,7 +898,7 @@ void SfxViewFrame::ExecHistory_Impl( SfxRequest &rReq ) { // Is there an Undo-Manager on the top Shell? SfxShell *pSh = GetDispatcher()->GetShell(0); - ::svl::IUndoManager* pShUndoMgr = pSh->GetUndoManager(); + SfxUndoManager* pShUndoMgr = pSh->GetUndoManager(); bool bOK = false; if ( pShUndoMgr ) { @@ -948,7 +948,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) // I'm just on reload and am yielding myself ... return; - ::svl::IUndoManager *pShUndoMgr = pSh->GetUndoManager(); + SfxUndoManager *pShUndoMgr = pSh->GetUndoManager(); if ( !pShUndoMgr ) { // The SW has its own undo in the View |