numbering and paragraph borders

General TRichView support forum. Please post your questions here
Post Reply
JDommi
Posts: 6
Joined: Sat Aug 17, 2013 12:34 pm

numbering and paragraph borders

Post by JDommi »

Hi!

I'm just experimenting with numbering lists and paragraph borders on RTF files.
On this I have two problems.

1. Create numbering:
- wished result: a list with right aligned numbers and a border around the whole line incl. the numbers
- coding (excerpt):

Code: Select all

  ListStyle := TRVListInfo.Create(nil);
  with ListStyle.Levels.Add do begin // only one level required
    ListType  := rvlstDecimal;
    Font.Name := 'Arial';
    Font.Size := 10;
    Font.Style := [fsBold];
    FirstIndent := 0;
    LeftIndent  := 24;
    MarkerIndent := 18;
    MarkerAlignment := rvmaRight;
    FormatString := '%0:s';
  end;
- result: the numbering is in front of the border. I think the problem is the marker indent ...
The silly thing on this is that right after formatting the result looks like it should but after saving/reloading the document looks as expected anymore.

2. Paragraph borders
- wished result: each line should have a border (simulating a table as numbering over several cells are not possible)
- formatting: each line formatted by "paragraph borders and backgrounds" with a border
- result: reloading the RTF document in ScaleRichView shows the correct result but on opening the file with a.e. MSWord the single paragraphs are merged as one and the border is drawn only around the whole block.

I hope you have a solution for my problems.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1. Paragraph border is drawn relative to the paragraph, so the left side of a border starts at ParaStyle.LeftIndent - ParaStyle.Border.BorderOffsets.Left.
It is the same for numbered paragraphs and normal paragraph. Properties of ListStyle are not taken into account when drawing paragraph border and background.

2. Unfortunately, I do not know how to stop MS Word from combining borders for adjacent paragraph having identical attributes.
JDommi
Posts: 6
Joined: Sat Aug 17, 2013 12:34 pm

Post by JDommi »

Ah, okay. Now I got it! I haven't recognized to change the indent back to offset 0.
Thanks for that hint! :D

And for the Word problem I'll try to find a workaround - maybe by adding a different paragraph between each line with a height of 0px or 1px.

JDommi
Post Reply