On Fri, 2016-06-10 at 23:30 +0000, Matthew Brincke wrote: > I have now implemented my proposed fix, which is > attached to this e-mail.
Hi, thanks for the patch. It looks mostly fine and works as you described. The application doesn't crash, but eds with an exception. It introduces two compiler warnings though: src/base/PdfError.cpp: In static member function ‘static const char* PoDoFo::PdfError::ErrorName(PoDoFo::EPdfError)’: src/base/PdfError.cpp:193:11: warning: enumeration value ‘ePdfError_OutlineItemAlreadyPresent’ not handled in switch [-Wswitch-enum] switch( eCode ) ^ src/base/PdfError.cpp: In static member function ‘static const char* PoDoFo::PdfError::ErrorMessage(PoDoFo::EPdfError)’: src/base/PdfError.cpp:359:11: warning: enumeration value ‘ePdfError_OutlineItemAlreadyPresent’ not handled in switch [-Wswitch-enum] switch( eCode ) ^ which explains why the printed error message is rather uninformative: PoDoFo encounter an error. Error: 50 Callstack: #0 Error Source: src/doc/PdfOutlines.cpp:155 I would also change the description of the method, because the current description (also included in your patch): + /** Inserts an existing PdfOutlineItem as a child of this outline item. invokes to me that "an existing" means something which is already included in the tree. I know you described it in more detail later in the paragraph, though it makes things just more confusing. A better text beginning would be, from my point of view: + /** Inserts a new PdfOutlineItem as a child of this outline item. Then the "detailed" description can be that the new item should not be part of any tree, and this could be tested for, otherwise a confusion about ownership of the inserted item is risen. With your proposed description, consider that I'd take an item from a different tree and PdfDocument (the description suggests it's possible). Will the destination tree be corrupted if I delete the source document first? I guess so, but I do not know for sure. Bye, zyx ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users