diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-27 14:07:12 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-30 06:34:32 +0000 |
commit | 3e9e667af2d8d307844b29d608b377a04b6bb139 (patch) | |
tree | f08ebf65eff11bdaae295b17af86fb8558ca0552 /svl | |
parent | 12868914a39b0e8fb32f63d1307c1bb1c535fb9c (diff) |
loplugin:unusedmethods SfxLinkUndoAction
Change-Id: I1ad7c2452dd9bc80e7404f41484b9667adbcfa7b
Reviewed-on: https://gerrit.libreoffice.org/25542
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/undo/undo.cxx | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index 58320a1e2744..57d654d92f77 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -45,24 +45,12 @@ SfxUndoContext::~SfxUndoContext() } -void SfxUndoAction::SetLinkToSfxLinkUndoAction(SfxLinkUndoAction* pSfxLinkUndoAction) -{ - mpSfxLinkUndoAction = pSfxLinkUndoAction; -} - - SfxUndoAction::~SfxUndoAction() { - if(mpSfxLinkUndoAction) - { - mpSfxLinkUndoAction->LinkedSfxUndoActionDestructed(*this); - mpSfxLinkUndoAction = nullptr; - } } SfxUndoAction::SfxUndoAction() -: mpSfxLinkUndoAction(nullptr) { } @@ -1396,90 +1384,6 @@ void SfxListUndoAction::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterEndElement(pWriter); } -/** - * Creates a LinkAction which points to another UndoManager. - * Gets that UndoManagers current Action and sets it as that UndoManager's - * associated Action. - */ -SfxLinkUndoAction::SfxLinkUndoAction(::svl::IUndoManager *pManager) -{ - pUndoManager = pManager; - SfxUndoManager* pUndoManagerImplementation = dynamic_cast< SfxUndoManager* >( pManager ); - ENSURE_OR_THROW( pUndoManagerImplementation != nullptr, "unsupported undo manager implementation!" ); - - // yes, this cast is dirty. But reaching into the SfxUndoManager's implementation, - // directly accessing its internal stack, and tampering with an action on that stack - // is dirty, too. - if ( pManager->GetMaxUndoActionCount() ) - { - size_t nPos = pManager->GetUndoActionCount()-1; - pAction = pUndoManagerImplementation->m_xData->pActUndoArray->aUndoActions[nPos].pAction; - pAction->SetLinkToSfxLinkUndoAction(this); - } - else - pAction = nullptr; -} - - -void SfxLinkUndoAction::Undo() -{ - if ( pAction ) - pUndoManager->Undo(); -} - - -void SfxLinkUndoAction::Redo() -{ - if ( pAction ) - pUndoManager->Redo(); -} - - -bool SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const -{ - return pAction && pAction->CanRepeat(r); -} - - -void SfxLinkUndoAction::Repeat(SfxRepeatTarget&r) -{ - if ( pAction && pAction->CanRepeat( r ) ) - pAction->Repeat( r ); -} - - -OUString SfxLinkUndoAction::GetComment() const -{ - if ( pAction ) - return pAction->GetComment(); - return OUString(); -} - - -OUString SfxLinkUndoAction::GetRepeatComment(SfxRepeatTarget&r) const -{ - if ( pAction ) - return pAction->GetRepeatComment(r); - return OUString(); -} - - -SfxLinkUndoAction::~SfxLinkUndoAction() -{ - if( pAction ) - pAction->SetLinkToSfxLinkUndoAction(nullptr); -} - - -void SfxLinkUndoAction::LinkedSfxUndoActionDestructed(const SfxUndoAction& rCandidate) -{ - assert(nullptr != pAction); - assert(pAction == &rCandidate && "Oops, the destroyed and linked UndoActions differ (!)"); - (void)rCandidate; - pAction = nullptr; -} - - SfxUndoArray::~SfxUndoArray() { while ( !aUndoActions.empty() ) @@ -1490,10 +1394,4 @@ SfxUndoArray::~SfxUndoArray() } } - -sal_uInt16 SfxLinkUndoAction::GetId() const -{ - return pAction ? pAction->GetId() : 0; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |