Kaydet (Commit) 32b2f88a authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert class SdUndoGroup from Container to std::vector

Change-Id: I303dd2f5ce5ac7f08727777ca03e4de0cfdabfcc
üst c4984cbf
......@@ -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: */
......@@ -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(); }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment