File ace884e13e413b0cc49ece80936584ef92c986f5.patch of Package inkscape
From ace884e13e413b0cc49ece80936584ef92c986f5 Mon Sep 17 00:00:00 2001
From: mike kowalski <michal_kowalski@hotmail.com>
Date: Sun, 12 Oct 2025 10:04:22 -0700
Subject: [PATCH] Replace getLength() with size() on a GooString (Poppler)
GooString in poppler no longer defines getLength() method.
Call size() from base string directly.
---
src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++--
src/extension/internal/pdfinput/poppler-utils.cpp | 6 +++---
src/extension/internal/pdfinput/poppler-utils.h | 9 +++++++++
3 files changed, 14 insertions(+), 5 deletions(-)
diff -upr inkscape-1.4.2+git48.4b73df015e.orig/src/extension/internal/pdfinput/pdf-parser.cpp inkscape-1.4.2+git48.4b73df015e/src/extension/internal/pdfinput/pdf-parser.cpp
--- inkscape-1.4.2+git48.4b73df015e.orig/src/extension/internal/pdfinput/pdf-parser.cpp 2025-12-09 12:20:06.724954122 +0000
+++ inkscape-1.4.2+git48.4b73df015e/src/extension/internal/pdfinput/pdf-parser.cpp 2025-12-09 12:20:35.467596811 +0000
@@ -2256,7 +2256,7 @@ void PdfParser::doShowText(GooString *s)
auto font = state->getFont();
int wMode = font->getWMode(); // Vertical/Horizontal/Invalid
- builder->beginString(state, s->getLength());
+ builder->beginString(state, get_goostring_length(*s));
// handle a Type 3 char
if (font->getType() == fontType3) {
@@ -2267,7 +2267,7 @@ void PdfParser::doShowText(GooString *s)
state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
auto p = s->getCString(); // char* or const char*
- int len = s->getLength();
+ int len = get_goostring_length(*s);
while (len > 0) {
diff -upr inkscape-1.4.2+git48.4b73df015e.orig/src/extension/internal/pdfinput/poppler-utils.cpp inkscape-1.4.2+git48.4b73df015e/src/extension/internal/pdfinput/poppler-utils.cpp
--- inkscape-1.4.2+git48.4b73df015e.orig/src/extension/internal/pdfinput/poppler-utils.cpp 2025-12-09 12:20:06.725282024 +0000
+++ inkscape-1.4.2+git48.4b73df015e/src/extension/internal/pdfinput/poppler-utils.cpp 2025-12-09 12:21:39.906047557 +0000
@@ -168,7 +168,7 @@ void InkFontDict::hashFontObject1(const
case objString:
h->hash('s');
s = obj->getString();
- h->hash(s->c_str(), s->getLength());
+ h->hash(s->c_str(), get_goostring_length(*s));
break;
case objName:
h->hash('n');
@@ -586,10 +586,10 @@ std::string getDictString(Dict *dict, co
std::string getString(const GooString *value)
{
if (_POPPLER_HAS_UNICODE_BOM(value)) {
- return g_convert(value->getCString () + 2, value->getLength () - 2,
+ return g_convert(value->getCString () + 2, get_goostring_length(*value) - 2,
"UTF-8", "UTF-16BE", NULL, NULL, NULL);
} else if (_POPPLER_HAS_UNICODE_BOMLE(value)) {
- return g_convert(value->getCString () + 2, value->getLength () - 2,
+ return g_convert(value->getCString () + 2, get_goostring_length(*value) - 2,
"UTF-8", "UTF-16LE", NULL, NULL, NULL);
}
return value->toStr();
diff -upr inkscape-1.4.2+git48.4b73df015e.orig/src/extension/internal/pdfinput/poppler-utils.h inkscape-1.4.2+git48.4b73df015e/src/extension/internal/pdfinput/poppler-utils.h
--- inkscape-1.4.2+git48.4b73df015e.orig/src/extension/internal/pdfinput/poppler-utils.h 2025-12-09 12:20:06.725311104 +0000
+++ inkscape-1.4.2+git48.4b73df015e/src/extension/internal/pdfinput/poppler-utils.h 2025-12-09 12:20:35.468483796 +0000
@@ -19,6 +19,7 @@
#include <string>
#include <unordered_set>
#include <vector>
+#include <goo/GooString.h>
#include "poppler-transition-api.h"
@@ -104,4 +105,12 @@ private:
void hashFontObject1(const Object *obj, FNVHash *h);
};
+inline size_t get_goostring_length(const GooString& str) {
+#if POPPLER_CHECK_VERSION(25, 10, 0)
+ return str.size();
+#else
+ return str.getLength();
+#endif
+}
+
#endif /* POPPLER_UTILS_H */