]> git.tokkee.org Git - inkscape.git/commitdiff

Code

Bugfix for bug #168283: possible to create empty paths via text -> object to path...
authorjoelholdsworth <joelholdsworth@users.sourceforge.net>
Wed, 5 Mar 2008 17:17:10 +0000 (17:17 +0000)
committerjoelholdsworth <joelholdsworth@users.sourceforge.net>
Wed, 5 Mar 2008 17:17:10 +0000 (17:17 +0000)
src/path-chemistry.cpp

index 7466a706626b7e7df57141cfc6f7a0658d2a1ecb..c71784b57eec2807ff28c51c5edba7716e2e2dd0 100644 (file)
@@ -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 */