diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-04-19 23:19:45 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2019-04-24 13:16:46 +0000 |
| commit | a545384a9246881ba14effeafef924ffc3eca27d (patch) | |
| tree | ba26bdced3b917bd68ec665c541af40392beffec /src | |
| parent | Removes style on empty lines (diff) | |
| download | inkscape-a545384a9246881ba14effeafef924ffc3eca27d.tar.gz inkscape-a545384a9246881ba14effeafef924ffc3eca27d.zip | |
Fix style and line detection
Diffstat (limited to 'src')
| -rw-r--r-- | src/document.cpp | 2 | ||||
| -rw-r--r-- | src/file-update.cpp | 7 |
2 files changed, 5 insertions, 4 deletions
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<SPObject *> cl = o->childList(false); for (std::vector<SPObject *>::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(); + } } } |
