[gnumeric] compilation: use new go_foramt_details_* functions.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] compilation: use new go_foramt_details_* functions.
- Date: Thu, 8 Jul 2010 17:04:00 +0000 (UTC)
commit d45a67e2ee5cb06185ec426399cf58f3f178b7eb
Author: Morten Welinder <terra gnome org>
Date: Thu Jul 8 13:03:10 2010 -0400
compilation: use new go_foramt_details_* functions.
ChangeLog | 5 +++++
plugins/fn-string/ChangeLog | 5 +++++
plugins/fn-string/functions.c | 12 +++++++-----
plugins/openoffice/ChangeLog | 5 +++++
plugins/openoffice/openoffice-read.c | 16 +++++++++-------
src/wbc-gtk-actions.c | 11 ++++++-----
6 files changed, 37 insertions(+), 17 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1383de7..25a68fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-08 Morten Welinder <terra gnome org>
+
+ * src/wbc-gtk-actions.c (cb_format_as_currency): Use
+ go_format_details_new and _free.
+
2010-07-08 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/GNOME_Gnumeric-gtk.xml.in: add merge and unmerge menu items
diff --git a/plugins/fn-string/ChangeLog b/plugins/fn-string/ChangeLog
index a0306ab..39f4d5b 100644
--- a/plugins/fn-string/ChangeLog
+++ b/plugins/fn-string/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-08 Morten Welinder <terra gnome org>
+
+ * functions.c (gnumeric_fixed): Use go_format_details_new and
+ _free.
+
2010-07-01 Andreas J. Guelzow <aguelzow pyrshep ca>
* functions.c (help_upper): fix argument mark-up
diff --git a/plugins/fn-string/functions.c b/plugins/fn-string/functions.c
index 6616f13..95f6c28 100644
--- a/plugins/fn-string/functions.c
+++ b/plugins/fn-string/functions.c
@@ -705,7 +705,7 @@ gnumeric_fixed (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
GOFormat *fmt;
GnmValue *v;
char *res;
- GOFormatDetails details;
+ GOFormatDetails *details;
decimals = gnm_fake_trunc (decimals);
if (decimals >= 128)
@@ -721,11 +721,13 @@ gnumeric_fixed (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
v = value_new_float (num);
- go_format_details_init (&details, GO_FORMAT_NUMBER);
- details.num_decimals = decimals;
- details.thousands_sep = !no_commas;
+ details = go_format_details_new (GO_FORMAT_NUMBER);
+ details->num_decimals = decimals;
+ details->thousands_sep = !no_commas;
format = g_string_new (NULL);
- go_format_generate_str (format, &details);
+ go_format_generate_str (format, details);
+ go_format_details_free (details);
+
fmt = go_format_new_from_XL (format->str);
g_string_free (format, TRUE);
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 709c042..b375fc2 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-08 Morten Welinder <terra gnome org>
+
+ * openoffice-read.c (odf_scientific): Use go_format_details_new
+ and _free.
+
2010-06-28 Morten Welinder <terra gnome org>
* Release 1.10.7
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 9476648..20353be 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -2052,30 +2052,32 @@ static void
odf_scientific (GsfXMLIn *xin, xmlChar const **attrs)
{
OOParseState *state = (OOParseState *)xin->user_state;
- GOFormatDetails details;
+ GOFormatDetails *details;
gboolean engineering = FALSE;
/* int min_exp_digits = 1; */
if (state->cur_format.accum == NULL)
return;
- go_format_details_init (&details, GO_FORMAT_SCIENTIFIC);
+ details = go_format_details_new (GO_FORMAT_SCIENTIFIC);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
- if (oo_attr_bool (xin, attrs, OO_NS_NUMBER, "grouping", &details.thousands_sep)) {}
+ if (oo_attr_bool (xin, attrs, OO_NS_NUMBER, "grouping", &details->thousands_sep)) {}
else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_NUMBER, "decimal-places"))
- details.num_decimals = atoi (CXML2C (attrs[1]));
+ details->num_decimals = atoi (CXML2C (attrs[1]));
else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_NUMBER,
"min-integer-digits"))
- details.min_digits = atoi (CXML2C (attrs[1]));
+ details->min_digits = atoi (CXML2C (attrs[1]));
/* else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_NUMBER, */
/* "min-exponent-digits")) */
/* min_exp_digits = atoi (CXML2C (attrs[1])); */
else if (oo_attr_bool (xin, attrs, OO_GNUM_NS_EXT, "engineering",
&engineering));
if (engineering)
- details.exponent_step = 3;
- go_format_generate_str (state->cur_format.accum, &details);
+ details->exponent_step = 3;
+ go_format_generate_str (state->cur_format.accum, details);
+
+ go_format_details_free (details);
}
static void
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index 9342535..8fee648 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1499,14 +1499,15 @@ static GNM_ACTION_DEF (cb_format_as_number)
static GNM_ACTION_DEF (cb_format_as_currency)
{
- GOFormatDetails details;
+ GOFormatDetails *details = go_format_details_new (GO_FORMAT_CURRENCY);
GString *str = g_string_new (NULL);
GOFormat *fmt;
- go_format_details_init (&details, GO_FORMAT_CURRENCY);
- details.currency = go_format_locale_currency ();
- details.num_decimals = 2;
- go_format_generate_str (str, &details);
+ details->currency = go_format_locale_currency ();
+ details->num_decimals = 2;
+ go_format_generate_str (str, details);
+ go_format_details_free (details);
+
fmt = go_format_new_from_XL (str->str);
g_string_free (str, TRUE);
apply_number_format (wbcg, fmt, _("Format as Currency"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]