[grammar fix in quoted text ]
> zyx has written on 28 April 2017 at 21:51:
> 
> 
> On Tue, 2017-04-25 at 00:47 +0200, Matthias Brinke wrote:
> > The patch and the sources for the test programs are attached here.
> 
>  Hi,
Hello zyx, hello Dominik, hello all,

> somewhat scare me. The part about "erase erases in both trees" is not
> the right thing.
> 
I understand that, the patch I've worked on this Sunday hasn't got that
(not attached because I still need some time on this Monday to test it).

> Imagine you want to copy subtree from another document and then free
> that other document, while still having the destination document there
> and making changes in it. This way you get lost the subtree which is
> copied, no? I forgot what we settled with, it's a long time ago. Can

No, with the last (IIRC) old patch the ownership was transferred to the
copy so the subtree could only be erased from the destination document.
Once you suggested only taking outline items without a tree they're in
(implement Copy() and Move() later), in my current patch it's similar,
the item gets stripped of its references (pointers) to other items
after copying but before it's inserted, that way there's no problem
with what Erase() should do (it changes some properties to what it needs,
in debug mode that is asserted, e.g. parent outline being set correctly). 

> there be different use-cases? Maybe not. If you want to copy part of
> the outlines from one document to another, then it should be truly
> copied, complete subtree. If you want to move subtree within the tree,
> then it's also clear what to do. That way Erase() is deterministic,
> erase the node and its subtree.
These tasks should be done by CopySubtree() and MoveSubtree() (or maybe
SetParentOutline() for the latter), I think. They can be implemented
later because I'd like to fix just the crashes with Erase() for now.
Copying is AFAIK possible to implement outside of PoDoFo for the time being. 

> 
> It also didn't fix a warning reported by clang's static analyzer, see
> below.

Now fixed, I hope I tests out well.
> 
> Feel free to correct me. As I said, this issue had been opened quite
> long ago.

See above.

>  Bye,
>  zyx
> 
Best regards, mabri

P. S. I wish you a good sleep, for sure I need one now.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to