<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi everyone,<br>
</p>
<p><br>
</p>
<p>I have just started&nbsp;investigating a bug with the PluggableTextMorphPlus where a TextStyle affecting a complete Text remained valid after setting a String instead. During debugging I have encountered the following code in TextMorph&gt;&gt;#newContents:<br>
</p>
<p><br>
</p>
<div>(text notNil&nbsp;<span style="font-size: 12pt;">and: [ (textSize := text size) &gt; 0] and:</span><span style="font-size: 12pt;">&nbsp;[ (text runLengthFor: 1) = textSize ])&nbsp;</span></div>
<div><span style="font-size: 12pt;">&nbsp;&nbsp;&nbsp;&nbsp;ifTrue: [ | attribs |</span></div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>attribs := text attributesAt: 1 forStyle: textStyle.</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Text string: stringOrText copy attributes: attribs.<span style="font-size: 12pt;">]</span></div>
<div>&nbsp; &nbsp;&nbsp;ifFalse: [ Text fromString: stringOrText copy ]<br>
</div>
<div><br>
</div>
<div>What it does is that if the previous style applied to all of the Text, then the new Text also gets this style applied. Why is that? That seems pretty weird to me to only handle this one special case. Does anyone know the rational behind that?<br>
</div>
<div><br>
</div>
<div>Thanks and bests<br>
</div>
<p>Patrick<br>
</p>
</body>
</html>