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

Convert pRedoStack in SdrModel class from Container to std::deque

Change-Id: I0535175c4881a1ea55d7cb7361ae78bb81aa10c6
üst aa2d9729
......@@ -193,7 +193,7 @@ protected:
SfxStyleSheet* pDefaultStyleSheet;
sfx2::LinkManager* pLinkManager; // LinkManager
std::deque<SfxUndoAction*>* pUndoStack;
Container* pRedoStack;
std::deque<SfxUndoAction*>* pRedoStack;
SdrUndoGroup* pAktUndoGroup; // Fuer mehrstufige
sal_uInt16 nUndoLevel; // Undo-Klammerung
sal_uInt16 nProgressPercent; // fuer den ProgressBar-Handler
......@@ -579,8 +579,8 @@ public:
sal_uIntPtr GetUndoActionCount() const { return pUndoStack!=NULL ? pUndoStack->size() : 0; }
const SfxUndoAction* GetUndoAction(sal_uIntPtr nNum) const { return (SfxUndoAction*)(pUndoStack!=NULL ? (*pUndoStack)[nNum] : NULL); }
// RedoAction(0) ist die aktuelle (also die des letzten Undo)
sal_uIntPtr GetRedoActionCount() const { return pRedoStack!=NULL ? pRedoStack->Count() : 0; }
const SfxUndoAction* GetRedoAction(sal_uIntPtr nNum) const { return (SfxUndoAction*)(pRedoStack!=NULL ? pRedoStack->GetObject(nNum) : NULL); }
sal_uIntPtr GetRedoActionCount() const { return pRedoStack!=NULL ? pRedoStack->size() : 0; }
const SfxUndoAction* GetRedoAction(sal_uIntPtr nNum) const { return (SfxUndoAction*)(pRedoStack!=NULL ? (*pRedoStack)[nNum] : NULL); }
bool Undo();
bool Redo();
......
......@@ -422,8 +422,9 @@ void SdrModel::ClearUndoBuffer()
pUndoStack=NULL;
}
if (pRedoStack!=NULL) {
while (pRedoStack->Count()!=0) {
delete (SfxUndoAction*) pRedoStack->Remove(pRedoStack->Count()-1);
while (!pRedoStack->empty()) {
delete pRedoStack->back();
pRedoStack->pop_back();
}
delete pRedoStack;
pRedoStack=NULL;
......@@ -446,10 +447,10 @@ bool SdrModel::Undo()
mbUndoEnabled = false;
pDo->Undo();
if(pRedoStack==NULL)
pRedoStack=new Container(1024,16,16);
pRedoStack=new std::deque<SfxUndoAction*>;
SfxUndoAction* p = pUndoStack->front();
pUndoStack->pop_front();
pRedoStack->Insert(p,(sal_uIntPtr)0);
pRedoStack->push_front(p);
mbUndoEnabled = bWasUndoEnabled;
}
}
......@@ -473,7 +474,9 @@ bool SdrModel::Redo()
pDo->Redo();
if(pUndoStack==NULL)
pUndoStack=new std::deque<SfxUndoAction*>;
pUndoStack->push_front((SfxUndoAction*) pRedoStack->Remove((sal_uIntPtr)0));
SfxUndoAction* p = pRedoStack->front();
pRedoStack->pop_front();
pUndoStack->push_front(p);
mbUndoEnabled = bWasUndoEnabled;
}
}
......@@ -522,7 +525,7 @@ void SdrModel::ImpPostUndoAction(SdrUndoAction* pUndo)
pUndoStack->pop_back();
}
if (pRedoStack!=NULL)
pRedoStack->Clear();
pRedoStack->clear();
}
}
else
......
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