Page 1 of 1

How to convert list markers to plain text

Posted: Sat Oct 14, 2017 3:48 pm
by saeid2016
Hello,

I want to save text of RichViewEdit1 to DB as plain text. if I use the following code, The list markers does not save.

Code: Select all

RichViewEdit1.SelectAll;
RichViewEdit1.GetSelText;
if I use SaveTextToStream, all non text items such as footnotes , ... are saved.

How I save the list markers with main text as plain text?

Is it possible to convert list markers to text item?

Re: How to convert list markers to plain text

Posted: Sun Oct 15, 2017 8:03 pm
by saeid2016

Re: How to convert list markers to plain text

Posted: Mon Oct 16, 2017 3:01 pm
by Sergey Tkachenko
I am glad you solved the problem.

Please note that GetSelText calls SaveTextToStream inside, with the parameter TextOnly. With this parameter, a text representations of non-text items are not saved (except for tables and items inherited from label-item, such as footnotes and endnotes).
If you need a text representation of all items, use SaveTextToStream instead of GetSelText.

Re: How to convert list markers to plain text

Posted: Tue Oct 17, 2017 9:37 am
by saeid2016
Sergey Tkachenko wrote: Mon Oct 16, 2017 3:01 pm If you need a text representation of all items, use SaveTextToStream instead of GetSelText.
Now, with TextOnly parameter, a text representation of all non text items will be saved or not. I suggest you add a parameter to SaveTextToStream to choose what non text items we want t save their text representation.

Re: How to convert list markers to plain text

Posted: Tue Oct 17, 2017 10:13 am
by Sergey Tkachenko
You can suppress saving certain items using OnSaveItemToFile event.
Check for SaveFormat = rvsfText, assign OutStr := '' and DoDefault := False.