summaryrefslogtreecommitdiffstats
path: root/src/sp-text.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-08-29 12:30:41 +0000
committertavmjong-free <tavmjong@free.fr>2016-08-29 12:30:41 +0000
commit4f0e9e1e2b91c661060f1dcd45deb3dc53c72093 (patch)
treeaa94e1229522d0a4342bd58f740d9d7e008d8ab2 /src/sp-text.cpp
parentCode design. Replacing tabs with spaces, and fixng parentheses warning. (diff)
downloadinkscape-4f0e9e1e2b91c661060f1dcd45deb3dc53c72093.tar.gz
inkscape-4f0e9e1e2b91c661060f1dcd45deb3dc53c72093.zip
Don't write out sodipodi:line-spacing. Don't read if 'line-height' already set.
Partial fix for #1590141. (bzr r15085)
Diffstat (limited to 'src/sp-text.cpp')
-rw-r--r--src/sp-text.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index 9beb812f5..b066ca3de 100644
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
@@ -93,14 +93,16 @@ void SPText::set(unsigned int key, const gchar* value) {
} else {
switch (key) {
case SP_ATTR_SODIPODI_LINESPACING:
- // convert deprecated tag to css
- if (value) {
+ // convert deprecated tag to css... but only if 'line-height' missing.
+ if (value && !this->style->line_height.set) {
this->style->line_height.set = TRUE;
this->style->line_height.inherit = FALSE;
this->style->line_height.normal = FALSE;
this->style->line_height.unit = SP_CSS_UNIT_PERCENT;
this->style->line_height.value = this->style->line_height.computed = sp_svg_read_percentage (value, 1.0);
}
+ // Remove deprecated attribute
+ this->getRepr()->setAttribute("sodipodi:linespacing", NULL);
this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG);
break;
@@ -297,15 +299,6 @@ Inkscape::XML::Node *SPText::write(Inkscape::XML::Document *xml_doc, Inkscape::X
this->attributes.writeTo(repr);
this->rebuildLayout(); // copied from update(), see LP Bug 1339305
- // deprecated attribute, but keep it around for backwards compatibility
- if (this->style->line_height.set && !this->style->line_height.inherit && !this->style->line_height.normal && this->style->line_height.unit == SP_CSS_UNIT_PERCENT) {
- Inkscape::SVGOStringStream os;
- os << (this->style->line_height.value * 100.0) << "%";
- this->getRepr()->setAttribute("sodipodi:linespacing", os.str().c_str());
- } else {
- this->getRepr()->setAttribute("sodipodi:linespacing", NULL);
- }
-
// SVG 2 Auto-wrapped text
if( this->width.computed > 0.0 ) {
sp_repr_set_svg_double(repr, "width", this->width.computed);