Commit 8f9115bf authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid
Browse files

Remove OutlineItem::close

It was only used in the Outline destructor and in HtmlOutputDev but
there it was kind of pointless
parent 90bcd496
Pipeline #322950 passed with stages
in 11 minutes and 49 seconds
......@@ -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;
}
}
......@@ -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; }
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment