Page 1 of 1

SetAddParagraphMode(False) has no effect on lists?

Posted: Fri Aug 11, 2006 12:30 am
by lwinter
Hi Sergey,

PROBLEM:
The HtmlImporter reads <br> tags as full new paragraphs, not as soft-line-break (SHIFT+ENTER -- like) as one would expect.
I need to import HTML with <br> tags, where each <br> adds a soft-new-line to a numbered or bulleted list (<ol> and <ul>).
The soft new line
  • - needs to keep the indent and style of the previous line
    - must omit the number or bullet
OUR PARTIAL SOLUTION:
I had to change the HtmlImporter, so that on each encounter of a <br>, there will be a switch to SetAddParagraphMode(False) before the next line is added (and switch back after that line has been added).

This works allright only outside numbered and bulleted lists.
Inside numbered and bulleted lists SetAddParagraphMode(False) seems to have no effect, every <br> adds a full new number / bullet list line.
Shortened Example from the RvHtmlImport.pas, procedure writets:

Code: Select all

// last added line was a numbered or bulleted list, and the indent, list style etc. haven't been changed since
// ParagraphStyle = -1
SetAddParagraphMode(False); 
CurContainer.RVData.AddNLATag(String, CurrStyle, ParagraphStyle, Link);
SetAddParagraphMode(True)
QUESTION:
How can I programmatically add soft-line-breaks into numbered and bulleted lists? Did I miss something here?

Thanks for your help,
-- Lutz

Posted: Fri Aug 11, 2006 5:45 am
by Sergey Tkachenko
bullet/numbering must start a new paragraph in TRichView, it cannot start a line break inside the paragraph