[goffice] Return NULL when an ODF path is empty instead of an empty path.



commit 06a98a25fc8fe5ebf26d370d7e9cc6deed7142e0
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sun Sep 2 10:48:13 2012 +0200

    Return NULL when an ODF path is empty instead of an empty path.

 ChangeLog               |    5 +++++
 goffice/utils/go-path.c |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 71b3224..7e1d511 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-09-02  Jean Brefort  <jean brefort normalesup org>
 
+	* goffice/utils/go-path.c (go_path_new_from_odf_enhanced_path): return NULL
+	when the path is empty.
+
+2012-09-02  Jean Brefort  <jean brefort normalesup org>
+
 	* goffice/graph/gog-axis.c (gog_axis_view_padding_request): accept an
 	axis which parent is not a chart.
 	* goffice/utils/go-path.c (go_path_new_from_odf_enhanced_path): commented.
diff --git a/goffice/utils/go-path.c b/goffice/utils/go-path.c
index 6cba6bd..cdc3b6b 100644
--- a/goffice/utils/go-path.c
+++ b/goffice/utils/go-path.c
@@ -1487,5 +1487,9 @@ go_path_new_from_odf_enhanced_path (char const *src, GHashTable const *variables
 		}
 		skip_spaces (&state);
 	}
+	if (state.path->data_buffer_head->n_actions == 0) {
+		go_path_free (state.path);
+		return NULL;
+	}
 	return state.path;
 }



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