[gnumeric] warn if we drop part of a validation condition



commit 2d0f8fd2af4be0fad1e8fd503c6c6d89fd16a7cf
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Sun May 15 09:13:21 2011 -0600

    warn if we drop part of a validation condition
    
    2011-05-13  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (odf_validations_analyze): warn if we drop part of a validation condition

 plugins/openoffice/ChangeLog         |    4 ++++
 plugins/openoffice/openoffice-read.c |   11 ++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 7739ae1..de42bd6 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,9 @@
 2011-05-13  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* openoffice-read.c (odf_validations_analyze): warn if we drop part of a validation condition
+
+2011-05-13  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* openoffice-read.c (opendoc_content_dtd): add CELL_ANNOTATION_TEXT_LINE_BREAK,
 	* openoffice-write.c (odf_validation_general): new stub
 	(odf_validation_length): new stub
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 49a8958..1dc8756 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -1704,12 +1704,17 @@ odf_validations_analyze (GsfXMLIn *xin, odf_validation_t *val, guint offset, Val
 		return odf_validations_analyze 
 			(xin, val, str - val->condition + strlen ("cell-content-is-time() and"), 
 			 VALIDATION_TYPE_AS_TIME);		
-	else if (g_str_has_prefix (str, "is-true-formula"))
-		/* What do we do if vtype != VALIDATION_TYPE_ANY ?*/
+	else if (g_str_has_prefix (str, "is-true-formula")) {
+		if (vtype != VALIDATION_TYPE_ANY) {
+			oo_warning
+			(xin, _("Validation condition '%s' is not supported. "
+				"It has been changed to '%s'."),
+			 val->condition, str);
+		}
 		return odf_validation_new_single_expr
 			(xin, val, str + strlen ("is-true-formula"), VALIDATION_TYPE_CUSTOM, 
 			 VALIDATION_OP_NONE);
-	else if (g_str_has_prefix (str, "cell-content()"))
+	} else if (g_str_has_prefix (str, "cell-content()"))
 		return odf_validation_new_op
 			(xin, val, str - val->condition + strlen ("cell-content()"), 
 			 vtype);



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