Hi there,
I'm trying to implement a crude undo system for operations which cannot be undone through the normal Undo functionality (for instance, after using functions like those described here: http://www.trichview.com/forums/viewtop ... =6701#6701
Basically, what I want to do is stream out the contents of a TRichViewEdit into a memory stream, then allow it to be streamed back if necessary. However, when I try to stream the data back into the memory stream, I get multiple instances of this:
EStringListError with message "List index out of bounds (-1)"
Here's the basic code. FBackupMemStream is a TMemoryStream created and destroyed by the TMarkRichView object in its constructor and destructor. RVE is a TRichViewEdit control.
procedure TMarkRichView.StashBackupStream;
begin
FBackupMemStream.Clear;
RVE.SaveRVFToStream(FBackupMemStream, False);
end;
procedure TMarkRichView.RestoreFromBackupStream;
begin
if FBackupMemStream.Size < 1 then
Exit;
RVE.Clear;
RVE.DeleteUnusedStyles(True, True, True);
RVE.Format;
FBackupMemStream.Position := 0;
RVE.LoadRVFFromStream(FBackupMemStream);
end;
In my test code, I call these two functions one after the other:
MRV.StashBackupStream;
//Do something...
MRV.RestoreFromBackupStream;
Can anyone see what might be causing the problem here?
All help appreciated,
Martin
Errors when saving and loading RVF from stream
-
- Posts: 131
- Joined: Mon Aug 29, 2005 12:03 pm
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 131
- Joined: Mon Aug 29, 2005 12:03 pm