--- a/Text.st Tue Jul 12 16:00:15 2011 +0200
+++ b/Text.st Wed Jul 20 20:00:08 2011 +0200
@@ -1573,6 +1573,43 @@
"Modified: 14.5.1996 / 15:51:01 / cg"
!
+hasEmphasis: emphasis
+ "return true, if the receiver contains given emphasis"
+
+ "HACK!!!!!!"
+
+ | emphasisArray |
+ (emphasis isSymbol or:[emphasis isAssociation]) ifTrue:[
+ emphasisArray := Array with: emphasis
+ ] ifFalse:[
+ emphasisArray := emphasis.
+ ].
+
+
+ runs do:[:runEmph|
+ emphasisArray allSatisfy:[:searchEmph|
+ (runEmph = searchEmph or:
+ [runEmph isCollection
+ and:[runEmph isSymbol not
+ and:[runEmph includes: searchEmph]]]) ifTrue:[
+ ^true
+ ]
+ ]
+
+ ].
+
+ ^false
+
+ "
+ 'Hello' asText allBold hasEmphasis: #bold.
+ 'Hello' asText allBold allUnderlined hasEmphasis: #bold.
+ 'Hello' asText allBold allUnderlined hasEmphasis: #italic.
+ ('Hello' asText allBold allUnderlined , ' World' asText allItalic) hasEmphasis: #italic.
+ "
+
+ "Created: / 20-07-2011 / 17:51:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
heightOn:aGC
"return the number of device units, required on aGC's device"
@@ -1745,11 +1782,11 @@
!Text class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Text.st,v 1.108 2011-04-01 14:19:28 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Text.st,v 1.109 2011-07-20 18:00:08 vrany Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic2/Text.st,v 1.108 2011-04-01 14:19:28 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Text.st,v 1.109 2011-07-20 18:00:08 vrany Exp $'
! !
Text initialize!