From 6a124f3b5b3082b8b3930f777a61d72f5775d6ff Mon Sep 17 00:00:00 2001 From: samuel Date: Sun, 10 Feb 2019 20:02:51 +0100 Subject: [PATCH] Remove bug #1808847: Center alignment lost Remove bug described in the link: https://bugs.launchpad.net/inkscape/+bug/1808847 Add check to determine if parent of space elements is a , or element. Spaces no longer added when file is reloaded --- src/xml/repr-io.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index f6552a5f98..99bf360d8c 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -558,7 +558,10 @@ static Node *sp_repr_svg_read_node (Document *xml_doc, xmlNodePtr node, const gc // Since libxml2 2.9.0, only element nodes are checked, thus check parent. // Note: this only handles XML's rules for white space. SVG's specific rules // are handled in sp-string.cpp. - bool preserve = (xmlNodeGetSpacePreserve (node->parent) == 1); + bool preserve = (xmlNodeGetSpacePreserve (node->parent) == 1) + && (strcmp(reinterpret_cast(node->parent->name),"flowPara") == 0) + && (strcmp(reinterpret_cast(node->parent->name),"flowSpan") == 0) + && (strcmp(reinterpret_cast(node->parent->name),"flowDiv") == 0); xmlChar *p; for (p = node->content; *p && g_ascii_isspace (*p) && !preserve; p++) -- GitLab