aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text/e-text-model.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-12 00:17:41 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-12 00:17:41 +0800
commit69b2e6d8eee098cf070e9797dd9d9bfde933d21f (patch)
tree819983f4074e2b418733dcd90b7493205e4ec188 /widgets/text/e-text-model.c
parentae61b9ce6897122308ec0224daec94182467ce23 (diff)
downloadgsoc2013-evolution-69b2e6d8eee098cf070e9797dd9d9bfde933d21f.tar.gz
gsoc2013-evolution-69b2e6d8eee098cf070e9797dd9d9bfde933d21f.tar.zst
gsoc2013-evolution-69b2e6d8eee098cf070e9797dd9d9bfde933d21f.zip
Use e_strdup_append_strings here instead of g_strdup_printf because
2001-10-11 Christopher James Lahey <clahey@ximian.com> * gal/e-text/e-table-text-model.c (e_table_text_model_insert, e_table_text_model_insert_length, e_table_text_model_delete), gal/e-text/e-text-model.c (e_text_model_real_insert, e_text_model_real_insert_length): Use e_strdup_append_strings here instead of g_strdup_printf because printf("%.*s") is locale dependent on some systems. * gal/util/e-util.c (e_strdup_append_strings): New function to append a bunch of strings with optional lengths. svn path=/trunk/; revision=13581
Diffstat (limited to 'widgets/text/e-text-model.c')
-rw-r--r--widgets/text/e-text-model.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c
index 97eb2a9a86..929247ed4e 100644
--- a/widgets/text/e-text-model.c
+++ b/widgets/text/e-text-model.c
@@ -268,7 +268,12 @@ e_text_model_real_insert (ETextModel *model, gint position, const gchar *text)
if (length <= 0)
return;
- new_text = g_strdup_printf ("%.*s%.*s%s", position, model->priv->text, length, text, model->priv->text + position);
+ /* Can't use g_strdup_printf here because on some systems
+ printf ("%.*s"); is locale dependent. */
+ new_text = e_strdup_append_strings (model->priv->text, position,
+ text, length,
+ model->priv->text + position, -1,
+ NULL);
if (model->priv->text)
g_free (model->priv->text);
@@ -301,7 +306,12 @@ e_text_model_real_insert_length (ETextModel *model, gint position, const gchar *
if (length <= 0)
return;
- new_text = g_strdup_printf ("%.*s%.*s%s", position, model->priv->text, length, text, model->priv->text + position);
+ /* Can't use g_strdup_printf here because on some systems
+ printf ("%.*s"); is locale dependent. */
+ new_text = e_strdup_append_strings (model->priv->text, position,
+ text, length,
+ model->priv->text + position, -1,
+ NULL);
if (model->priv->text)
g_free (model->priv->text);