X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fundostack.C;fp=cinelerra-5.1%2Fcinelerra%2Fundostack.C;h=de738b84d3c6f7cf4be51666d53fe12430f6f401;hb=ae3fc4be2e74120251506615bb29b853c6e10ff6;hp=acc6544f010dd0467b2150b206fd1b38d08a3221;hpb=a88121d876acc81c5a28dbd2cc71e7c6856e2ac0;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/undostack.C b/cinelerra-5.1/cinelerra/undostack.C index acc6544f..de738b84 100644 --- a/cinelerra-5.1/cinelerra/undostack.C +++ b/cinelerra-5.1/cinelerra/undostack.C @@ -35,6 +35,23 @@ UndoStack::~UndoStack() { } +UndoStackItem *UndoStack::get_current_undo() +{ + UndoStackItem *item = current; + if( item && !(number_of(item) % 2) ) item = item->previous; + if( item && (number_of(item) % 2) ) item = item->previous; + return item; +} + +UndoStackItem *UndoStack::get_current_redo() +{ + UndoStackItem *item = current ? current : first; + if( item && (number_of(item) % 2) ) item = item->next; + if( item && !(number_of(item) % 2) ) item = item->next; + return item; +} + + UndoStackItem* UndoStack::push() { // current is only 0 if before first undo @@ -76,11 +93,6 @@ UndoStackItem* UndoStack::push() return current; } -void UndoStack::pull() -{ - if(current) current = PREVIOUS; -} - UndoStackItem* UndoStack::pull_next() { // use first entry if none