Page 1 of 1

Obtaining table if table is changed

Posted: Wed Nov 14, 2012 10:45 am
by dschensky
Hi!

We try to implement a simple change tracking feature with TRichView by adding a red border to any modified paragraph.
We are using the OnItemAction event, but we have problems to obtain the table item if rows/columns are deleted.
What is the best way to obtain the table item in OnItemAction, if columns/rows are deleted?
Or maybe there is a better approach to implement a simple change tracking feature?

(our TRichView version is 12.6.1)

Hope you can help,
Jan

Posted: Thu Nov 15, 2012 7:14 pm
by Sergey Tkachenko
When a table row/column is deleted, this event is called with the ItemAction=rviaMovingToUndoList for all items in the deleted cells.

The item has RVData parameter.
If RVData.GetSourceRVData is TRVTableCellRVData, this item is in a cell. And you can get the table as (RVData.GetSourceRVData as TRVTableCellRVData).GetTable.

However, you cannot know the reason why this item is deleted. May be a cell/row is deleted, but may be this item is deleted because the user deleted a selection.

Posted: Fri Nov 16, 2012 10:55 am
by dschensky
Thanks alot!
Jan