Opened 13 years ago

Last modified 4 years ago

#8106 assigned bug

BTextView::CountLines() ignores last line if it's empty

Reported by: bigmike Owned by: nobody
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Method CountLines() doesn't count the last line in a BTextView if it is empty and it is not the first line. I. e. if there is some text and the last character is a linebreak then CountLines() returns a result that is one too small.

I am not entirely sure, if this is intended behavior, but I guess not.

Change History (4)

comment:1 by axeld, 13 years ago

That's also apparent when using Mail (or rather it was, I might have changed that in the mean time), so in any case, it's different from the BeOS implementation. The only reason I could imagine it is done like this is because of alerts, as the last newline doesn't really make any difference to have (for the layout). But I guess CountLines() should not be used there then, and be changed instead.

comment:2 by axeld, 8 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:3 by pulkomandy, 4 years ago

This is still visible in hrev54473 in StyledEdit in the document->stats menu

comment:4 by pulkomandy, 4 years ago

Summary: BTextView::CountLines() returns wrong resultBTextView::CountLines() ignores last line if it's empty
Note: See TracTickets for help on using tickets.