Code

fix crash when setting letterspacing at the end of a non-tspanned text
authorbuliabyak <buliabyak@users.sourceforge.net>
Sat, 21 Jan 2006 03:45:50 +0000 (03:45 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sat, 21 Jan 2006 03:45:50 +0000 (03:45 +0000)
src/text-editing.cpp

index 91182b37f47be707454ec1b28c4fe83923ba5ac2..44450f8fa7e39a7281c72b85f872f9cf84d44adc 100644 (file)
@@ -879,10 +879,13 @@ sp_te_adjust_tspan_letterspacing_screen(SPItem *text, Inkscape::Text::Layout::it
     SPObject *source_obj;
     unsigned nb_let;
     layout->getSourceOfCharacter(std::min(start, end), (void**)&source_obj);
-    if (source_obj == NULL)    // end of text
+
+    if (source_obj == NULL) {   // end of text
         source_obj = text->lastChild();
-    else if (SP_IS_STRING(source_obj))
+    }
+    if (SP_IS_STRING(source_obj)) {
         source_obj = source_obj->parent;
+    }
 
     SPStyle *style = SP_OBJECT_STYLE (source_obj);