Number of actual lines

General TRichView support forum. Please post your questions here
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, after assigning Cell.BestWidth, widths of columns are not changed, and the problem is in line wrapping algorithm. It ignores space characters only when they are in the middle of text. But a space character at the end of a paragraph is counted as a non-space character; so, as you can see, when the last word+space cannot be placed on the line, it is moved to the next line.
Changing this behavior will lead to more serious problems, so I do not plan to do it.

I can suggest to remove this space at all.
Add this code before RVE.DeleteSelection:

Code: Select all

   if (RVData1.GetItemStyle(FirstItemNo)>=0) and (Offs>1) and
      (RVData1.GetItemText(FirstItemNo)[Offs-1]=' ') then
     RVData1.SetSelectionBounds(FirstItemNo, Offs-1,
       RVData1.ItemCount-1, RVData1.GetOffsAfterItem(RVData1.ItemCount-1));
jwinkl
Posts: 25
Joined: Thu Nov 09, 2006 10:09 am

Post by jwinkl »

This works perfect. Many thanks and great respect for dealing with the problem so quickly and efficiently.

Johann
Post Reply