summaryrefslogtreecommitdiffstats
path: root/src/file-update.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-04-19 22:16:59 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2019-04-24 13:16:46 +0000
commit1633a91c3a1fd6eb4d981d9117c7a4ba96d1f562 (patch)
treeace2405514c65b1d40e7395e8e1e37c5399d1066 /src/file-update.cpp
parentKeep Document Grid spacing on change and save (diff)
downloadinkscape-1633a91c3a1fd6eb4d981d9117c7a4ba96d1f562.tar.gz
inkscape-1633a91c3a1fd6eb4d981d9117c7a4ba96d1f562.zip
Removes style on empty lines
Diffstat (limited to 'src/file-update.cpp')
-rw-r--r--src/file-update.cpp20
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());