Fastest way to clone data of one RVE to another?

General TRichView support forum. Please post your questions here
Post Reply
blsstdok
Posts: 25
Joined: Tue Jun 07, 2011 2:36 pm

Fastest way to clone data of one RVE to another?

Post by blsstdok »

I have two richviewedits. I want to clone the content of one to the other, including styles, etc, but do not want them to *share* anything (no common pointers/classes/etc).

What is the fastest way to do this, ideally avoiding any formatting?
blsstdok
Posts: 25
Joined: Tue Jun 07, 2011 2:36 pm

Re: Fastest way to clone data of one RVE to another?

Post by blsstdok »

blsstdok wrote:What is the fastest way to do this, ideally avoiding any formatting?
I should add that the two controls will have the same sizes, so formatting shouldn't be necessary when the data is cloned.
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can copy a document, but you cannot copy formatting (we are considering to implement saving and loading of formatting info, but in the current version it is not implemented). So, after copying, you'll need to format the target RichView. And it will be the slowest part.

As for copying, it is SaveRVFToStream and LoadRVFFromStream. This is the only method for copying all the content.
If your documents are simple (contain only text and images), you can use AppendFrom.
Post Reply