SetAddParagraphMode(False) has no effect on lists?

General TRichView support forum. Please post your questions here
Post Reply
lwinter
Posts: 24
Joined: Thu Dec 01, 2005 4:42 am

SetAddParagraphMode(False) has no effect on lists?

Post 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
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

bullet/numbering must start a new paragraph in TRichView, it cannot start a line break inside the paragraph
Post Reply