diff options
author | Oliver Sander <oliver.sander@tu-dresden.de> | 2023-10-15 18:22:12 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2023-10-17 21:03:14 +0000 |
commit | 611a0cc0f0a4a866a84dcbd4870d30a9b2566365 (patch) | |
tree | cbd1d7b43eb48724ec51584c1887a3016024d0da | |
parent | 28e70bc0fafe1499b107d5965f1e8c7a59b4c4a5 (diff) |
Remove method GooString::hasJustUnicodeMarker
Because it is used only once, and writing "== unicodeByteOrderMark"
instead is just as short and readable.
-rw-r--r-- | goo/GooString.h | 3 | ||||
-rw-r--r-- | poppler/PDFDoc.cc | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/goo/GooString.h b/goo/GooString.h index 14fcdc1a..9bacc22f 100644 --- a/goo/GooString.h +++ b/goo/GooString.h @@ -26,7 +26,7 @@ // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich // Copyright (C) 2019 Christophe Fergeau <cfergeau@redhat.com> // Copyright (C) 2019 Tomoyuki Kubota <himajin100000@gmail.com> -// Copyright (C) 2019, 2020, 2022 Oliver Sander <oliver.sander@tu-dresden.de> +// Copyright (C) 2019, 2020, 2022, 2023 Oliver Sander <oliver.sander@tu-dresden.de> // Copyright (C) 2019 Hans-Ulrich Jüttner <huj@froreich-bioscientia.de> // Copyright (C) 2020 Thorsten Behrens <Thorsten.Behrens@CIB.de> // Copyright (C) 2022 Even Rouault <even.rouault@spatialys.com> @@ -253,7 +253,6 @@ public: static bool hasUnicodeMarker(const std::string &s) { return s.size() >= 2 && s[0] == '\xfe' && s[1] == '\xff'; } bool hasUnicodeMarkerLE() const { return hasUnicodeMarkerLE(*this); } static bool hasUnicodeMarkerLE(const std::string &s) { return s.size() >= 2 && s[0] == '\xff' && s[1] == '\xfe'; } - bool hasJustUnicodeMarker() const { return size() == 2 && hasUnicodeMarker(); } POPPLER_PRIVATE_EXPORT void prependUnicodeMarker(); }; diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index e4b8dd09..7d08f202 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -46,7 +46,7 @@ // Copyright (C) 2020 Nelson Benítez León <nbenitezl@gmail.com> // Copyright (C) 2020 Thorsten Behrens <Thorsten.Behrens@CIB.de> // Copyright (C) 2020 Adam Sampson <ats@offog.org> -// Copyright (C) 2021, 2022 Oliver Sander <oliver.sander@tu-dresden.de> +// Copyright (C) 2021-2023 Oliver Sander <oliver.sander@tu-dresden.de> // Copyright (C) 2021 Mahmoud Khalil <mahmoudkhalil11@gmail.com> // Copyright (C) 2021 RM <rm+git@arcsin.org> // Copyright (C) 2021 Georgiy Sgibnev <georgiy@sgibnev.com>. Work sponsored by lab50.net. @@ -718,7 +718,7 @@ bool PDFDoc::isLinearized(bool tryingToReconstruct) void PDFDoc::setDocInfoStringEntry(const char *key, GooString *value) { - bool removeEntry = !value || value->getLength() == 0 || value->hasJustUnicodeMarker(); + bool removeEntry = !value || value->getLength() == 0 || (value->toStr() == unicodeByteOrderMark); if (removeEntry) { delete value; } |