[gnumeric] GOFormat: deal with goffice changes.
- From: Morten Welinder <mortenw src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] GOFormat: deal with goffice changes.
- Date: Tue, 2 Jun 2009 11:55:48 -0400 (EDT)
commit 9fae2b6d3518a1cb24d334334c6fa9af55529ae5
Author: Morten Welinder <terra gnome org>
Date: Tue Jun 2 11:55:31 2009 -0400
GOFormat: deal with goffice changes.
---
ChangeLog | 5 +++++
plugins/openoffice/ChangeLog | 5 +++++
plugins/openoffice/openoffice-read.c | 15 ++++++++++-----
src/wbc-gtk-actions.c | 9 ++++++---
4 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9025e44..4ea76a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-02 Morten Welinder <terra gnome org>
+
+ * src/wbc-gtk-actions.c (cb_format_as_currency): Deal with goffice
+ changes.
+
2009-05-30 Morten Welinder <terra gnome org>
* src/xml-sax-read.c (xml_sax_cell_content): Don't check
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index b19f07b..6a2a467 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-02 Morten Welinder <terra gnome org>
+
+ * openoffice-read.c (odf_format_generate_number_str): Handle
+ min_digits too.
+
2009-06-02 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-read.c (oo_style_prop_cell): Use an older PANGO_WEIGHT
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index c90bf1f..f4eb489 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -1744,10 +1744,11 @@ odf_format_generate_number_str (GString *dst,
g_string_append_c (dst, '0');
}
- go_format_generate_number_str (dst, num_decimals,
- (min_i_digits <= 1) && thousands_sep,
- negative_red, negative_paren,
- prefix, postfix);
+ go_format_generate_number_str (dst, min_i_digits,
+ num_decimals,
+ (min_i_digits <= 1) && thousands_sep,
+ negative_red, negative_paren,
+ prefix, postfix);
}
static void
@@ -1788,6 +1789,7 @@ static void
odf_scientific (GsfXMLIn *xin, xmlChar const **attrs)
{
OOParseState *state = (OOParseState *)xin->user_state;
+ GOFormatDetails details;
/* gboolean grouping = FALSE; */
int decimal_places = 2;
/* int min_int_digits = 1; */
@@ -1808,7 +1810,10 @@ odf_scientific (GsfXMLIn *xin, xmlChar const **attrs)
/* "min-exponent-digits")) */
/* min_exp_digits = atoi (CXML2C (attrs[1])); */
- go_format_generate_scientific_str (state->accum_fmt, decimal_places, 1, FALSE, FALSE);
+ go_format_details_init (&details, GO_FORMAT_SCIENTIFIC);
+ details.num_decimals = decimal_places;
+
+ go_format_generate_str (state->accum_fmt, &details);
}
static void
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index 0444300..cf65d41 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1424,11 +1424,14 @@ static GNM_ACTION_DEF (cb_format_as_number)
static GNM_ACTION_DEF (cb_format_as_currency)
{
- GOFormatCurrency const *currency = go_format_locale_currency ();
+ GOFormatDetails details;
GString *str = g_string_new (NULL);
GOFormat *fmt;
- go_format_generate_currency_str (str, 2, TRUE, FALSE, FALSE,
- currency, FALSE);
+
+ go_format_details_init (&details, GO_FORMAT_CURRENCY);
+ details.currency = go_format_locale_currency ();
+ details.num_decimals = 2;
+ go_format_generate_str (str, &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]