Text.st
changeset 339 4d1140308a76
parent 336 5fd5fcc38eaa
child 343 01f88d90c385
--- a/Text.st	Tue May 14 18:19:31 1996 +0200
+++ b/Text.st	Tue May 14 18:20:07 1996 +0200
@@ -276,6 +276,36 @@
     "Modified: 14.5.1996 / 17:15:44 / cg"
 !
 
+emphasis:e1 includes:e2
+    "return true, if e1 includes e2.
+     e2 should be a single emphasis."
+
+    |ne|
+
+    e1 isNil ifTrue:[^ false].
+    e2 isNil ifTrue:[^ false].
+    e1 == e2 ifTrue:[^ true].
+
+    (e1 isSymbol 
+     or:[e1 isAssociation]) ifTrue:[
+        ^ false
+    ].
+    (e2 isSymbol 
+     or:[e2 isAssociation]) ifTrue:[
+        ^ (e1 includes:e2)
+    ].
+    ^ false
+
+    "
+     Text emphasis:#bold includes:#bold           
+     Text emphasis:#bold includes:#ialic         
+     Text emphasis:#(italic strikeout) includes:#bold  
+     Text emphasis:#(italic strikeout) includes:#italic 
+    "
+
+    "Modified: 14.5.1996 / 17:45:11 / cg"
+!
+
 removeEmphasis:e1 from:e2
     "remove an emphasis; if it was not in e1, do nothing"
 
@@ -891,6 +921,6 @@
 !Text class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Text.st,v 1.11 1996-05-14 15:26:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Text.st,v 1.12 1996-05-14 16:20:07 cg Exp $'
 ! !
 Text initialize!