WPCubed Product Support

Bugg in CreateTableOfContents?

Hi,
I tried to use TWPCustomRtfEdit.CreateTableOfContents but I didn't got anything in the TOC.
When i debugged thru the code I saw this on the line 10950 in WpCtrMemo.pas, local method Process

if (wptocUseParIsOutline in Mode) and  ((par.AGetInherited(WPAT_ParIsOutline, outl)) and (outl > 0))

My thought is that it should be

if (wptocUseParIsOutline in Mode) and
  ((par.AGetInherited(WPAT_OUTLINELEVEL, outl)) and (outl > 0))

I used the built in Paragraph dialog to set the outline-levels on my paragraphs, didn't use styles.

Please let me know if my thought is correct or if I should mark the OutlineLevel in some other way.

/Per-Erik Andersson

#1 ♥ 0
3.6k Views 2 users read 1 min
support

Hi,

You can change the code of course, or you can inherit Your own version from this.

But it was not intended to use the Outline level flag.

I decided that it should use the special property.

Of course a flag with operation mode can be added.

if ((wptocUseParIsOutline in Mode) and
      ((par.AGetInherited(WPAT_ParIsOutline, outl)) and (outl > 0)))
        or
       ((wptocUseOUTLINELEVEL in Mode) and
      ((par.AGetInherited(WPAT_OUTLINELEVEL, outl)) and (outl > 0)))
      then
    begin

Julian

#2 ♥ 0

Thanks for the answear. I see I was not using the proper flags in WpTools.

/Per-Erik Andersson

#3 ♥ 0
This category is archived. No new posts are possible.