[gnumeric] GUI: Fix format-as-currency. Eliminate use of go_format_builtins.
- From: Morten Welinder <mortenw src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] GUI: Fix format-as-currency. Eliminate use of go_format_builtins.
- Date: Thu, 28 May 2009 11:24:56 -0400 (EDT)
commit 51fd6f3367fd04fa9138cdb3320f4c3c2c45563c
Author: Morten Welinder <terra gnome org>
Date: Thu May 28 11:24:16 2009 -0400
GUI: Fix format-as-currency. Eliminate use of go_format_builtins.
---
ChangeLog | 4 ++++
NEWS | 1 +
src/wbc-gtk-actions.c | 9 ++++++++-
3 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5a17f58..67685ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-28 Morten Welinder <terra gnome org>
+
+ * src/wbc-gtk-actions.c (cb_format_as_currency): Fix.
+
2009-05-28 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/sheet-object-cell-comment.c (cell_comment_prep_sax_parser):
diff --git a/NEWS b/NEWS
index fcca606..db2a5de 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Andreas:
Morten:
* Add search-for-number.
+ * Fix format-as-currency action.
--------------------------------------------------------------------------
Gnumeric 1.9.8
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index 1826e26..cbd11b4 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1420,7 +1420,14 @@ static GNM_ACTION_DEF (cb_format_as_number)
static GNM_ACTION_DEF (cb_format_as_currency)
{
- GOFormat *fmt = go_format_new_from_XL (go_format_builtins[GO_FORMAT_CURRENCY][0]);
+ GOFormatCurrency const *currency = go_format_locale_currency ();
+ GString *str = g_string_new (NULL);
+ GOFormat *fmt;
+ go_format_generate_currency_str (str, 2, TRUE, FALSE, FALSE,
+ currency, FALSE);
+ fmt = go_format_new_from_XL (str->str);
+ g_string_free (str, TRUE);
+ apply_number_format (wbcg, fmt, _("Format as Currency"));
go_format_unref (fmt);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]