#BUGFIX by Stefan Reise
authorsr
Tue, 11 Jun 2019 11:47:16 +0200
changeset 6604 89a0c07bbba9
parent 6603 1f084ea9212d
child 6605 0ce71c8c8ca2
#BUGFIX by Stefan Reise fixed recursion when calling #showSelectedFont #updateFamilyList class: FontPanel added: #updateFamilyListAndDoShowSelectedFont: changed: #showSelectedFont #updateFamilyList
FontPanel.st
--- a/FontPanel.st	Tue Jun 11 03:28:22 2019 +0000
+++ b/FontPanel.st	Tue Jun 11 11:47:16 2019 +0200
@@ -1322,7 +1322,11 @@
     currentEncoding := font encoding.
 
     fontsPerFamily isNil ifTrue:[
-        self updateFamilyList
+        "sr: no comment why changed from #getFamilyList to #updateFamilyList
+         problem: #updateFamilyList will not set #fontsPerFamily and calls 
+         myself #showSelectedFont again -> recursion -> stx crash"
+        self updateFamilyListAndDoShowSelectedFont:false.
+"/        self updateFamilyList.
         "/ self getFamilyList
     ].
 
@@ -1341,11 +1345,23 @@
     ].
 
     self showPreview
+
+    "Modified: / 11-06-2019 / 11:44:55 / Stefan Reise"
 !
 
 updateFamilyList 
+    self updateFamilyListAndDoShowSelectedFont:true.
+
+    "Created: / 27-02-1996 / 01:40:37 / cg"
+    "Modified: / 11-06-2019 / 11:45:12 / Stefan Reise"
+!
+
+updateFamilyListAndDoShowSelectedFont:doShowSelectedFont
     "update the list of font families"
 
+    "sr: use #doShowSelectedFont with false 
+     to avoid recursion when called by #updateFamilyList"
+
     |families|
 
     familyList list isNil ifTrue:[
@@ -1355,12 +1371,12 @@
         ].
         familyList list:families
     ].
-    selectedFont notNil ifTrue:[
+    (selectedFont notNil
+    and:[doShowSelectedFont ? true]) ifTrue:[
         self showSelectedFont
     ].
 
-    "Modified: 27.2.1996 / 01:39:42 / cg"
-    "Created: 27.2.1996 / 01:40:37 / cg"
+    "Created: / 11-06-2019 / 11:44:32 / Stefan Reise"
 !
 
 updateSizeList