bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix: NSTextView.m, -setSelectedRange:...


From: Georg Fleischmann
Subject: Re: Fix: NSTextView.m, -setSelectedRange:...
Date: Wed, 15 Aug 2001 21:54:45 +0200

Hi Nicola,

> thanks for the bug report - I tried your patches but they didn't look
> like making any difference to me with regards to this problem ... and
> to me it looked like a bug in replaceCharactersInRange: etc so I fixed
> that one.  Let me know if you have problems with the fix applied to
> CVS, it works for me.

Your fix does it right.
However, the first part of my patch is still needed. It prevents [NSTextView  
setSelectedRange...] from asking a text storage of zero length for attributes.
In this case, the text storage will always return an empty dictionary, thus  
setting the attributes of the text view to zero.
On OpenStep, asking a zero text storage for attributes would raise an exception.
Here is the shortened patch:


--- gui/Source/NSTextView.m.orig        Tue Aug 14 04:30:39 2001
+++ gui/Source/NSTextView.m     Wed Aug 15 21:35:03 2001
@@ -1358,7 +1358,7 @@
        }
       else  /* no selection, only insertion point */
        {
-         if (_tf.is_rich_text)
+         if (_tf.is_rich_text && [_textStorage length])
            {
              NSDictionary *dict;
        



reply via email to

[Prev in Thread] Current Thread [Next in Thread]