#BUGFIX by sr
authorsr
Thu, 03 May 2018 11:40:20 +0200
changeset 5761 eaacf63f0cb3
parent 5760 d689b29b69cc
child 5762 13f699b3e47c
#BUGFIX by sr bugfix class: NoteBookView changed: #makeToBaseLine:
NoteBookView.st
--- a/NoteBookView.st	Wed May 02 21:06:41 2018 +0200
+++ b/NoteBookView.st	Thu May 03 11:40:20 2018 +0200
@@ -2720,16 +2720,26 @@
     "rotate lines to make the line #aLnNr be the new base line (i.e.
      subtract (aLnNr-1) from all lines and take modulu the number of lines"
 
-    |lineTopsOrLefts isHorizontal|
+    |listLocal lineTopsOrLefts isHorizontal|
 
     isHorizontal := self isHorizontal.
 
+    "sr: keep the list as a local copy,
+     because list is an instance variable,
+     which can be changed during the processing of this method.
+     which did happend to me.
+     calling #at: with an index fetched by #findFirst: 
+     will fail, if the list has been modified in the meanwhile"
+    listLocal := list copy.     
+
     "collect per-lineNr offsets"
     lineTopsOrLefts := (1 to:self numberOfLines) collect:[:lnr |
                             |tabNr layout|
 
-                            tabNr := list findFirst:[:aTab| aTab lineNr == lnr].
-                            layout := (list at:tabNr) unselectedLayout.
+                            "sr: calling #at: with an index fetched by #findFirst: 
+                             will fail, if the list has been modified in the meanwhile"
+                            tabNr := listLocal findFirst:[:aTab| aTab lineNr == lnr].
+                            layout := (listLocal at:tabNr) unselectedLayout.
                             isHorizontal ifTrue:[
                                 layout top.
                             ] ifFalse:[
@@ -2738,7 +2748,7 @@
                        ].
 
     "change offsets of all tabs"
-    list do:[:el |
+    listLocal do:[:el |
         |layout topOrLeft nr newNr|
 
         nr := el lineNr.
@@ -2761,6 +2771,8 @@
     ].
 
     self invalidate.
+
+    "Modified: / 03-05-2018 / 11:40:04 / sr"
 !
 
 recomputeList