[gnumeric] maintenance



commit 29f4542a5333c6a71caee8b27294d4534f641143
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Mon Jun 8 08:56:55 2009 -0600

    maintenance
    
    2009-06-08  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/print-info.c (gnm_page_breaks_get_next_manual_break):
    	  fix unsigned issue
    	(gnm_page_breaks_set_break): ditto
    	(gnm_page_breaks_clean): ditto
    
    2009-06-08 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (oo_append_page_break): soft pagebreaks are
    	  stored as text:soft-page-breaks tag (and at this time can only
    	  be included between rows). The "auto" value for break-after
    	  and break-before reflects only the potential of a pagebreak.
    	(oo_page_break_type): ditto
    	* openoffice-write.c (odf_write_sheet): write text:soft-page-breaks
    	  elements at the location of paginated page breaks.
---
 ChangeLog                             |    7 +++++++
 plugins/openoffice/ChangeLog          |   10 ++++++++++
 plugins/openoffice/openoffice-read.c  |    6 ++++--
 plugins/openoffice/openoffice-write.c |    7 ++++++-
 src/print-info.c                      |   12 +++++++-----
 5 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ec40abb..bf0e658 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-08  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/print-info.c (gnm_page_breaks_get_next_manual_break):
+	  fix unsigned issue
+	(gnm_page_breaks_set_break): ditto
+	(gnm_page_breaks_clean): ditto
+
 2009-06-08  Jody Goldberg <jody gnome org>
 
 	* src/go-data-slicer-field.c (go_data_slicer_field_init) : adjust to
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 10bd493..f652f7b 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,13 @@
+2009-06-08 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* openoffice-read.c (oo_append_page_break): soft pagebreaks are
+	  stored as text:soft-page-breaks tag (and at this time can only 
+	  be included between rows). The "auto" value for break-after
+	  and break-before reflects only the potential of a pagebreak.
+	(oo_page_break_type): ditto
+	* openoffice-write.c (odf_write_sheet): write text:soft-page-breaks
+	  elements at the location of paginated page breaks.
+
 2009-06-07 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* openoffice-read.c (oo_append_page_break): add argument and
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 3a35bec..844456d 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -817,7 +817,7 @@ oo_append_page_break (OOParseState *state, int pos, gboolean is_vert, gboolean i
 	}
 	
 	gnm_page_breaks_append_break (breaks, pos, 
-				      is_manual ? GNM_PAGE_BREAK_MANUAL : GNM_PAGE_BREAK_AUTO);
+				      is_manual ? GNM_PAGE_BREAK_MANUAL : GNM_PAGE_BREAK_NONE);
 }
 
 static void
@@ -2318,12 +2318,14 @@ oo_style_prop_cell (GsfXMLIn *xin, xmlChar const **attrs)
 static OOPageBreakType
 oo_page_break_type (GsfXMLIn *xin, xmlChar const *attr)
 {
+	/* Note that truly automatic of soft page breaks are stored */
+	/* via text:soft-page-break tags                            */
 	if (!strcmp (attr, "page"))
 		return OO_PAGE_BREAK_MANUAL;
 	if (!strcmp (attr, "column"))
 		return OO_PAGE_BREAK_MANUAL;
 	if (!strcmp (attr, "auto"))
-		return OO_PAGE_BREAK_AUTO;
+		return OO_PAGE_BREAK_NONE;
 	oo_warning (xin,
 		_("Unknown break type '%s' defaulting to NONE"), attr);
 	return OO_PAGE_BREAK_NONE;
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 8a9f834..882e865 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -42,6 +42,7 @@
 #include <workbook-priv.h> /* Workbook::names */
 #include <cell.h>
 #include <sheet.h>
+#include <print-info.h>
 #include <sheet-view.h>
 #include <sheet-style.h>
 #include <sheet-merge.h>
@@ -1738,7 +1739,7 @@ odf_write_sheet (GnmOOExport *state, Sheet const *sheet)
 	GnmRange  extent;
 	int i, col, row;
 	GSList *sheet_merges = NULL;
-	
+	GnmPageBreaks *pb = sheet->print_info->page_breaks.v;
 
 	extent = sheet_get_extent (sheet, FALSE);
 	sheet_style_get_extent (sheet, &extent, col_styles);
@@ -1766,6 +1767,10 @@ odf_write_sheet (GnmOOExport *state, Sheet const *sheet)
 		int covered_cell = 0;
 		GnmCellPos pos;
 		pos.row = row;
+		if (gnm_page_breaks_get_break (pb, row) != GNM_PAGE_BREAK_NONE)
+			gsf_xml_out_simple_element (state->xml, 
+						    TEXT "soft-page-break", 
+						    NULL);
 
 		gsf_xml_out_start_element (state->xml, TABLE "table-row");
 		write_row_style (state, ci, sheet);
diff --git a/src/print-info.c b/src/print-info.c
index d513597..5ac0ea8 100644
--- a/src/print-info.c
+++ b/src/print-info.c
@@ -1337,7 +1337,7 @@ int
 gnm_page_breaks_get_next_manual_break (GnmPageBreaks *breaks,
 			   int pos)
 {
-	int i;
+	guint i;
 
 	if (breaks == NULL)
 		return -1;
@@ -1359,7 +1359,7 @@ gnm_page_breaks_set_break (GnmPageBreaks *breaks,
 {
 	GnmPageBreak *pbreak;
 	GnmPageBreak info;
-	int i;
+	guint i;
 	int before = -1;
 
 	g_return_val_if_fail (breaks != NULL, FALSE);
@@ -1381,7 +1381,7 @@ gnm_page_breaks_set_break (GnmPageBreaks *breaks,
 			}
 			return TRUE;
 		} else if (pbreak->pos < pos)
-			before = i;
+			before = (int) i;
 	}
 
 	if (type == GNM_PAGE_BREAK_NONE)
@@ -1389,7 +1389,7 @@ gnm_page_breaks_set_break (GnmPageBreaks *breaks,
 
 	info.pos   = pos;
 	info.type  = type;
-	if ((before + 1) > breaks->details->len)
+	if ((before + 1) > (int) breaks->details->len)
 		g_array_append_val (breaks->details, info);
 	else
 		g_array_insert_val (breaks->details, (before + 1), info);
@@ -1411,6 +1411,8 @@ gnm_page_break_type_from_str (char const *str)
 		return GNM_PAGE_BREAK_AUTO;
 	if (0 == g_ascii_strcasecmp (str, "data-slice"))
 		return GNM_PAGE_BREAK_DATA_SLICE;
+	if (0 == g_ascii_strcasecmp (str, "none"))
+		return GNM_PAGE_BREAK_NONE;
 	return GNM_PAGE_BREAK_NONE;
 }
 
@@ -1424,7 +1426,7 @@ gnm_page_break_type_from_str (char const *str)
 void		 
 gnm_page_breaks_clean (GnmPageBreaks *breaks)
 {
-	int i;
+	guint i;
 	for (i = 0; i < breaks->details->len; i++) {
 		GnmPageBreak *pbreak = &g_array_index (breaks->details, 
 						       GnmPageBreak, i);



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