Page 1 of 1

TCustomRichViewEdit.SelectCurrentLine

Posted: Thu Feb 20, 2020 9:37 pm
by jgkoehn
I'm using SelectCurrentLine to copy out some text from a RVF document.
However, if that line has different formatting like Regular font and then italics it only selects up until that change in formatting.
Is this an expected behavior? Is there a way to change this. In this application the format could be different on a per character basis.

Do I need to change anything in RichViewEdit to fix this? Thank you.

This is quite easy to test write a line of text with various formattings in RVF then call SelectCurrentLine and then update/refresh the RVF and you should be able to see this.

Re: TCustomRichViewEdit.SelectCurrentLine

Posted: Fri Feb 21, 2020 10:49 am
by Sergey Tkachenko
Please give me step-by-step instructions how to reproduce this problem.

I tried to call RichViewEdit1.SelectCurrentLine in the ActionTest project. It selected the whole line, including bold and italic words.

Re: TCustomRichViewEdit.SelectCurrentLine

Posted: Fri Feb 21, 2020 2:06 pm
by jgkoehn
To work around it I had to turn word wrap off reformat and then it works. Maybe try a different font and or color. I was trying several things. Im working with a .docs converted to rtf then loaded into Trichview. (So one of these steps could mess something up or maybe a setting) Sorry I cant share the document it is copyrighted.

Re: TCustomRichViewEdit.SelectCurrentLine

Posted: Fri Feb 21, 2020 2:25 pm
by Sergey Tkachenko
Maybe you can reproduce it in a small document, with only several lines of non-copyrighted text?
Because in my tests everything works as expected.

Re: TCustomRichViewEdit.SelectCurrentLine

Posted: Sat Feb 22, 2020 8:28 pm
by jgkoehn
It is odd, My guess is the document has bad rtf somehow.
I tried just editing down the document to a problem portion. First using WordPad, then MS Word and then RVF Demo App. But this fixes it. As best I could tell maybe some bad bookmark, or footnote links that were leftover in the RTF code.


I did find a work around via turning off WordWrap then Format when I needed to grab just that portion for converting to another format.

Thanks for the help.