[goffice] fix min-denominator-digits



commit 1f94d663f79f7997382a1c7c4a7a19e16a8528a9
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Mon Jun 1 02:19:32 2009 -0600

    fix min-denominator-digits
    
    2009-06-01  Andreas J. Guelzow  <aguelzow pyrshep ca>
    
    	* goffice/utils/go-format.c (go_format_output_fraction_to_odf):
    	  fix min-denominator-digits
---
 ChangeLog                 |    5 +++++
 goffice/utils/go-format.c |    9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 40bb5fc..b98ff07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 2009-06-01  Andreas J. Guelzow  <aguelzow pyrshep ca>
 
 	* goffice/utils/go-format.c (go_format_output_fraction_to_odf):
+	  fix min-denominator-digits
+	
+2009-06-01  Andreas J. Guelzow  <aguelzow pyrshep ca>
+
+	* goffice/utils/go-format.c (go_format_output_fraction_to_odf):
 	  indicate when number:text are again possible
 
 2009-06-01  Andreas J. Guelzow  <aguelzow pyrshep ca>
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index 745a6d1..0c23c9c 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -5923,13 +5923,18 @@ go_format_output_fraction_to_odf (GsfXMLOut *xout, GOFormat const *fmt, char con
 				if (g_ascii_isdigit (*xl)) digits ++;
 				xl++; i++;
 			}
+			if (!g_ascii_isdigit (*(xl - 1)))
+				zeroes++;
 
 			gsf_xml_out_start_element (xout, NUMBER "fraction");
 			odf_add_bool (xout, NUMBER "grouping", FALSE);
-			if ((fixed_denominator > 0) && (digits == i))
+			if ((fixed_denominator > 0) && (digits == i)) {
 				gsf_xml_out_add_int (xout, NUMBER "denominator-value", 
 						     fixed_denominator);
-			gsf_xml_out_add_int (xout, NUMBER "min-denominator-digits", i);
+				gsf_xml_out_add_int (xout, NUMBER "min-denominator-digits", digits);
+			} else 
+				gsf_xml_out_add_int (xout, NUMBER "min-denominator-digits", zeroes);
+			gsf_xml_out_add_int (xout, GNMSTYLE "max-denominator-digits", i);
 			
 			if (int_digits >= 0)
 				gsf_xml_out_add_int (xout, NUMBER "min-integer-digits", int_digits);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]