Menu

#30 Enumeration + Numberings can not be combined

closed-fixed
None
5
2011-11-27
2011-10-26
Anonymous
No

I try to create a list (Enumerations) and then at some point indent and use a Numberings list.This leads to a corrupted document that cannot be opened.

The documentations says: "They can be nested.". But they can't be nested with each other as far as i see.

Example:

<?php
// first level unordered list
$list = new PHPRtfLite_List_Enumeration($rtf);
$list->addItem('hello world');
$list->addItem('foo');
$list->addItem('bar');

// second level numbering
$subNumList = new PHPRtfLite_List_Numbering($rtf);
$subNumList->addItem('hello world');
$subNumList->addItem('foo');
$subNumList->addItem('bar');
$list->addList($subNumList);
// add item in the first level
$list->addItem('foobar');

$section = $rtf->addSection();
// add numbering to a section
$section->addNumbering($list);

Discussion

  • Steffen Zeidler

    Steffen Zeidler - 2011-10-27

    I didn't run your code, yet, but by looking at it I was wondering why you creating an enumeration and adding it as numbering ($section->addNumbering($list))?

    Should be: $section->addEnumeration($list);

    If this solves your problem, please let me know so I can close this ticket.

    May be it would be more useful to offer an addList() method instead of addEnumeration() and addNumbering()

     
  • Steffen Zeidler

    Steffen Zeidler - 2011-10-27
    • assigned_to: nobody --> sigmaz
     
  • Anonymous

    Anonymous - 2011-10-27

    Hi!

    No this doesn't solve the problem. The exact error is:

    Notice: Undefined property: PHPRtfLite_List_Enumeration::$_prefix in /Users/Shared/ApacheSites/test/apps/cms/lib/PHPRtfLite/List.php on line 226

    Fatal error: Call to undefined method PHPRtfLite_List_Enumeration::getNumber() in /Users/Shared/ApacheSites/test/apps/cms/lib/PHPRtfLite/List.php on line 226

     

    Last edit: Anonymous 2016-01-28
  • Steffen Zeidler

    Steffen Zeidler - 2011-11-27

    Fixed that, please use release PHPRtfLite 1.2. Thanks for the report.

     
  • Steffen Zeidler

    Steffen Zeidler - 2011-11-27
    • status: open --> closed-fixed
     

Log in to post a comment.