Comment #20 on issue 3088 by
[hidden email]: MNU
Text>>withBlanksTrimmed
http://code.google.com/p/pharo/issues/detail?id=3088The problem is not that references with "stringVersion" being a Text are
created.
The *read* problem is in MethodReference>>#asStringOrText:
asStringOrText
| text |
self actualClass ifNil: [ ^stringVersion ].
text := Text fromString: self stringVersion,' {',self category
asString,'} '.
self isLocalSelector ifFalse: [ text addAttribute: TextEmphasis italic ].
^ text
#fromString: does not check if it gets a string or a text, leading to a
broken Text instance.
In addtion, the text looses the formatting (in the protocol browser, it
uses a text to make
some prints BOLD).
So the change is this:
asStringOrText
| text |
self actualClass ifNil: [ ^stringVersion ].
text := (self stringVersion,' {',self category asString,'} ') asText.
self isLocalSelector ifFalse: [ text addAttribute: TextEmphasis italic ].
^ text
because #asText just keeps a text being a text and converts a string to a
text... the nice thing is
that this fixes not only the DNU but enables bold printing of the local
methods in the protocolbrowser again,
too.
Fix attached.
Attachments:
MethodReference-asStringOrText.st 403 bytes
_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker