Commit fc051484 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

resync with cell-draw.


2000-07-26  Jody Goldberg <jgoldberg@home.com>

	* src/print-cell.c (print_cell) : resync with cell-draw.

2000-07-25  Jody Goldberg <jgoldberg@home.com>

	* src/workbook.c (change_displayed_zoom_cb) : Fix typo.

	* src/workbook-edit.c (workbook_start_editing_at_cursor) : Don't start
	  editing if we are already editing.
parent 5dadf2b9
2000-07-26 Jody Goldberg <jgoldberg@home.com>
* src/print-cell.c (print_cell) : resync with cell-draw.
2000-07-25 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (change_displayed_zoom_cb) : Fix typo.
* src/workbook-edit.c (workbook_start_editing_at_cursor) : Don't start
editing if we are already editing.
2000-07-16 James R. Van Zandt <jrv@vanzandt.mv.com>
......
2000-07-26 Jody Goldberg <jgoldberg@home.com>
* src/print-cell.c (print_cell) : resync with cell-draw.
2000-07-25 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (change_displayed_zoom_cb) : Fix typo.
* src/workbook-edit.c (workbook_start_editing_at_cursor) : Don't start
editing if we are already editing.
2000-07-16 James R. Van Zandt <jrv@vanzandt.mv.com>
......
2000-07-26 Jody Goldberg <jgoldberg@home.com>
* src/print-cell.c (print_cell) : resync with cell-draw.
2000-07-25 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (change_displayed_zoom_cb) : Fix typo.
* src/workbook-edit.c (workbook_start_editing_at_cursor) : Don't start
editing if we are already editing.
2000-07-16 James R. Van Zandt <jrv@vanzandt.mv.com>
......
2000-07-26 Jody Goldberg <jgoldberg@home.com>
* src/print-cell.c (print_cell) : resync with cell-draw.
2000-07-25 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (change_displayed_zoom_cb) : Fix typo.
* src/workbook-edit.c (workbook_start_editing_at_cursor) : Don't start
editing if we are already editing.
2000-07-16 James R. Van Zandt <jrv@vanzandt.mv.com>
......
2000-07-26 Jody Goldberg <jgoldberg@home.com>
* src/print-cell.c (print_cell) : resync with cell-draw.
2000-07-25 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (change_displayed_zoom_cb) : Fix typo.
* src/workbook-edit.c (workbook_start_editing_at_cursor) : Don't start
editing if we are already editing.
2000-07-16 James R. Van Zandt <jrv@vanzandt.mv.com>
......
2000-07-26 Jody Goldberg <jgoldberg@home.com>
* src/print-cell.c (print_cell) : resync with cell-draw.
2000-07-25 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (change_displayed_zoom_cb) : Fix typo.
* src/workbook-edit.c (workbook_start_editing_at_cursor) : Don't start
editing if we are already editing.
2000-07-16 James R. Van Zandt <jrv@vanzandt.mv.com>
......
2000-07-26 Jody Goldberg <jgoldberg@home.com>
* src/print-cell.c (print_cell) : resync with cell-draw.
2000-07-25 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (change_displayed_zoom_cb) : Fix typo.
* src/workbook-edit.c (workbook_start_editing_at_cursor) : Don't start
editing if we are already editing.
2000-07-16 James R. Van Zandt <jrv@vanzandt.mv.com>
......
2000-07-25 Jody Goldberg <jgoldberg@home.com>
* latex.c (latex_fprint_string) : New function split from
latex_printf.
(latex_fprintf_cell) : Renamed from latex_printf,
(html_write_wb_latex) : Use latex_fprint_string for sheet name.
(html_write_wb_latex2e) : Ditto.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
......
......@@ -32,47 +32,45 @@
/*
* escape special characters
*/
static int
latex_fprintf (FILE *fp, const Cell *cell)
static void
latex_fprint_string (FILE *fp, char const *str)
{
int len, i;
const char *p;
char * s;
for (; *str ; str++) {
switch (*str) {
case '>':
case '<':
fprintf (fp, "$%c$", *str);
continue;
if (cell_is_blank (cell))
return 0;
case '&':
case '_':
case '%':
case '"':
case '$':
case '#':
fputc ('\\', fp);
s = cell_get_rendered_text (cell);
len = strlen (s);
p = s;
for (i = 0; i < len; i++) {
switch (*p) {
case '>':
case '<':
fprintf (fp, "$%c$", *p);
break;
case '&':
case '_':
case '%':
case '"':
case '$':
case '#':
fprintf (fp, "\\%c", *p);
break;
default:
fprintf (fp, "%c", *p);
break;
default :
}
p++;
fputc ((unsigned char)*str, fp);
}
}
static void
latex_fprintf_cell (FILE *fp, const Cell *cell)
{
char *s;
if (cell_is_blank (cell))
return;
s = cell_get_rendered_text (cell);
latex_fprint_string (fp, s);
g_free (s);
return len;
}
/*
* write every sheet of the workbook to a latex table
*
* FIXME: Should latex quote sheet name (and everything else)
*/
int
html_write_wb_latex (CommandContext *context, Workbook *wb,
......@@ -100,9 +98,10 @@ html_write_wb_latex (CommandContext *context, Workbook *wb,
sheet_list = workbook_sheets (wb);
while (sheet_list) {
sheet = sheet_list->data;
fprintf (fp, "%s\n\n", sheet->name_unquoted);
latex_fprint_string (fp, sheet->name_unquoted);
fprintf (fp, "\n\n");
fprintf (fp, "\\begin{tabular}{|");
for (col = 0; col < sheet->cols.max_used; col++) {
for (col = 0; col <= sheet->cols.max_used; col++) {
fprintf (fp, "l|");
}
fprintf (fp, "}\\hline\n");
......@@ -141,7 +140,7 @@ html_write_wb_latex (CommandContext *context, Workbook *wb,
fprintf (fp, "{\\bf ");
if (mstyle_get_font_italic (mstyle))
fprintf (fp, "{\\em ");
latex_fprintf (fp, cell);
latex_fprintf_cell (fp, cell);
if (mstyle_get_font_italic (mstyle))
fprintf (fp, "}");
if (mstyle_get_font_bold (mstyle))
......@@ -200,7 +199,8 @@ html_write_wb_latex2e (CommandContext *context, Workbook *wb,
sheet_list = workbook_sheets (wb);
while (sheet_list) {
sheet = sheet_list->data;
fprintf (fp, "%s\n\n", sheet->name_unquoted);
latex_fprint_string (fp, sheet->name_unquoted);
fprintf (fp, "\n\n");
fprintf (fp, "\\begin{tabular}{|");
for (col = 0; col <= sheet->cols.max_used; col++) {
fprintf (fp, "l|");
......@@ -243,7 +243,7 @@ html_write_wb_latex2e (CommandContext *context, Workbook *wb,
fprintf (fp, "\\textbf{");
if (mstyle_get_font_italic (mstyle))
fprintf (fp, "{\\em ");
latex_fprintf (fp, cell);
latex_fprintf_cell (fp, cell);
if (mstyle_get_font_italic (mstyle))
fprintf (fp, "}");
if (mstyle_get_font_bold (mstyle))
......
......@@ -444,7 +444,7 @@ print_cell (Cell const *cell, MStyle *mstyle, CellSpanInfo const * const spaninf
}
print_text (context,
x1 + x_offset, text_base + y_offset, str,
x1 + x_offset, y1 + y_offset, str,
len, line_offset, num_lines);
y_offset -= inter_space;
......
......@@ -198,6 +198,9 @@ workbook_start_editing_at_cursor (Workbook *wb, gboolean blankp,
g_return_if_fail (wb != NULL);
if (wb->editing)
return;
/* Avoid recursion, and do not begin editing if a guru is up */
if (inside_editing || workbook_edit_has_guru (wb))
return;
......
......@@ -2454,11 +2454,11 @@ static void
change_displayed_zoom_cb (GtkObject *unused, Sheet* sheet, gpointer data)
{
Workbook* wb = (Workbook*)data;
GtkWidget *combo;
gchar *str;
int factor = (int) (sheet->last_zoom_factor_used * 100);
GtkWidget *combo = wb->priv->zoom_entry;
g_return_if_fail (combo = wb->priv->zoom_entry);
g_return_if_fail (combo != NULL);
str = g_strdup_printf("%d%%", factor);
......
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