From a545384a9246881ba14effeafef924ffc3eca27d Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 20 Apr 2019 01:19:45 +0200 Subject: Fix style and line detection --- src/document.cpp | 2 +- src/file-update.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/document.cpp b/src/document.cpp index 96dce8d2c..f923a45d6 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -451,7 +451,7 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, } /** Fix first line spacing in legacy documents (pre-1.0 files) **/ - if ( sp_version_inside_range( document->root->version.inkscape, 0, 1, 1, 0 ) ) { + if (sp_version_inside_range(document->root->version.inkscape, 0, 1, 1, 0)) { sp_file_remove_style_on_empty_lines(document); } diff --git a/src/file-update.cpp b/src/file-update.cpp index de2f17ad6..84a598f8e 100644 --- a/src/file-update.cpp +++ b/src/file-update.cpp @@ -209,9 +209,10 @@ void _remove_style_on_empty_lines(SPObject *o) { std::vector cl = o->childList(false); for (std::vector::const_iterator ci = cl.begin(); ci != cl.end(); ++ci) { - if (SP_IS_TSPAN(*ci) and (*ci)->childList(false).empty() and (*ci)->getAttribute("sodipodi:role")=="line" ) { - (*ci)->style->clear(); - } + if (SP_IS_TSPAN(*ci) and (*ci)->childList(false).empty() and is_line(*ci)) { + (*ci)->removeAttribute("style"); + (*ci)->updateRepr(); + } } } -- cgit v1.2.3