Fixing a crash when font face and style were nil when selecting font jv
authorPatrik Svestka <patrik.svestka@gmail.com>
Wed, 08 Jun 2022 10:30:56 +0200
branchjv
changeset 6855 ca73e0f717dc
parent 6854 1f5ae7573af6
child 6856 98caa7f380f7
Fixing a crash when font face and style were nil when selecting font This usually happens with the default settings.stx file.
FontPanel.st
--- a/FontPanel.st	Mon Nov 15 20:13:51 2021 +0000
+++ b/FontPanel.st	Wed Jun 08 10:30:56 2022 +0200
@@ -1,6 +1,7 @@
 "
  COPYRIGHT (c) 1991 by Claus Gittinger
  COPYRIGHT (c) 2016 Jan Vrany
+ COPYRIGHT (c) 2022 Patrik Svestka
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -36,6 +37,7 @@
 "
  COPYRIGHT (c) 1991 by Claus Gittinger
  COPYRIGHT (c) 2016 Jan Vrany
+ COPYRIGHT (c) 2022 Patrik Svestka
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -565,8 +567,8 @@
 
     initialFont := selectedFont := aFont.
     currentFamily := aFont family.
-    currentFace := aFont face.
-    currentStyle := aFont style.
+    currentFace := aFont face ? Font defaultFace.
+    currentStyle := aFont style ? Font defaultStyle.
     currentFaceAndStyle := currentFace,'-',currentStyle.
 
 "/    self xftFontsOnlyHolder value:(aFont isXftFont).
@@ -584,7 +586,8 @@
     "/    self encodingFilterSelected:fontEncoding.
     self showSelectedFont.
 
-    "Modified: 23.2.1996 / 00:51:32 / cg"
+    "Modified: / 23-02-1996 / 00:51:32 / cg"
+    "Modified: / 08-06-2022 / 10:04:05 / Patrik Svestka <patrik.svestka@gmail.com>"
 !
 
 monospacedOnlyHolder
@@ -1902,5 +1905,10 @@
 
 version_CVS
     ^ '$Header$'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !