diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-04-24 13:16:09 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2019-04-24 13:16:46 +0000 |
| commit | 1446f4eeb37a47231dd45db757454db045049ac6 (patch) | |
| tree | e6f59679f166cb2c93d307c5c6d787abb5e1926e /src/file-update.cpp | |
| parent | Add second Tav fix (diff) | |
| download | inkscape-1446f4eeb37a47231dd45db757454db045049ac6.tar.gz inkscape-1446f4eeb37a47231dd45db757454db045049ac6.zip | |
Add comment, rename function
Diffstat (limited to 'src/file-update.cpp')
| -rw-r--r-- | src/file-update.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/file-update.cpp b/src/file-update.cpp index ff72f9b0e..9f1eafd7f 100644 --- a/src/file-update.cpp +++ b/src/file-update.cpp @@ -205,7 +205,18 @@ 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) + +/** + * Implements a fix for https://gitlab.com/inkscape/inkscape/issues/45 + * Line spacing for empty lines was handled differently before 1.0 + * and in particular with the first empty lines or with how style attributes + * are processed in empty lines (line = tspan with sodipodi:role="line") + * + * This function "fixes" a text element in a old document by removing the + * first empty lines and style attrs on other empty lines. + * + * */ +void _fix_pre_v1_empty_lines(SPObject *o) { std::vector<SPObject *> cl = o->childList(false); bool begin = true; @@ -233,9 +244,9 @@ void _remove_style_on_empty_lines(SPObject *o) -void sp_file_remove_style_on_empty_lines(SPDocument *doc) +void sp_file_fix_empty_lines(SPDocument *doc) { - sp_file_text_run_recursive(_remove_style_on_empty_lines, doc->getRoot()); + sp_file_text_run_recursive(_fix_pre_v1_empty_lines, doc->getRoot()); sp_file_text_run_recursive(fix_update, doc->getRoot()); } |
