Issue #16169: do not serialize empty string value.

Reverting a part of commit fa097df9 which should not have been merged,
and in fact which was not useful anymore for fixing the original issue.

This fixes part of #16169, which is that because of this change, we were
creating broken XCF containing both a text and a markup variant for
text-only text layers. Typically it was storing:

> (text "I love GIMP")
> (markup "")

Now we don't create such broken XCF anymore, but I'll want to strengthen
reading code too, so that we can salvage such XCF files, already
existing in the wild.
This commit is contained in:
Jehan 2026-04-08 15:46:23 +02:00
parent edc7a14127
commit aa7c2a55d6

View file

@ -576,10 +576,13 @@ gimp_config_serialize_value (const GValue *value,
{
const gchar *cstr = g_value_get_string (value);
if (! cstr)
return FALSE;
if (escaped)
gimp_config_string_append_escaped (str, cstr ? cstr : "");
gimp_config_string_append_escaped (str, cstr);
else
g_string_append (str, cstr ? cstr : "");
g_string_append (str, cstr);
return TRUE;
}