Code

Fix 1633473 (Crash on "Convert to Text")
authorgustav_b <gustav_b@users.sourceforge.net>
Thu, 11 Jan 2007 22:09:44 +0000 (22:09 +0000)
committergustav_b <gustav_b@users.sourceforge.net>
Thu, 11 Jan 2007 22:09:44 +0000 (22:09 +0000)
src/text-chemistry.cpp

index 4ea47fd278fd4caf19e1d9616d5e28126be4c798..91c263584cf7d1a70f062753b9fd28503180124a 100644 (file)
@@ -110,7 +110,17 @@ text_put_on_path()
 
     // if a flowed text is selected, convert it to a regular text object
     if (SP_IS_FLOWTEXT(text)) {
+
+        if (!SP_FLOWTEXT(text)->layout.outputExists()) {
+            sp_desktop_message_stack(desktop)->
+                flash(Inkscape::WARNING_MESSAGE, 
+                      _("The flowed text(s) must be <b>visible</b> in order to be put on a path."));
+        }
+
         Inkscape::XML::Node *repr = SP_FLOWTEXT(text)->getAsText();
+
+        if (!repr) return;
+
         Inkscape::XML::Node *parent = SP_OBJECT_REPR(text)->parent();
         parent->appendChild(repr);
 
@@ -455,9 +465,19 @@ flowtext_to_text()
         if (!SP_IS_FLOWTEXT(item))
             continue;
 
-        did = true;
+        if (!SP_FLOWTEXT(item)->layout.outputExists()) {
+            sp_desktop_message_stack(desktop)->
+                flash(Inkscape::WARNING_MESSAGE, 
+                      _("The flowed text(s) must be <b>visible</b> in order to be converted."));
+            return;
+        }
 
         Inkscape::XML::Node *repr = SP_FLOWTEXT(item)->getAsText();
+
+        if (!repr) break;
+
+        did = true;
+
         Inkscape::XML::Node *parent = SP_OBJECT_REPR(item)->parent();
         parent->appendChild(repr);