Files
MINGW-packages/mingw-w64-inkscape/009-popper-15-10.patch
Christoph Reiter b9b4a102a5 poppler: Update to 25.10.0 (#25885)
* poppler: Update to 25.10.0

* poppler rebuilds

* dia: poppler build fixes

* gdal: backport poppler patch

* More poppler fixes

* checksums
2025-10-11 16:05:57 +02:00

64 lines
2.8 KiB
Diff

diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index 0d62c20875..6ac3b23c5f 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -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, _POPPLER_GOOSTRING_SIZE(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 = _POPPLER_GOOSTRING_SIZE(s);
while (len > 0) {
--- inkscape-1.4.2/src/extension/internal/pdfinput/poppler-transition-api.h.orig 2025-10-11 11:10:28.325869000 +0200
+++ inkscape-1.4.2/src/extension/internal/pdfinput/poppler-transition-api.h 2025-10-11 11:23:31.537724700 +0200
@@ -15,6 +15,12 @@
#include <glib/poppler-features.h>
#include <poppler/UTF.h>
+#if POPPLER_CHECK_VERSION(25, 10, 0)
+#define _POPPLER_GOOSTRING_SIZE(x) x->size()
+#else
+#define _POPPLER_GOOSTRING_SIZE(x) x->getLength()
+#endif
+
#if POPPLER_CHECK_VERSION(25,2,0)
#define _POPPLER_GET_CODE_TO_GID_MAP(ff, len) getCodeToGIDMap(ff)
#define _POPPLER_GET_CID_TO_GID_MAP(len) getCIDToGIDMap()
diff --git a/src/extension/internal/pdfinput/poppler-utils.cpp b/src/extension/internal/pdfinput/poppler-utils.cpp
index 8110a3e085..1765df5102 100644
--- a/src/extension/internal/pdfinput/poppler-utils.cpp
+++ b/src/extension/internal/pdfinput/poppler-utils.cpp
@@ -168,7 +168,7 @@ void InkFontDict::hashFontObject1(const Object *obj, FNVHash *h)
case objString:
h->hash('s');
s = obj->getString();
- h->hash(s->c_str(), s->getLength());
+ h->hash(s->c_str(), _POPPLER_GOOSTRING_SIZE(s));
break;
case objName:
h->hash('n');
@@ -586,10 +586,10 @@ std::string getDictString(Dict *dict, const char *key)
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, _POPPLER_GOOSTRING_SIZE(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, _POPPLER_GOOSTRING_SIZE(value) - 2,
"UTF-8", "UTF-16LE", NULL, NULL, NULL);
}
return value->toStr();