{
}
+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
return current;
}
-void UndoStack::pull()
-{
- if(current) current = PREVIOUS;
-}
-
UndoStackItem* UndoStack::pull_next()
{
// use first entry if none
new_size,
&this->data_size,
0);
-//printf("UndoStackItem::set_data 2 " _LD "\n", timer.get_difference());
+//printf("UndoStackItem::set_data 2 %jd\n", timer.get_difference());
// Testing
// FILE *test1 = fopen("/tmp/undo1", "w");