[goffice] Fix a crash for infinite values in XYZ contour plots. [#841840]



commit 0b77ec611a9766bbf1db5000049ef4166bf80da3
Author: Jean Brefort <jean brefort normalesup org>
Date:   Wed Aug 15 09:55:27 2012 +0200

    Fix a crash for infinite values in XYZ contour plots. [#841840]

 ChangeLog                          |   10 ++++++++++
 NEWS                               |    4 ++++
 goffice/gtk/go-format-sel.c        |   29 +++++++++++++++++++++++++++++
 plugins/plot_surface/gog-contour.c |    8 ++++----
 4 files changed, 47 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 09074c6..03a0544 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-08-15  Chris Leonard  <cjlhomeaddress gmail com>
+
+	* goffice/gtk/go-format-sel.c: add comments for translators to SI units
+	names. [#681813]
+
+2012-08-15  Jean Brefort  <jean brefort normalesup org>
+
+	* plugins/plot_surface/gog-contour.c (gog_contour_view_render): fix a crash
+	for infinite values. [#841840]
+
 2012-08-14  Jean Brefort  <jean brefort normalesup org>
 
 	* plugins/plot_xy/gog-bubble-prefs.ui: one more 3d->3D.
diff --git a/NEWS b/NEWS
index 1c172cc..c0db9a2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.9.6:
 
+Chris Leonard:
+	* Add comments for translators to SI units names. [#681813]
+
 Jean:
 	* Use NAN instead of 0 for XYZ plots when data are missing. [#680486]
 	* Add series name to legend for contour plots. [#680508]
@@ -8,6 +11,7 @@ Jean:
 	* Allow filling to axis limits. [#680513]
 	* Save axis Id for all axes, not only X and Y. [#680739]
 	* Fix strings inconsistencies (3d vs. 3D). [#681777]
+	* Fix a crash for infinite values in XYZ contour plots. [#841840]
 
 Morten:
 	* Minute accuracy improvement to matrix inversion.
diff --git a/goffice/gtk/go-format-sel.c b/goffice/gtk/go-format-sel.c
index 3464380..8cd51b2 100644
--- a/goffice/gtk/go-format-sel.c
+++ b/goffice/gtk/go-format-sel.c
@@ -303,34 +303,63 @@ static struct {
 	char const *unit;
 	int scale;
 } si_units[] = {
+/* See http://en.wikipedia.org/wiki/Ampere */
 	{N_("A (ampere)"), "A", 0},
+/* See http://en.wikipedia.org/wiki/Becquerel */
 	{N_("Bq (becquerel)"), "Bq", 0},
+/* See http://en.wikipedia.org/wiki/Candela */
 	{N_("cd (candela)"), "cd", 0},
+/* See http://en.wikipedia.org/wiki/Coulomb */
 	{N_("C (coulomb)"), "C", 0},
+/* See http://en.wikipedia.org/wiki/Degree_Celsius */
 	{N_("\302\260C (degree Celsius)"), "\302\260C", 0},
+/* See http://en.wikipedia.org/wiki/Farad */
 	{N_("F (farad)"), "F", 0},
+/* See http://en.wikipedia.org/wiki/Gray_%28unit%29 */
 	{N_("Gy (gray)"), "Gy", 0},
+/* See http://en.wikipedia.org/wiki/Henry_%28unit%29 */
 	{N_("H (henry)"), "H", 0},
+/* See http://en.wikipedia.org/wiki/Hertz */
 	{N_("Hz (hertz)"), "Hz", 0},
+/* See http://en.wikipedia.org/wiki/Joule */
 	{N_("J (joule)"), "J", 0},
+/* See http://en.wikipedia.org/wiki/Kelvin */
 	{N_("K (kelvin)"), "K", 0},
+/* See http://en.wikipedia.org/wiki/Kilogram */
 	{N_("kg (kilogram)"), "kg", 3},
+/* See http://en.wikipedia.org/wiki/Lumen_%28unit%29 */
 	{N_("lm (lumen)"), "lm", 0},
+/* See http://en.wikipedia.org/wiki/Lux */
 	{N_("lx (lux)"), "lx", 0},
+/* See http://en.wikipedia.org/wiki/Metre */
 	{N_("m (meter)"), "m", 0},
+/* See http://en.wikipedia.org/wiki/Mole_%28unit%29 */
 	{N_("mol (mole)"), "mol", 0},
+/* See http://en.wikipedia.org/wiki/Newton_%28unit%29 */
 	{N_("N (newton)"), "N", 0},
+/* See http://en.wikipedia.org/wiki/Ohm_%28unit%29 */
 	{N_("\316\251 (ohm)"), "\316\251", 0},
+/* See http://en.wikipedia.org/wiki/Pascal_%28unit%29 */
 	{N_("Pa (pascal)"), "Pa", 0},
+/* See http://en.wikipedia.org/wiki/Radian */
 	{N_("rad (radian)"), "rad", 0},
+/* See http://en.wikipedia.org/wiki/Second */
 	{N_("s (second)"), "s", 0},
+/* See http://en.wikipedia.org/wiki/Siemens_%28unit%29 */
 	{N_("S (siemens)"), "S", 0},
+/* See http://en.wikipedia.org/wiki/Steradian */
 	{N_("sr (steradian)"), "sr", 0},
+/* See http://en.wikipedia.org/wiki/Sievert */
 	{N_("Sv (sievert)"), "Sv", 0},
+/* See http://en.wikipedia.org/wiki/Tesla_%28unit%29 */
 	{N_("T (tesla)"), "T", 0},
+/* See http://en.wikipedia.org/wiki/Katal */
 	{N_("kat (katal)"), "kat", 0},
+/* See http://en.wikipedia.org/wiki/Volt */
 	{N_("V (volt)"), "V", 0},
+/* See http://en.wikipedia.org/wiki/Watt */
 	{N_("W (watt)"), "W", 0},
+/* See http://en.wikipedia.org/wiki/Weber_%28Wb%29 */
 	{N_("Wb (weber)"), "Wb", 0}
 };
 
diff --git a/plugins/plot_surface/gog-contour.c b/plugins/plot_surface/gog-contour.c
index 17e9d19..5ff2c84 100644
--- a/plugins/plot_surface/gog-contour.c
+++ b/plugins/plot_surface/gog-contour.c
@@ -389,7 +389,7 @@ gog_contour_view_render (GogView *view, GogViewAllocation const *bbox)
 			zmin = max;
 			zmax = 0;
 			zval0 = data[(i - 1) * jmax + j - 1];
-			if (!isnan (zval0)) {
+			if (go_finite (zval0)) {
 				z0 = floor (zval0);
 				if (z0 > zmax)
 					zmax = z0;
@@ -402,7 +402,7 @@ gog_contour_view_render (GogView *view, GogViewAllocation const *bbox)
 				nan = 0;
 			}
 			zval1 = data[(i - 1) * jmax + j];
-			if (!isnan (zval1)) {
+			if (go_finite (zval1)) {
 				z1 = floor (zval1);
 				if (z1 > zmax)
 					zmax = z1;
@@ -415,7 +415,7 @@ gog_contour_view_render (GogView *view, GogViewAllocation const *bbox)
 				nan = 1;
 			}
 			zval2 = data[i * jmax + j];
-			if (!isnan (zval2)) {
+			if (go_finite (zval2)) {
 				z2 = floor (zval2);
 				if (z2 > zmax)
 					zmax = z2;
@@ -428,7 +428,7 @@ gog_contour_view_render (GogView *view, GogViewAllocation const *bbox)
 				nan = 2;
 			}
 			zval3 = data[i * jmax + j - 1];
-			if (!isnan (zval3)) {
+			if (go_finite (zval3)) {
 				z3 = floor (zval3);
 				if (z3 > zmax)
 					zmax = z3;



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