procedure SetItemText(aRV: TCustomRVData; aItemNo: Integer; const aText: WideString);
begin
if aRV.GetItemTextW(aItemNo) <> aText then begin
aRV.SetItemTextW(aItemNo, aText);
aRV.GetItem(aItemNo).StyleNo := RVSTYLE_MODIFIED;
end;
end;
I can pass both RVE.RVData and RV.RVData to this method. The problem is, these actions don't show in the undo list for RVE. Do I need to delete the item and reinsert it with new text & style to make undo list pick it up?
If so, is there some way to use the same code for both TRichViewEdit and TRichView? I use both components in my application and I'd like to be able to pass their RVData to the same SetItemText method.
Yes, direct assignment to StyleNo cannot be undone.
Currently, the only way to change item style as an editing operation is selecting it and applying text style:
First, initiate editing of this RVData (it is important if your document has tables):