raise an error, if trying to get a font from a disconnected
authorClaus Gittinger <cg@exept.de>
Mon, 14 Apr 1997 18:25:56 +0200
changeset 1596 579d2c28f824
parent 1595 af720ba3d32c
child 1597 019f40ecbe64
raise an error, if trying to get a font from a disconnected display device.
Font.st
--- a/Font.st	Mon Apr 14 17:25:24 1997 +0200
+++ b/Font.st	Mon Apr 14 18:25:56 1997 +0200
@@ -407,6 +407,13 @@
     newFont isNil ifTrue:[
         "oops did not work - (device has no such font)"
 
+        aDevice isOpen ifFalse:[
+            "/ the display device is not connected
+            "/ (or has a broken connection).
+            self error:'trying to get font from closed display'.
+            ^ self.
+        ].
+
         rep := self replacementFontOn:aDevice.
         device isNil ifTrue:[
             device := aDevice.
@@ -428,7 +435,7 @@
      Font family:'foo' size:17
     "
 
-    "Modified: 5.7.1996 / 17:56:13 / cg"
+    "Modified: 14.4.1997 / 18:22:31 / cg"
 !
 
 on:aDevice ifAbsent:exceptionBlock 
@@ -1091,6 +1098,6 @@
 !Font class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.59 1997-02-25 16:42:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.60 1997-04-14 16:25:56 cg Exp $'
 ! !
 Font initialize!