From 65960426e78178b2dba3c121f573155a4edf7d3f Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 5 Mar 2008 17:17:10 +0000 Subject: Bugfix for bug #168283: possible to create empty paths via text -> object to path. Text that produces no glyphs is left unconverted. (bzr r4967) --- src/path-chemistry.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/path-chemistry.cpp') 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 */ -- cgit v1.2.3