Bug with bullets in rtf-files

General TRichView support forum. Please post your questions here
Post Reply
Bjoern
Posts: 21
Joined: Tue May 11, 2010 4:05 pm

Bug with bullets in rtf-files

Post by Bjoern »

I think i have found a bug in the handling of bullets in rtf-files, i can reproduce it with the actual version of RichViewActionTest:

1. Make a new File, fill it with 3 lines, the first line must be so long that the editor must wrap the line:

Code: Select all

aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa 
aaaaa aaaaa aaaaa aaaaa aaaaa 
bbb
ccc
2. Mark all lines and push the bullet-button (o=bullet symbol)

Code: Select all

o   aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa
    aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa 
o   bbb
o   ccc
3. Save the document as a rtf (not rvf) file
4. Open it again, it looks ok

Code: Select all

o   aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa
    aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa 
o   bbb
o   ccc
5. Go with the cursor in the first line and push the bullet-button again (un-bullet the first line)
Now it should look

Code: Select all

aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa
aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa 
o   bbb
o   ccc
but it looks

Code: Select all

aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa
    aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa 
o   bbb
o   ccc
The Editor deletes the bullet symbol and the left-margin of the first line of the first paragraph, but left the margin at the part he wraps.

When you save this wrong document again as a rtf-file and reload it, the document is shown wrong again.
It also appears when the document is stored as rtf in a DB with a TDBRichViewEdit.
It dont appears when you save the file in rvf-format instead of rft.
It dont appears when you un-bullet the line without saving and reloading the document.

Is there any workaround for this error?

Greetings
Björn
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

We will fix RTF import in the next update.
Bjoern
Posts: 21
Joined: Tue May 11, 2010 4:05 pm

Post by Bjoern »

Thank you for the fast replay!

Is there a possibility to use the fixed code-parts in V13.0.5 or a workaround for this version?
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Unfortunately, I cannot, this is too old version, and changes must be done in multiple places.

Please note that the fix include only adjusting the first line indent for markered paragraphs.

In TRichView, for unmarkered paragraphs, indents are defined in properties of RVStyle.ParaStyles[]: LeftIndent and FirstIndent.
For markered paragraphs, these properties are ignored, they are overridden by the corresponding properties of a list level.
It is possible, that these properties may be completely different.

Currently, for paragraphs read from RTF, left indents of paragraphs and list levels were identical, but first line indents of paragraphs were equal not to first line indent of list level, but to the indent of a maker (a bullet or a number). The fix will only change first indent of the paragraph.
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Fixed in TRichView 15.1.2 (available for registered users)
Post Reply