Commit 08171d37 authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

store page breaks if requested

2009-06-07  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* src/print-info.h (gnm_page_breaks_clean): new
	* src/print-info.c(gnm_page_breaks_clean): new
	* src/print.c (paginate): store page breaks if requested
	(compute_sheet_pages): clear page breaks if storage of new ones
	  is requested
parent 37c3feec
......@@ -476,12 +476,13 @@ Architecture Changes
17) Explicit Page Breaks
17.1) Store them in PrintInfo (DONE)
17.2) Respect them
17.3.3) ODF
17.2.5.1) Import (DONE)
17.2.5.2) Export {merge breaks and styles}
17.3.4) Lotus ?
17.3.5) Applix ?
17.2) Respect them (DONE)
17.3.3) ODF
17.3.3.1) Import (DONE)
17.3.3.2) Export {merge breaks and styles}
17.3.4) Lotus ?
17.3.5) Applix ?
17.3.6) Create User Interface for them
2) stf {Andreas/Morten}
2.1) UTF-8 cleanliness (DONE)
......@@ -814,7 +815,7 @@ Architecture Changes
38) Printing
38.1) cell text wraps differently when printing than
displaying due to scaling differences in font size. (DONE)
38.2) explicit page breaks
38.2) explicit page breaks (DONE)
38.3) PI:comment_placement
38.4) PI:display_errors
......
2009-06-07 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/print-info.h (gnm_page_breaks_clean): new
* src/print-info.c(gnm_page_breaks_clean): new
* src/print.c (paginate): store page breaks if requested
(compute_sheet_pages): clear page breaks if storage of new ones
is requested
2009-06-07 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/print-info.h (gnm_page_breaks_set_break): new
......
......@@ -1413,3 +1413,24 @@ gnm_page_break_type_from_str (char const *str)
return GNM_PAGE_BREAK_DATA_SLICE;
return GNM_PAGE_BREAK_NONE;
}
/**
*
* Remove all auto page breaks
*
**/
void
gnm_page_breaks_clean (GnmPageBreaks *breaks)
{
int i;
for (i = 0; i < breaks->details->len; i++) {
GnmPageBreak *pbreak = &g_array_index (breaks->details,
GnmPageBreak, i);
if (pbreak->type == GNM_PAGE_BREAK_AUTO) {
g_array_remove_index (breaks->details, i);
i--;
}
}
}
......@@ -174,6 +174,7 @@ void print_info_set_breaks (PrintInformation *pi, GnmPageBreaks *breaks);
GnmPageBreaks *gnm_page_breaks_new (gboolean is_vert);
GnmPageBreaks *gnm_page_breaks_dup (GnmPageBreaks const *src);
void gnm_page_breaks_free (GnmPageBreaks *breaks);
void gnm_page_breaks_clean (GnmPageBreaks *breaks);
gboolean gnm_page_breaks_append_break (GnmPageBreaks *breaks,
int pos,
GnmPageBreakType type);
......
......@@ -696,6 +696,8 @@ paginate (GSList **paginationInfo,
page_count++;
rc += count;
if (store_breaks && (rc < n_end))
gnm_page_breaks_set_break (pb, rc, GNM_PAGE_BREAK_AUTO);
}
}
......@@ -952,6 +954,11 @@ compute_sheet_pages (GtkPrintContext *context,
repeat_left_start = repeat_left_use ? r.start.col : 0;
repeat_left_end = repeat_left_use ? r.end.col : 0;
if (pi->ignore_pb) {
gnm_page_breaks_clean (pinfo->page_breaks.h);
gnm_page_breaks_clean (pinfo->page_breaks.v);
}
if (pinfo->scaling.type == PRINT_SCALE_FIT_PAGES) {
/* Note that the resulting scale is independent from */
/* whether we print first down or across! */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment