line break in cell

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

line break in cell

Post by rellik »

Hi! I need paste text into cell of table.

I use table1.cell[0, 0].addNL(s);

but if s = 'перенос '+#10#13+'строки'; SrichViewEdit ignore it and paste into cell 'перенос строки'
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

To add multiline text, use AddTextNL:

Code: Select all

table.Cells[0,0].AddTextNL('line1'#10#13'line2', 0, 0, 0);
rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

Post by rellik »

Thanks, I can see, how many lines in the text of the cell?
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I assume that "lines" means "paragraphs" (including line breaks inside paragraphs)

Code: Select all

function GetParaCount(RVData: TCustomRVData): Integer;
var i: Integer;
begin
  Result := 0;
  for I := 0 to RVData.ItemCount - 1 do
    if RVData.IsFromNewLine(I) then
      inc(Result);
end;

Call:
ParaCount := GetParaCount(table.Cells[0,0].GetRVData);
Post Reply