diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index 67319bdec4ba803a4bac8fd85279a5d1c972c492..d9f7408356c350688cfa7a2a997a48ca084a5ba0 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -479,8 +479,10 @@ static void insert_text_fallback( Inkscape::XML::Node *repr, SPDocument *origina text->layout.getSourceOfCharacter(it, &source_obj, &span_text_start_iter); // Set tspan style - Glib::ustring style_text = (dynamic_cast(source_obj) ? source_obj->parent : source_obj)->style->write( SP_STYLE_FLAG_IFDIFF, SP_STYLE_SRC_UNSET, text->style); - if (!style_text.empty()) { + SPObject *style_source_obj = dynamic_cast(source_obj) ? source_obj->parent : source_obj; + if (style_source_obj != text) { + auto style_text = + style_source_obj->style->write(SP_STYLE_FLAG_IFDIFF, SP_STYLE_SRC_UNSET, text->style); span_tspan->setAttributeOrRemoveIfEmpty("style", style_text); }