poppler/Outline.cc | 20 +++++++------------- poppler/Outline.h | 3 +-- utils/HtmlOutputDev.cc | 2 -- 3 files changed, 8 insertions(+), 17 deletions(-)
New commits: commit 8f9115bf4475866eef160af06d17bcd0087cdaed Author: Albert Astals Cid <aa...@kde.org> Date: Fri May 14 21:05:04 2021 +0200 Remove OutlineItem::close It was only used in the Outline destructor and in HtmlOutputDev but there it was kind of pointless diff --git a/poppler/Outline.cc b/poppler/Outline.cc index 433b0280..d7814d6b 100644 --- a/poppler/Outline.cc +++ b/poppler/Outline.cc @@ -14,7 +14,7 @@ // under GPL version 2 or later // // Copyright (C) 2005 Marco Pesenti Gritti <m...@redhat.com> -// Copyright (C) 2008, 2016-2019 Albert Astals Cid <aa...@kde.org> +// Copyright (C) 2008, 2016-2019, 2021 Albert Astals Cid <aa...@kde.org> // Copyright (C) 2009 Nick Jones <nick.jo...@network-box.com> // Copyright (C) 2016 Jason Crain <ja...@aquaticape.us> // Copyright (C) 2017 Adrian Johnson <ajohn...@redneon.com> @@ -104,7 +104,12 @@ OutlineItem::OutlineItem(const Dict *dict, int refNumA, OutlineItem *parentA, XR OutlineItem::~OutlineItem() { - close(); + if (kids) { + for (auto entry : *kids) { + delete entry; + } + delete kids; + } if (title) { gfree(title); } @@ -151,14 +156,3 @@ void OutlineItem::open() kids = readItemList(this, &firstRef, xref); } } - -void OutlineItem::close() -{ - if (kids) { - for (auto entry : *kids) { - delete entry; - } - delete kids; - kids = nullptr; - } -} diff --git a/poppler/Outline.h b/poppler/Outline.h index e1e0ba8e..51a06fb0 100644 --- a/poppler/Outline.h +++ b/poppler/Outline.h @@ -14,7 +14,7 @@ // under GPL version 2 or later // // Copyright (C) 2005 Marco Pesenti Gritti <m...@redhat.com> -// Copyright (C) 2016, 2018 Albert Astals Cid <aa...@kde.org> +// Copyright (C) 2016, 2018, 2021 Albert Astals Cid <aa...@kde.org> // Copyright (C) 2019, 2020 Oliver Sander <oliver.san...@tu-dresden.de> // // To see a description of the changes please see the Changelog file that @@ -66,7 +66,6 @@ public: static std::vector<OutlineItem *> *readItemList(OutlineItem *parent, const Object *firstItemRef, XRef *xrefA); void open(); - void close(); const Unicode *getTitle() const { return title; } int getTitleLength() const { return titleLen; } diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc index 8fa1671b..bd55ac7d 100644 --- a/utils/HtmlOutputDev.cc +++ b/utils/HtmlOutputDev.cc @@ -1732,7 +1732,6 @@ bool HtmlOutputDev::newHtmlOutlineLevel(FILE *output, const std::vector<OutlineI fputs("\n", output); newHtmlOutlineLevel(output, item->getKids(), level + 1); } - item->close(); fputs("</li>\n", output); } fputs("</ul>\n", output); @@ -1758,7 +1757,6 @@ void HtmlOutputDev::newXmlOutlineLevel(FILE *output, const std::vector<OutlineIt if (item->hasKids() && item->getKids()) { newXmlOutlineLevel(output, item->getKids()); } - item->close(); } fputs("</outline>\n", output); _______________________________________________ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler