Page 1 of 1

Bug with bullets in rtf-files

Posted: Thu Sep 18, 2014 9:46 am
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

Posted: Sat Sep 20, 2014 6:57 am
by Sergey Tkachenko
We will fix RTF import in the next update.

Posted: Mon Sep 22, 2014 11:00 am
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?

Posted: Tue Sep 23, 2014 6:51 am
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.

Posted: Thu Sep 25, 2014 2:48 pm
by Sergey Tkachenko
Fixed in TRichView 15.1.2 (available for registered users)