From bdf23d1d42a1664e5804ab3c29700706d1e29979 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 31 Oct 2017 01:42:22 +0000 Subject: fix asserts --- src/svg/svg-color.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp index 89a5636a8..60cbff3dc 100644 --- a/src/svg/svg-color.cpp +++ b/src/svg/svg-color.cpp @@ -398,7 +398,7 @@ guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 dfl) * this check wrapper. */ gchar const *end = str; guint32 const ret = internal_sp_svg_read_color(str, &end, dfl); - assert(((ret == dfl) && (end == str)) + g_assert(((ret == dfl) && (end == str)) || (((ret & 0xff) == 0) && (str < end))); if (str < end) { @@ -407,7 +407,7 @@ guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 dfl) buf[end - str] = '\0'; gchar const *buf_end = buf; guint32 const check = internal_sp_svg_read_color(buf, &buf_end, 1); - assert(check == ret + g_assert(check == ret && buf_end - buf == end - str); g_free(buf); @@ -425,7 +425,7 @@ guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 dfl) */ static void rgb24_to_css(char *const buf, unsigned const rgb24) { - assert(rgb24 < (1u << 24)); + g_assert(rgb24 < (1u << 24)); /* SVG 1.1 Full allows additional colour names not supported by SVG Tiny, but we don't bother * with them: it's good for these colours to be copyable to non-SVG CSS stylesheets and for -- cgit v1.2.3 From 36216068dee24b54d67a35854d9160a9ec5f76dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A8le=20Duda?= Date: Tue, 31 Oct 2017 10:32:02 +0000 Subject: fix removing class when object to path --- src/path-chemistry.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index b3b0c8076..b824d15c7 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -430,6 +430,8 @@ sp_item_list_to_curves(const std::vector &items, std::vector& Inkscape::XML::Node *parent = item->getRepr()->parent(); // remember id char const *id = item->getRepr()->attribute("id"); + // remember class + char const *class_attr = item->getRepr()->attribute("class"); // remember title gchar *title = item->title(); // remember description @@ -444,6 +446,8 @@ sp_item_list_to_curves(const std::vector &items, std::vector& // restore id repr->setAttribute("id", id); + // restore class + repr->setAttribute("class", class_attr); // add the new repr to the parent parent->appendChild(repr); SPObject* newObj = document->getObjectByRepr(repr); -- cgit v1.2.3