diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-06 16:26:01 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-07 01:09:04 -0500 |
commit | 1b6e9f9dfc538841a873774428628124cbdc4fd8 (patch) | |
tree | bcb3c09914c81696b21cc7d69be755123e209733 /svl/source/undo | |
parent | c0533a4694e63959bc198dfb190511a223d521c0 (diff) |
Pimplize SfxUndoActions.
Change-Id: I35ef457111f4cf8b811a4ee8bb676421746e1d9d
Diffstat (limited to 'svl/source/undo')
-rw-r--r-- | svl/source/undo/undo.cxx | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index f3f855c55968..514e842d765f 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -135,6 +135,60 @@ bool SfxUndoAction::CanRepeat(SfxRepeatTarget&) const return true; } +struct SfxUndoActions::Impl +{ + std::vector<MarkedUndoAction> maActions; +}; + +SfxUndoActions::SfxUndoActions() : mpImpl(new Impl) {} + +SfxUndoActions::SfxUndoActions( const SfxUndoActions& r ) : + mpImpl(new Impl) +{ + mpImpl->maActions = r.mpImpl->maActions; +} + +SfxUndoActions::~SfxUndoActions() +{ + delete mpImpl; +} + +bool SfxUndoActions::empty() const +{ + return mpImpl->maActions.empty(); +} + +size_t SfxUndoActions::size() const +{ + return mpImpl->maActions.size(); +} + +const MarkedUndoAction& SfxUndoActions::operator[]( size_t i ) const +{ + return mpImpl->maActions[i]; +} + +MarkedUndoAction& SfxUndoActions::operator[]( size_t i ) +{ + return mpImpl->maActions[i]; +} + +void SfxUndoActions::Remove( size_t i_pos ) +{ + mpImpl->maActions.erase( mpImpl->maActions.begin() + i_pos ); +} + +void SfxUndoActions::Remove( size_t i_pos, size_t i_count ) +{ + mpImpl->maActions.erase( + mpImpl->maActions.begin() + i_pos, mpImpl->maActions.begin() + i_pos + i_count); +} + +void SfxUndoActions::Insert( SfxUndoAction* i_action, size_t i_pos ) +{ + mpImpl->maActions.insert( + mpImpl->maActions.begin() + i_pos, MarkedUndoAction( i_action ) ); +} typedef ::std::vector< SfxUndoListener* > UndoListeners; |