A bit more of GooString -> std::string
diff --git a/poppler/PageLabelInfo.cc b/poppler/PageLabelInfo.cc index 779f75b..ec9c5be 100644 --- a/poppler/PageLabelInfo.cc +++ b/poppler/PageLabelInfo.cc
@@ -170,7 +170,7 @@ char buffer[32]; int base, number; const Interval *matching_interval; - GooString number_string; + std::string number_string; base = 0; matching_interval = nullptr; @@ -218,11 +218,11 @@ len = number_string.size(); ucs2_char[0] = 0; for (i = 0; i < len; ++i) { - ucs2_char[1] = number_string.getChar(i); + ucs2_char[1] = number_string[i]; label->append(ucs2_char, 2); } } else { - label->append(number_string.toStr()); + label->append(number_string); } return true;
diff --git a/poppler/PageLabelInfo_p.h b/poppler/PageLabelInfo_p.h index 7fccf31..52dfd0d 100644 --- a/poppler/PageLabelInfo_p.h +++ b/poppler/PageLabelInfo_p.h
@@ -3,7 +3,7 @@ // This file is under the GPLv2 or later license // // Copyright (C) 2005-2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005, 2009, 2014, 2019, 2020, 2022 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009, 2014, 2019, 2020, 2022, 2026 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2011 Simon Kellner <kellner@kit.edu> // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it> // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> @@ -113,7 +113,7 @@ return value; } -static void toRoman(int number, GooString *str, bool uppercase) +static void toRoman(int number, std::string *str, bool uppercase) { static const char uppercaseNumerals[] = "IVXLCDM"; static const char lowercaseNumerals[] = "ivxlcdm"; @@ -191,7 +191,7 @@ return -1; } -static void toLatin(int number, GooString *str, bool uppercase) +static void toLatin(int number, std::string *str, bool uppercase) { char base, letter; int i, count;
diff --git a/qt5/tests/check_pagelabelinfo.cpp b/qt5/tests/check_pagelabelinfo.cpp index 9cd4ea0..35c4416 100644 --- a/qt5/tests/check_pagelabelinfo.cpp +++ b/qt5/tests/check_pagelabelinfo.cpp
@@ -38,27 +38,27 @@ void TestPageLabelInfo::testToRoman() { - GooString str; + std::string str; toRoman(177, &str, false); QCOMPARE(str.c_str(), "clxxvii"); } void TestPageLabelInfo::testFromRoman() { - GooString roman("clxxvii"); + const std::string roman("clxxvii"); QCOMPARE(fromRoman(roman.c_str()), 177); } void TestPageLabelInfo::testToLatin() { - GooString str; + std::string str; toLatin(54, &str, false); QCOMPARE(str.c_str(), "bbb"); } void TestPageLabelInfo::testFromLatin() { - GooString latin("ddd"); + const std::string latin("ddd"); QCOMPARE(fromLatin(latin.c_str()), 56); }
diff --git a/qt6/tests/check_pagelabelinfo.cpp b/qt6/tests/check_pagelabelinfo.cpp index 9cd4ea0..35c4416 100644 --- a/qt6/tests/check_pagelabelinfo.cpp +++ b/qt6/tests/check_pagelabelinfo.cpp
@@ -38,27 +38,27 @@ void TestPageLabelInfo::testToRoman() { - GooString str; + std::string str; toRoman(177, &str, false); QCOMPARE(str.c_str(), "clxxvii"); } void TestPageLabelInfo::testFromRoman() { - GooString roman("clxxvii"); + const std::string roman("clxxvii"); QCOMPARE(fromRoman(roman.c_str()), 177); } void TestPageLabelInfo::testToLatin() { - GooString str; + std::string str; toLatin(54, &str, false); QCOMPARE(str.c_str(), "bbb"); } void TestPageLabelInfo::testFromLatin() { - GooString latin("ddd"); + const std::string latin("ddd"); QCOMPARE(fromLatin(latin.c_str()), 56); }