summaryrefslogtreecommitdiffstats
path: root/src/path-chemistry.cpp
diff options
context:
space:
mode:
authorJoel Holdsworth <joel@airwebreathe.org.uk>2008-03-05 17:17:10 +0000
committerjoelholdsworth <joelholdsworth@users.sourceforge.net>2008-03-05 17:17:10 +0000
commit65960426e78178b2dba3c121f573155a4edf7d3f (patch)
tree263b8130e5137d8792cb36ff3d90a5dbe862709d /src/path-chemistry.cpp
parent* packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gt... (diff)
downloadinkscape-65960426e78178b2dba3c121f573155a4edf7d3f.tar.gz
inkscape-65960426e78178b2dba3c121f573155a4edf7d3f.zip
Bugfix for bug #168283: possible to create empty paths via text -> object to path. Text that produces no glyphs is left unconverted.
(bzr r4967)
Diffstat (limited to 'src/path-chemistry.cpp')
-rw-r--r--src/path-chemistry.cpp8
1 files changed, 8 insertions, 0 deletions
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 */