summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svl/undo.hxx21
-rw-r--r--svl/source/undo/undo.cxx37
2 files changed, 32 insertions, 26 deletions
diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx
index 5aed21a5e189..d63a69b950f7 100644
--- a/include/svl/undo.hxx
+++ b/include/svl/undo.hxx
@@ -74,7 +74,8 @@ public:
virtual sal_uInt16 GetId() const;
private:
- SfxUndoAction& operator=( const SfxUndoAction& ); // n.i.!!
+ SfxUndoAction( const SfxUndoAction& ); // disabled
+ SfxUndoAction& operator=( const SfxUndoAction& ); // disabled
};
@@ -146,11 +147,16 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra
Redo and Undo work element wise on SfxListUndoActions.
*/
{
- public:
+ struct Impl;
+ Impl* mpImpl;
+
+public:
TYPEINFO_OVERRIDE();
- SfxListUndoAction( const OUString &rComment,
- const OUString& rRepeatComment, sal_uInt16 Id, SfxUndoArray *pFather);
+ SfxListUndoAction(
+ const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, SfxUndoArray *pFather );
+ ~SfxListUndoAction();
+
virtual void Undo() SAL_OVERRIDE;
virtual void UndoWithContext( SfxUndoContext& i_context ) SAL_OVERRIDE;
virtual void Redo() SAL_OVERRIDE;
@@ -165,13 +171,6 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra
virtual sal_uInt16 GetId() const SAL_OVERRIDE;
void SetComment(const OUString& rComment);
-
- private:
-
- sal_uInt16 nId;
- OUString aComment;
- OUString aRepeatComment;
-
};
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 514e842d765f..011bd17e7103 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -1248,45 +1248,52 @@ void SfxUndoManager::RemoveOldestUndoActions( size_t const i_count )
}
}
+struct SfxListUndoAction::Impl
+{
+ sal_uInt16 mnId;
+
+ OUString maComment;
+ OUString maRepeatComment;
+
+ Impl( sal_uInt16 nId, const OUString& rComment, const OUString& rRepeatComment ) :
+ mnId(nId), maComment(rComment), maRepeatComment(rRepeatComment) {}
+};
sal_uInt16 SfxListUndoAction::GetId() const
{
- return nId;
+ return mpImpl->mnId;
}
-
OUString SfxListUndoAction::GetComment() const
{
- return aComment;
+ return mpImpl->maComment;
}
-
void SfxListUndoAction::SetComment(const OUString& rComment)
{
- aComment = rComment;
+ mpImpl->maComment = rComment;
}
-
OUString SfxListUndoAction::GetRepeatComment(SfxRepeatTarget &) const
{
- return aRepeatComment;
+ return mpImpl->maRepeatComment;
}
-
-
-SfxListUndoAction::SfxListUndoAction
-(
+SfxListUndoAction::SfxListUndoAction(
const OUString &rComment,
const OUString &rRepeatComment,
- sal_uInt16 Id,
- SfxUndoArray *pFather
-)
-: nId(Id), aComment(rComment), aRepeatComment(rRepeatComment)
+ sal_uInt16 nId,
+ SfxUndoArray *pFather ) :
+ mpImpl(new Impl(nId, rComment, rRepeatComment))
{
pFatherUndoArray = pFather;
nMaxUndoActions = USHRT_MAX;
}
+SfxListUndoAction::~SfxListUndoAction()
+{
+ delete mpImpl;
+}
void SfxListUndoAction::Undo()
{