summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-15 14:41:01 +0200
committerMichael Stahl <mstahl@redhat.com>2012-08-16 18:44:05 +0200
commit32b2f88ad6e18ea061418a9092672f6ac8fcfb36 (patch)
tree61876be8a74ea853ce445ab0db7a80fd65f50204 /sd/source
parentc4984cbfafae189a4675e8619ba836f2ab2adb38 (diff)
Convert class SdUndoGroup from Container to std::vector
Change-Id: I303dd2f5ce5ac7f08727777ca03e4de0cfdabfcc
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/func/sdundogr.cxx20
-rw-r--r--sd/source/ui/inc/sdundogr.hxx6
2 files changed, 13 insertions, 13 deletions
diff --git a/sd/source/ui/func/sdundogr.cxx b/sd/source/ui/func/sdundogr.cxx
index 4a2a27521f09..29d4f534442a 100644
--- a/sd/source/ui/func/sdundogr.cxx
+++ b/sd/source/ui/func/sdundogr.cxx
@@ -30,12 +30,12 @@ TYPEINIT1(SdUndoGroup, SdUndoAction);
SdUndoGroup::~SdUndoGroup()
{
- sal_uLong nLast = aCtn.Count();
- for (sal_uLong nAction = 0; nAction < nLast; nAction++)
+ size_t nLast = aCtn.size();
+ for (size_t nAction = 0; nAction < nLast; nAction++)
{
- delete (SdUndoAction*) aCtn.GetObject(nAction);
+ delete aCtn[nAction];
}
- aCtn.Clear();
+ aCtn.clear();
}
/*************************************************************************
@@ -70,10 +70,10 @@ sal_Bool SdUndoGroup::Merge( SfxUndoAction* pNextAction )
void SdUndoGroup::Undo()
{
- long nLast = aCtn.Count();
+ long nLast = aCtn.size();
for (long nAction = nLast - 1; nAction >= 0; nAction--)
{
- ((SdUndoAction*)aCtn.GetObject((sal_uLong)nAction))->Undo();
+ aCtn[nAction]->Undo();
}
}
@@ -86,10 +86,10 @@ void SdUndoGroup::Undo()
void SdUndoGroup::Redo()
{
- sal_uLong nLast = aCtn.Count();
- for (sal_uLong nAction = 0; nAction < nLast; nAction++)
+ size_t nLast = aCtn.size();
+ for (size_t nAction = 0; nAction < nLast; nAction++)
{
- ((SdUndoAction*)aCtn.GetObject(nAction))->Redo();
+ aCtn[nAction]->Redo();
}
}
@@ -102,7 +102,7 @@ void SdUndoGroup::Redo()
void SdUndoGroup::AddAction(SdUndoAction* pAction)
{
- aCtn.Insert(pAction, CONTAINER_APPEND);
+ aCtn.push_back(pAction);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/sdundogr.hxx b/sd/source/ui/inc/sdundogr.hxx
index 43866013f91e..e12d433580d6 100644
--- a/sd/source/ui/inc/sdundogr.hxx
+++ b/sd/source/ui/inc/sdundogr.hxx
@@ -26,12 +26,12 @@
class SD_DLLPUBLIC SdUndoGroup : public SdUndoAction
{
- Container aCtn;
+ std::vector<SdUndoAction*> aCtn;
public:
TYPEINFO();
SdUndoGroup(SdDrawDocument* pSdDrawDocument)
: SdUndoAction(pSdDrawDocument),
- aCtn(16, 16, 16) {}
+ aCtn() {}
virtual ~SdUndoGroup();
virtual sal_Bool Merge( SfxUndoAction* pNextAction );
@@ -40,7 +40,7 @@ public:
virtual void Redo();
void AddAction(SdUndoAction* pAction);
- sal_uLong Count() const { return aCtn.Count(); }
+ sal_uLong Count() const { return aCtn.size(); }
};