Page 1 of 1

Compare if two TRichViews have identical content

Posted: Sat Nov 15, 2014 6:11 pm
by PioPio
As per the subject: how can I check if two TRichview have identical content ?
I am not referring to the text only but all the information (font sizes and attributes, paragraphs, alignments and so on)

Many thanks
Pio Pio

Posted: Sat Nov 15, 2014 9:52 pm
by Sergey Tkachenko
You can save the both documents to TMemoryStream and then compare Stream.Memory (check Stream.Size-s, if equal, use CompareMem).
But this check returns True when all documents are absolutely identical.
It returns False if attributes of text or paragraphs are the same, but indexes in collections of TextStyles or ListStyles are different.