[goffice] GOFormat: fix problem resulting in "-0".



commit 0f98e7530aca34e32e951244484b240c7578db4e
Author: Morten Welinder <terra gnome org>
Date:   Tue May 24 09:20:59 2011 -0400

    GOFormat: fix problem resulting in "-0".

 ChangeLog                 |    5 +++++
 NEWS                      |    1 +
 goffice/utils/go-format.c |    7 ++++++-
 3 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ad44258..225492f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-24  Morten Welinder  <terra gnome org>
+
+	* goffice/utils/go-format.c (go_format_execute): Remove "-" from
+	"-0" even when no dot is present.  Fixes #650928.
+
 2011-05-23  Morten Welinder  <terra gnome org>
 
 	* goffice/math/go-complex.c (go_complex_invalid)
diff --git a/NEWS b/NEWS
index 8108fa9..c4190fb 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ goffice 0.8.16:
 Morten:
 	* Fix long-double compilation issue.
 	* Improve accuracy of complex power.
+	* Fix GOFormat problem resulting in "-0".  [#650928]
 
 --------------------------------------------------------------------------
 goffice 0.8.15:
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index fa5c358..6c62419 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -2899,8 +2899,13 @@ SUFFIX(go_format_execute) (PangoLayout *layout, GString *dst,
 					g_string_erase (numtxt, 0, 1);
 					dotpos--;
 				}
-			} else
+			} else {
+				if (numtxt->str[0] == '-' &&
+				    numtxt->str[1] == '0' &&
+				    numtxt->len == 2)
+					g_string_erase (numtxt, 0, 1);
 				dotpos = numtxt->len;
+			}
 			break;
 		}
 



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