summaryrefslogtreecommitdiffstats
path: root/src/file-update.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-04-21 15:30:39 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2019-04-24 13:16:46 +0000
commit39fb9702333606bc43cb831121b688077831832b (patch)
tree1713cc668c04759b73b5f1fa6b1cd85f98f52df0 /src/file-update.cpp
parentFix style and line detection (diff)
downloadinkscape-39fb9702333606bc43cb831121b688077831832b.tar.gz
inkscape-39fb9702333606bc43cb831121b688077831832b.zip
Add second Tav fix
Diffstat (limited to 'src/file-update.cpp')
-rw-r--r--src/file-update.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/file-update.cpp b/src/file-update.cpp
index 84a598f8e..ff72f9b0e 100644
--- a/src/file-update.cpp
+++ b/src/file-update.cpp
@@ -208,11 +208,26 @@ void sp_file_convert_text_baseline_spacing(SPDocument *doc)
void _remove_style_on_empty_lines(SPObject *o)
{
std::vector<SPObject *> cl = o->childList(false);
+ bool begin = true;
+ std::string cur_y = "";
for (std::vector<SPObject *>::const_iterator ci = cl.begin(); ci != cl.end(); ++ci) {
- if (SP_IS_TSPAN(*ci) and (*ci)->childList(false).empty() and is_line(*ci)) {
+ if (!SP_IS_TSPAN(*ci))
+ continue;
+ if (!is_line(*ci))
+ continue;
+ if (!(*ci)->childList(false).empty()) {
+ if (begin)
+ cur_y = (*ci)->getAttribute("y") ? (*ci)->getAttribute("y") : cur_y;
+ begin = false;
+ } else {
(*ci)->removeAttribute("style");
(*ci)->updateRepr();
+ if (begin) {
+ (*ci)->deleteObject();
+ }
}
+ if (cur_y != "")
+ o->setAttribute("y", cur_y);
}
}