From 5e4318dcf1a5abd6d513e0321c78939d20e6a7f4 Mon Sep 17 00:00:00 2001 From: joelholdsworth Date: Wed, 5 Mar 2008 17:17:10 +0000 Subject: [PATCH] Bugfix for bug #168283: possible to create empty paths via text -> object to path. Text that produces no glyphs is left unconverted. --- src/path-chemistry.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 7466a7066..c71784b57 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -372,6 +372,14 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) if (!curve) return NULL; + // Prevent empty paths from being added to the document + // otherwise we end up with zomby markup in the SVG file + if(curve->end <= 0) + { + sp_curve_unref(curve); + return NULL; + } + Inkscape::XML::Document *xml_doc = SP_OBJECT_REPR(item)->document(); Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); /* Transformation */ -- 2.39.5