[goffice] Handle some more unusual formats in ODF export. [#683801]



commit 60e70aa8d20da0ceb504d9da7cc758756ab0e99c
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Tue Sep 11 16:25:56 2012 -0600

    Handle some more unusual formats in ODF export. [#683801]
    
    2012-09-11 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* goffice/utils/go-format.c (go_format_output_to_odf): try to improve
    	ODF export of unidentified formats.

 ChangeLog                 |    5 +++++
 NEWS                      |    3 +++
 goffice/utils/go-format.c |   16 +++++++++++++---
 3 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3bbf820..ca808b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-11 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* goffice/utils/go-format.c (go_format_output_to_odf): try to improve
+	ODF export of unidentified formats.
+
 2012-09-09  Jean Brefort  <jean brefort normalesup org>
 
 	* goffice/graph/gog-equation.c (gog_equation_update): fix warning,
diff --git a/NEWS b/NEWS
index e04772c..306bed4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.9.7:
 
+Andreas:
+	* Handle some more unusual formats in ODF export. [#683801]
+
 --------------------------------------------------------------------------
 goffice 0.9.6:
 
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index c34ef1e..a11c53f 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -1,3 +1,4 @@
+/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * go-format.c :
  *
@@ -8622,7 +8623,8 @@ go_format_output_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
 	default: {
 		/* We need to output something and we don't need any details for this */
 		int date = 0, digit = 0;
-		char const *str = go_format_as_XL (fmt);
+		char const *fstr, *str = go_format_as_XL (fmt);
+		fstr = str;
 		while (*str != '\0') {
 			switch (*str) {
 			case 'd': case 'm': case 'y': case 'h': case 's':
@@ -8639,8 +8641,16 @@ go_format_output_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
 		if (digit < date)
 			go_format_output_date_to_odf (xout, act_fmt, name,
 						      GO_FORMAT_DATE, with_extension);
-		else
-			go_format_output_general_to_odf (xout, name, cond_part);
+		else {
+			/* We have a format that we can't identify */
+			/* The following is really only appropriate for "" or so */
+			gsf_xml_out_start_element (xout, NUMBER "number-style");
+			gsf_xml_out_add_cstr (xout, STYLE "name", name);
+			gsf_xml_out_start_element (xout, NUMBER "text");
+			gsf_xml_out_add_cstr (xout, NULL, fstr);
+			gsf_xml_out_end_element (xout); /* </number:text> */
+			gsf_xml_out_end_element (xout); /* </number:number-style> */
+		}
 		result = FALSE;
 		break;
 	}



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