diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-04-19 22:16:59 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2019-04-24 13:16:46 +0000 |
| commit | 1633a91c3a1fd6eb4d981d9117c7a4ba96d1f562 (patch) | |
| tree | ace2405514c65b1d40e7395e8e1e37c5399d1066 /src/file-update.cpp | |
| parent | Keep Document Grid spacing on change and save (diff) | |
| download | inkscape-1633a91c3a1fd6eb4d981d9117c7a4ba96d1f562.tar.gz inkscape-1633a91c3a1fd6eb4d981d9117c7a4ba96d1f562.zip | |
Removes style on empty lines
Diffstat (limited to 'src/file-update.cpp')
| -rw-r--r-- | src/file-update.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/file-update.cpp b/src/file-update.cpp index 5489ee499..de2f17ad6 100644 --- a/src/file-update.cpp +++ b/src/file-update.cpp @@ -205,6 +205,26 @@ void sp_file_convert_text_baseline_spacing(SPDocument *doc) sp_file_text_run_recursive(fix_update, doc->getRoot()); } +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(); + } + } +} + + + +void sp_file_remove_style_on_empty_lines(SPDocument *doc) +{ + sp_file_text_run_recursive(_remove_style_on_empty_lines, doc->getRoot()); + sp_file_text_run_recursive(fix_update, doc->getRoot()); +} + + + void sp_file_convert_font_name(SPDocument *doc) { sp_file_text_run_recursive(fix_font_name, doc->getRoot()); |
