summaryrefslogtreecommitdiffstats
path: root/src/widgets/text-toolbar.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-02-01 20:03:54 +0000
committertavmjong-free <tavmjong@free.fr>2017-02-01 20:03:54 +0000
commitf1ddd1e70dbd780b0620bb86682ac0b55db0afce (patch)
tree2341a6791dac54782952195cf7b67e00de0fbe19 /src/widgets/text-toolbar.cpp
parentAvoid crash when opening files containing hrefs with invalid "file:" URIs (diff)
downloadinkscape-f1ddd1e70dbd780b0620bb86682ac0b55db0afce.tar.gz
inkscape-f1ddd1e70dbd780b0620bb86682ac0b55db0afce.zip
Prevent display units from effecting 'line-height' unit.
Allow relative units to be saved in preferences for 'line-height'. Fixed bugs: - https://launchpad.net/bugs/1562217 (bzr r15462)
Diffstat (limited to 'src/widgets/text-toolbar.cpp')
-rw-r--r--src/widgets/text-toolbar.cpp36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp
index ba79517d2..a0435f690 100644
--- a/src/widgets/text-toolbar.cpp
+++ b/src/widgets/text-toolbar.cpp
@@ -588,17 +588,14 @@ static void sp_text_lineheight_value_changed( GtkAdjustment *adj, GObject *tbl )
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- // Only save if not relative unit
- if ( !is_relative(unit) ) {
- // This nonsense is to get SP_CSS_UNIT_xx value corresponding to unit so
- // we can save it (allows us to adjust line height value when unit changes).
- SPILength temp_length;
- Inkscape::CSSOStringStream temp_stream;
- temp_stream << 1 << unit->abbr;
- temp_length.read(temp_stream.str().c_str());
- prefs->setInt("/tools/text/lineheight/display_unit", temp_length.unit);
- g_object_set_data( tbl, "lineheight_unit", GINT_TO_POINTER(temp_length.unit));
- }
+ // This nonsense is to get SP_CSS_UNIT_xx value corresponding to unit so
+ // we can save it (allows us to adjust line height value when unit changes).
+ SPILength temp_length;
+ Inkscape::CSSOStringStream temp_stream;
+ temp_stream << 1 << unit->abbr;
+ temp_length.read(temp_stream.str().c_str());
+ prefs->setInt("/tools/text/lineheight/display_unit", temp_length.unit);
+ g_object_set_data( tbl, "lineheight_unit", GINT_TO_POINTER(temp_length.unit));
// Set css line height.
SPCSSAttr *css = sp_repr_css_attr_new ();
@@ -701,16 +698,13 @@ static void sp_text_lineheight_unit_changed( gpointer /* */, GObject *tbl )
g_return_if_fail(unit != NULL);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- // Only save if not relative unit
- if ( !is_relative(unit) ) {
- // This nonsense is to get SP_CSS_UNIT_xx value corresponding to unit.
- SPILength temp_length;
- Inkscape::CSSOStringStream temp_stream;
- temp_stream << 1 << unit->abbr;
- temp_length.read(temp_stream.str().c_str());
- prefs->setInt("/tools/text/lineheight/display_unit", temp_length.unit);
- g_object_set_data( tbl, "lineheight_unit", GINT_TO_POINTER(temp_length.unit));
- }
+ // This nonsense is to get SP_CSS_UNIT_xx value corresponding to unit.
+ SPILength temp_length;
+ Inkscape::CSSOStringStream temp_stream;
+ temp_stream << 1 << unit->abbr;
+ temp_length.read(temp_stream.str().c_str());
+ prefs->setInt("/tools/text/lineheight/display_unit", temp_length.unit);
+ g_object_set_data( tbl, "lineheight_unit", GINT_TO_POINTER(temp_length.unit));
// Read current line height value
EgeAdjustmentAction *line_height_act =