[goffice] Fix the handling of scientific number formats with markup in the format selector. [#657187]



commit 82d3401b92b072997180aa449aef2336af93619d
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Tue Aug 23 14:28:52 2011 -0600

    Fix the handling of scientific number formats with markup in the format selector. [#657187]
    
    011-08-23  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* goffice/gtk/go-format-sel.c (study_format): in scientific formatting the
    	selector also handles details->min_digits == 0
    	* goffice/utils/go-format.c (go_format_get_details): EE+ can also occur in
    	scientific formatting

 ChangeLog                   |    7 +++++++
 NEWS                        |    2 ++
 goffice/gtk/go-format-sel.c |    4 +++-
 goffice/utils/go-format.c   |    2 +-
 4 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d154f4f..305ea06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-08-23  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* goffice/gtk/go-format-sel.c (study_format): in scientific formatting the
+	selector also handles details->min_digits == 0
+	* goffice/utils/go-format.c (go_format_get_details): EE+ can also occur in
+	scientific formatting
+
 2011-08-21  Jean Brefort  <jean brefort normalesup org>
 
 	* goffice/canvas/goc-widget.c (goc_widget_notify_scrolled): fix widgets
diff --git a/NEWS b/NEWS
index f55866d..d369d45 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ Andreas:
 	* Fix fraction rendering for unspecified denominators. [#656043]
 	* Fix date format on Windows. [#655573]
 	* Extend encoding specification from file-openers to plugin services.
+	* Fix the handling of scientific number formats with markup in the
+	format selector. [#657187]
 
 Jean:
 	* Port to gtk+-3.0.
diff --git a/goffice/gtk/go-format-sel.c b/goffice/gtk/go-format-sel.c
index 6e75fbf..c154058 100644
--- a/goffice/gtk/go-format-sel.c
+++ b/goffice/gtk/go-format-sel.c
@@ -842,7 +842,9 @@ study_format (GOFormat const *fmt, GOFormatDetails *details)
 		    !details->thousands_sep)
 			exact = FALSE;
 
-		if (details->min_digits != 1)
+		if ((details->min_digits > 1) ||
+		    (details->family != GO_FORMAT_SCIENTIFIC 
+		     && details->min_digits == 0))
 			exact = FALSE;
 	}
 
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index 2a08f76..914fe46 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -5628,7 +5628,7 @@ go_format_get_details (GOFormat const *fmt,
 		if (dst->family == GO_FORMAT_SCIENTIFIC) {
 			const char *epos = strchr (str, 'E');
 			const char *mend = dot ? dot : epos;
-			dst->use_markup = (strstr (str, "EE0") != NULL);
+			dst->use_markup = (strstr (str, "EE") != NULL);
 			dst->exponent_step = mend - str;
 			dst->simplify_mantissa = mend != str && mend[-1] == '#';
 			if (dst->simplify_mantissa)



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