I just submitted the following bug report and wanted to post it here as well to 
see if anyone had a recommended workaround.

NSLayoutManager layoutManager:didCompleteLayoutForTextContainer:atEnd callback 
is never called with atEnd flag set to YES if last character of text is 
NSFormFeedCharacter.

Summary:
The NSLayoutManager callback 
layoutManager:didCompleteLayoutForTextContainer:atEnd: is called as layout is 
completed for each text container in a multipage view. The atEnd flag is set to 
YES when the last text container is layed out. This method is never called with 
the atEnd flag set to YES if the last character in the text is the page break 
(NSFormFeedCharacter) control character.

This is verifiable on Mac OS 10.6.7 through testing with TextEdit source code 
that is included in the Xcode distro.

Steps to Reproduce:
Create a multipage text document in TextEdit with text wrapping enabled. Add a 
page break as the last character in the document and save the document. Next 
time the document is opened, the layout manager callback never occurs with the 
atEnd flag set to YES.

Expected Results:
When the last container is layed out, the atEnd flag should be set to YES.

Actual Results:
The didCompleteLayoutForTextContainer is correctly called a number of times for 
each text container with the atEnd flag set to NO, but it is never finally 
called with the atEnd flag set to YES for the last text container.

~

I'm hoping someone might have some insight into this or a possible workaround. 
I have some code that depends on a correct count of the number of layed out 
pages and that count is determined when layout is completed, as indicated by 
the atEnd flag set to YES.

~Phil_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to