*** layout manager 132840 failed to progress beyond index 70 while drawing glyphs -- why?
*** layout manager 132840 failed to progress beyond index 70 while drawing glyphs -- why?
- Subject: *** layout manager 132840 failed to progress beyond index 70 while drawing glyphs -- why?
- From: Mark Alldritt <email@hidden>
- Date: Thu, 03 Feb 2005 15:53:47 -0800
Hi Folks,
As a follow up to a previous post I made about NSTextView exceptions, I'm
still experiencing the error shown in the message subject:
*** layout manager 132840 failed to progress beyond index 70 while drawing
glyphs.
Note that this exception is being generated *after* my code has completed
and NSTextView is rendering the text changes.
I've managed to reduce my test case to the following Objective-C++ code.
The second time I invoke doTest:, I experience the exception and NSTextView
stops rendering text correctly until I do a Select All. After than all is
fine until I run doTest: again.
#include <string>
#include <sstream>
#import <Carbon/Carbon.h>
#import "MyController.h"
typedef UniChar TCLChar; // Carbon's notion of a UTF-16 character
typedef std::basic_string<TCLChar, std::char_traits<TCLChar>,
std::allocator<TCLChar> > TCLString;
typedef std::basic_ostringstream<TCLChar, std::char_traits<TCLChar>,
std::allocator<TCLChar> > TCLostringstream;
@implementation MyController
- (void) replaceCharactersInRange:(NSRange) range withString:(NSString*)
string
{
[[mTextView textStorage] replaceCharactersInRange:range
withString:string];
}
- (IBAction) doTest:(id) sender
{
NSLog(@"doTest");
// This code fails
//
// The following appears in the console the second time doTest: runs:
//
// 2005-02-03 14:01:13.014 SimpleHello Debug[28951] *** layout
manager 132840 failed to progress beyond index 70 while drawing glyphs.
//
// Once this is logged, text display is hosed until I do a select all
TCLostringstream os;
NSRange selectionRange;
os << "tell application \"" << "MyAppName" << "\"" << std::endl;
os << std::endl;
os << "\t";
selectionRange.location = os.str().length() + [mTextView
selectedRange].location;
os << "-- your code here";
selectionRange.length = os.str().length() - selectionRange.location;
os << std::endl;
os << std::endl;
os << "end tell";
NSString* s = [NSString stringWithCharacters:os.str().data()
length:os.str().length()];
NSLog(s); // logged characters look okay
[self replaceCharactersInRange:[mTextView selectedRange] withString:s];
[mTextView setSelectedRange:selectionRange];
}
@end
I'm sure its probably some painfully obvious error on my part, but I cannot
see it. Anyone have any ideas?
As an aside, this is being compiled with CodeWarrior 9.4 using the MSL C++
libraries and Panther's BSD and Cocoa libraries. I've tried to reproduce
this in Xcode, but the gcc C++ libraries won't handle the ASCII to UTF-16
conversion taking place in the TCLostringstream specialization of
std::basic_ostringstream.
Cheers
-Mark
------------------------------------------------------------------------
Mark Alldritt Late Night Software Ltd.
Phone: 250-380-1725 Script Debugger 3.0 - AppleScript IDE
WEB: http://www.latenightsw.com/ Affrus 1.0 - Perl Debugging
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden