[poppler] Patch to add simple TOC interface

Ihar `Philips` Filipau thephilips at gmail.com
Wed Mar 21 17:22:26 PDT 2012


On 3/21/12, Albert Astals Cid <aacid at kde.org> wrote:
> El Dimecres, 21 de març de 2012, a les 10:30:47, Adam Reichold va escriure:
>> I attached a patch to add a simple TOC interface to the qt4 frontend as
>> you proposed.
>
> The code is wrong in two parts.
>

I too do not know local conventions, but If I may add a comment: why
not use some container class? Quite confusing to see singly linked
lists in C++ code. Other parts of Poppler::Document seems to have
accord with the QList.

And IMO a method to free the structure recursively is a must:
otherwise every using application would have to implement its own
deletion routine. Or the Document should provide it only as a const
and keep the ownership of the simpleToc and free it in d'tor. It's not
like anybody is going to use toc without the actual document.

P.S. And it is "responsible", not "responsable"; "empty", not "emtpy".
Copy-pasted typos from the comment of original toc() method. That
/improvement/ should be easy to introduce ;)


More information about the poppler mailing list