From 38b555df8904aa2732b5a74ed8044d3280aea164 Mon Sep 17 00:00:00 2001 From: tavmjong-free Date: Sun, 16 May 2010 20:52:17 +0200 Subject: [PATCH] Text toolbar: Write out deprecated sodipodi:linespacing attribute (otherwise new line-height value gets overwritten by old linespacing value if text duplicated). "Fixes" 575829. Add calls to sp_document_maybe_done for dx, dy, rotate attributes. --- src/widgets/toolbox.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 62af61943..2c129f02c 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -6776,6 +6776,16 @@ static void sp_text_lineheight_value_changed( GtkAdjustment *adj, GObject *tbl ) SPDesktop *desktop = SP_ACTIVE_DESKTOP; sp_desktop_set_style (desktop, css, true, true); + + // Until deprecated sodipodi:linespacing purged: + Inkscape::Selection *selection = sp_desktop_selection(desktop); + GSList const *items = selection->itemList(); + for (; items != NULL; items = items->next) { + if (SP_IS_TEXT (items->data)) { + SP_OBJECT_REPR(items->data)->setAttribute("sodipodi:linespacing", sp_repr_css_property (css, "line-height", NULL)); + } + } + // Save for undo sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:line-height", SP_VERB_NONE, _("Text: Change line-height")); @@ -6899,6 +6909,10 @@ static void sp_text_dx_value_changed( GtkAdjustment *adj, GObject *tbl ) } } + // Save for undo + sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:dx", SP_VERB_NONE, + _("Text: Change dx (kern)")); + g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); } @@ -6926,6 +6940,10 @@ static void sp_text_dy_value_changed( GtkAdjustment *adj, GObject *tbl ) } } + // Save for undo + sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:dy", SP_VERB_NONE, + _("Text: Change dy")); + g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); } @@ -6953,6 +6971,10 @@ static void sp_text_rotation_value_changed( GtkAdjustment *adj, GObject *tbl ) } } + // Save for undo + sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:rotate", SP_VERB_NONE, + _("Text: Change rotate")); + g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); } -- 2.30.2