How to determine the Table. cells [0, 0] is empty?

General TRichView support forum. Please post your questions here
Post Reply
aayaay
Posts: 8
Joined: Sat Jun 11, 2016 3:05 am

How to determine the Table. cells [0, 0] is empty?

Post by aayaay »

How to determine the Table. cells [0, 0] is empty?(cells [0, 0] is the RTF format)

thank you.
Sergey Tkachenko
Site Admin
Posts: 17267
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Normally, empty cells have a single empty text items.

Code: Select all

function IsEmpyCell(Cell: TRVTableCellData): Boolean;
var RVData: TCustomRVData;
begin
  RVData := Cell.GetRVData;
  Result := (RVData.ItemCount = 0) or
    ((RVData.ItemCount = 1) and (RVData.GetItemStyle(0) >= 0) and
    (RVData.GetItemText(0)=''));
end;
aayaay
Posts: 8
Joined: Sat Jun 11, 2016 3:05 am

Post by aayaay »

The data in cells[0,0] is the way it is.

table.Cells[0,0].InsertRVFFromStream(Stream , 0, Dummy1 ,dummy2,dummy3 ,False, nil,nil);

IsEmpyCell Return incorrect¡£
Sergey Tkachenko
Site Admin
Posts: 17267
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Are you sure that the cell is not being edited at the moment of insertion?
Try
table.Cells[0,0].GetRVData.InsertRVFFromStream(...)
aayaay
Posts: 8
Joined: Sat Jun 11, 2016 3:05 am

Post by aayaay »

I'm sorry, I was wrong.

rveMain.LoadRTF(111.rtf)

111.rtf -- this file contains a table.
Sergey Tkachenko
Site Admin
Posts: 17267
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send this RTF to me, richviewgmailcom
Sergey Tkachenko
Site Admin
Posts: 17267
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I received your email.
Your RTF file does not have empty cells.
Any cell contain something, for example space characters.
You can see them, if you click in "Show non-printing characters" in MS Word or in our ActionTest project.
aayaay
Posts: 8
Joined: Sat Jun 11, 2016 3:05 am

Post by aayaay »

I see. Thank you.
Post Reply