[goffice] fix recognition of scientific formats with scale == 3
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] fix recognition of scientific formats with scale == 3
- Date: Thu, 1 Dec 2011 18:34:04 +0000 (UTC)
commit ede30ab637a2667eab59579600a8ee2f7a84bcaf
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Thu Dec 1 11:33:06 2011 -0700
fix recognition of scientific formats with scale == 3
2011-12-01 Andreas J. Guelzow <aguelzow pyrshep ca>
* goffice/utils/go-format.c (go_format_get_details): do not
mistake the scale symbol as mantissa
ChangeLog | 5 +++++
goffice/utils/go-format.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 27c8d5d..551a4c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2011-12-01 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * goffice/utils/go-format.c (go_format_get_details): do not
+ mistake the scale symbol as mantissa
+
+2011-12-01 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* goffice/gtk/go-format-sel.c (cb_si_combo_changed): check "Append
this SI unit" button
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index 115233f..e8fef85 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -6167,10 +6167,11 @@ 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;
+ const char *scale_pos = strstr (str, "'E");
+ const char *mend = dot ? dot : (scale_pos ? scale_pos : epos);
dst->append_SI = (strstr (str, "ESI") != NULL);
dst->use_markup = (strstr (str, "EE") != NULL);
- dst->scale = ((strstr (str, "'E") != NULL) ? 3 : 0);
+ dst->scale = ((scale_pos != NULL) ? 3 : 0);
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]