UndoSupport.st
changeset 1588 7a69b6a027b0
parent 1550 7710a4b44cc9
child 1932 7bafb4c076d3
equal deleted inserted replaced
1587:6d56f7fb6a1a 1588:7a69b6a027b0
   132     infoOfCurrentTransaction := nil.
   132     infoOfCurrentTransaction := nil.
   133     transaction := nil
   133     transaction := nil
   134 !
   134 !
   135 
   135 
   136 executeActionFrom:doList addUndoTo:unDoList
   136 executeActionFrom:doList addUndoTo:unDoList
   137     |action trans|
   137     |action previousTransaction|
   138 
   138 
   139     doList notEmptyOrNil ifTrue:[
   139     doList notEmptyOrNil ifTrue:[
   140         action := doList removeLast.
   140         action := doList removeLast.
   141 
   141 
   142         trans := transaction.
   142         previousTransaction := transaction.
   143         transaction := OrderedCollection new.
   143         [
   144 
   144             transaction := OrderedCollection new.
   145         action executeIn:actionPerformer.
   145 
   146 
   146             action executeIn:actionPerformer.
   147         self closeTransactionAndAddTo:unDoList.
   147 
   148 
   148             self closeTransactionAndAddTo:unDoList.
   149         transaction := trans.
   149         ] ensure:[
       
   150             transaction := previousTransaction.
       
   151         ]
   150     ]
   152     ]
   151 !
   153 !
   152 
   154 
   153 hasRedoAction
   155 hasRedoAction
   154     ^ redoList size > 0
   156     ^ redoList size > 0
   243 ! !
   245 ! !
   244 
   246 
   245 !UndoSupport class methodsFor:'documentation'!
   247 !UndoSupport class methodsFor:'documentation'!
   246 
   248 
   247 version
   249 version
   248     ^ '$Header: /cvs/stx/stx/libbasic2/UndoSupport.st,v 1.7 2005-04-19 10:01:30 cg Exp $'
   250     ^ '$Header: /cvs/stx/stx/libbasic2/UndoSupport.st,v 1.8 2006-01-25 10:39:26 cg Exp $'
   249 ! !
   251 ! !