Page 1 of 1

numbering and paragraph borders

Posted: Sat Aug 17, 2013 1:21 pm
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.

Posted: Mon Aug 19, 2013 2:35 pm
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.

Posted: Tue Aug 20, 2013 7:39 am
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