Page 1 of 1

Copy text with list markers

Posted: Thu Aug 01, 2019 6:14 pm
by LadyOfWood
I have a text with following structure:
<text item0>
<list marker1 (rvsListMarker)><text item2>
<list marker3 (rvsListMarker)><text item4>
<list marker5 (rvsListMarker)><text item6>

to copy a text item i used a following code, set selection (before item 2 (1 - for text item) and before item 3 (0 - for non-text).

Code: Select all

rve.SetSelectionBounds(2, 1, 3, 0);
rve.SaveRVFToStream(save_stream, true);
rve.Deselect;
But list markers (1 and 3) in this case is saved to rvf. I do not need them. What am i doing wrong?

Re: Copy text with list markers

Posted: Fri Aug 02, 2019 6:40 am
by Sergey Tkachenko
TRichView needs to decide somehow, when to copy list markers.

In MS Word, list markers are copied when end-of-paragraph mark is selected (not an ideal intuitive solution too, because a list marker and an end-of-paragraph mark are at the opposite sides of paragraphs).
TRichView does not have selectable end-of-paragraph marks, so it needs another rule. It is simple: markers are copied if the beginning of paragraph (not necessary counting the marker itself) is included in the selection.

Maybe a better logic is possible, but I do not know it.

Re: Copy text with list markers

Posted: Fri Aug 02, 2019 6:49 pm
by LadyOfWood
Is any way to select items without list markers? Or save needed part of document to stream?

Re: Copy text with list markers

Posted: Sat Aug 03, 2019 4:11 pm
by Sergey Tkachenko
Markers are added automatically, if the beginning of this paragraph is included in the selection.
Sorry, there is no way to not-save it.
The only way is copying the selection to a temporary invisible TRichView, remove the markers, and then copy.

Re: Copy text with list markers

Posted: Thu Aug 08, 2019 4:22 pm
by LadyOfWood
I used another solution, replace a list markers by a text items.