Hi zyx, hi Dominik,
yes, I see you're right with the method name to stay intuitive, the behaviour proposed by you is better. Could you please wait with the release until I've implemented that? I had proposed moving because I didn't dare suggest another exception to be thrown ... There are also some other little things I'd like to still get into the release, and the documentation fix ... I hope I can get it done today (except of course for the reported bugs, e.g. in podofoimpose ...). Best regards, mabri ----- Original Message ----- From: zyx <z...@litepdf.cz> To: podofo-users@lists.sourceforge.net Sent: Wednesday, 8 June 2016, 07:01 UTC Subject: Re: [Podofo-users] BUG: Erase method from PdfOutlineItem sometimes segfaults On Wed, 2016-06-08 at 00:01 +0000, Matthew Brincke wrote: > I intend to fix PdfOutlineItem::InsertChild() in time for the > impending release, so that it moves an item already present in > the tree it's to inserted in, instead of adding it twice and > violating the tree property (which led to the crash on Erase() > AFAIK). Currently I'm still busy with an assignment for studies, > sorry. Hi, I would not do that. A better approach might be (from my point of view) to document that the InsertChild() requires a fresh new item to be used as the child, and it not being assigned in any tree yet, then verify that in the runtime and throw an exception when any of this prerequisite is violated. After that introduce a new method Move(), which will move (or reparent) some part of the tree to elsewhere in the same tree. There should be also done some runtime checks to not cause cycles in the tree and so on. Eventually a Copy() method to copy a subtree to a different part could be added too, then the user would call it, instead of the current InsertChild() and then will be able to erase the previous subtree as well. That way, there will be no side-effect of the InsertChild() and the method name itself will clearly state what it does. > Could you please wait for me? I'll try to get the fix done > on 8th June. I do not expect it being included in the 0.9.4, there exists a workaround (manual copy of the subtree), if you meant to wait for you due this. Just my opinion. Bye, zyx -- http://www.litePDF.cz i...@litepdf.cz ------------------------------------------------------------------------------ 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. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users ------------------------------------------------------------------------------ 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. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users