TCustomRichViewEdit.SelectCurrentLine

General TRichView support forum. Please post your questions here
Post Reply
jgkoehn
Posts: 288
Joined: Thu Feb 20, 2020 9:32 pm

TCustomRichViewEdit.SelectCurrentLine

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TCustomRichViewEdit.SelectCurrentLine

Post 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.
jgkoehn
Posts: 288
Joined: Thu Feb 20, 2020 9:32 pm

Re: TCustomRichViewEdit.SelectCurrentLine

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TCustomRichViewEdit.SelectCurrentLine

Post 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.
jgkoehn
Posts: 288
Joined: Thu Feb 20, 2020 9:32 pm

Re: TCustomRichViewEdit.SelectCurrentLine

Post 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.
Post Reply