summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2021-05-14 21:05:04 +0200
committerAlbert Astals Cid <tsdgeos@yahoo.es>2021-05-20 12:33:10 +0000
commit8f9115bf4475866eef160af06d17bcd0087cdaed (patch)
tree28817246f904a9bda16cb45881616abea72b5a71
parent90bcd4967e82534f3c141c2c14cf292d6813bbd8 (diff)
Remove OutlineItem::close
It was only used in the Outline destructor and in HtmlOutputDev but there it was kind of pointless
-rw-r--r--poppler/Outline.cc20
-rw-r--r--poppler/Outline.h3
-rw-r--r--utils/HtmlOutputDev.cc2
3 files changed, 8 insertions, 17 deletions
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 <mpg@redhat.com>
-// Copyright (C) 2008, 2016-2019 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2008, 2016-2019, 2021 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Nick Jones <nick.jones@network-box.com>
// Copyright (C) 2016 Jason Crain <jason@aquaticape.us>
// Copyright (C) 2017 Adrian Johnson <ajohnson@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 <mpg@redhat.com>
-// Copyright (C) 2016, 2018 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2016, 2018, 2021 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2019, 2020 Oliver Sander <oliver.sander@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);