But I always get an odd spacing between the items. I tried to change SpaceBefore and SpaceAfter but that didn't change anything. How can I get rid of the spacing?
Attachments
Screenshot 2025-04-03 135228.jpg (4.26 KiB) Viewed 3834 times
Please check which paragraph style is used in your code.
In your code sample, the following paragraph styles are used:
1. ParaStyles->Items[RV_TEXT]
It is the last parameter of ReportRichView->RichViewEdit->AddNL("My list:", RV_TEXT, RV_TEXT);
It's strange that the same constant RV_TEXT are used both as an index in TextStyles (2nd parameter) and as an index in ParaStyles (3rd parameter).
2. ParaStyles->Items[1]
It is the last but one parameter of ReportRichView->RichViewEdit->SetListMarkerInfo(-1, RV_BULLET_LIST, 0, 1, 1, false);
It's strange that a constant is not used.
Probably you use not the paragraph style defined in this code, but other paragraph styles.
As for your paragraph style.
You assign pinfo->LineSpacing = 0.5;
But pinfo->LineSpacing is an integer value measured in % (assuming that pinfo->LineSpacingType has the default value: rvlsPercent).
So, your code simply assigns 0 to LineSpacing.
TRichView ignores line spacing less than 50%, so this paragraph style has the default single line spacing (the same as LineSpacing == 100).
Thank you Sergey! Your response solved the problem. I had not understood that the fith paramter of SetListMarkerInfo() refers to the paragraph style (I copied it from code I found in the web). With this modification it now works (yes, the wrong paragraph style was used):
I used the same constants for text and paragraph styles, since I wanted to have each paragraph to have a particular text style, but you are right, it's more consistent to keep them separate. And I see I missunderstood the line spacing.