Fix bug: dont remove parent just because children is empty#243
Fix bug: dont remove parent just because children is empty#243kpldvnpne wants to merge 1 commit intoitext:developfrom
Conversation
|
Hi @kpldvnpne , The change looks correct. What we miss here is still removing top level outline dictionary when its last child is removed. I also see 2 other related problems:
2 last problems are here for us to solve while further working on your PR. But if you can contribute here, it would be great and will speed up the merging process. |
|
Hi @kpldvnpne |
Reason:
Currently there is a bug with
PdfOutline.removeOutlinefunction. Here is what happens in this bug:If there is an outline like this:
and, we remove
Child Outline, then the parent outline automatically gets removed because the parent now has no children.This is the relevant part of the code:
Hence, in this PR, I removed the line
parent.removeOutline();so that the parent does not get removed.