SF.net SVN: geany: [2625] trunk/src/printing.c
eht16 at users.sourceforge.net
eht16 at xxxxx
Thu May 29 17:31:41 UTC 2008
Revision: 2625
http://geany.svn.sourceforge.net/geany/?rev=2625&view=rev
Author: eht16
Date: 2008-05-29 10:31:27 -0700 (Thu, 29 May 2008)
Log Message:
-----------
Fix build with GTK >= 2.10.
Modified Paths:
--------------
trunk/src/printing.c
Modified: trunk/src/printing.c
===================================================================
--- trunk/src/printing.c 2008-05-29 17:00:54 UTC (rev 2624)
+++ trunk/src/printing.c 2008-05-29 17:31:27 UTC (rev 2625)
@@ -213,7 +213,7 @@
gint lines = 1;
gint line_width;
- line_buf = sci_get_line(doc_list[dinfo->idx].sci, j);
+ line_buf = sci_get_line(documents[dinfo->idx]->sci, j);
line_width = (g_utf8_strlen(line_buf, -1) + 1) * dinfo->font_width;
if (line_width > width)
lines = ceil(line_width / width);
@@ -240,8 +240,8 @@
gint ph_height = dinfo->line_height * 3;
gchar *data;
gchar *datetime;
- gchar *tmp_file_name = (doc_list[dinfo->idx].file_name != NULL) ?
- doc_list[dinfo->idx].file_name : GEANY_STRING_UNTITLED;
+ gchar *tmp_file_name = (documents[dinfo->idx]->file_name != NULL) ?
+ documents[dinfo->idx]->file_name : GEANY_STRING_UNTITLED;
gchar *file_name = (printing_prefs.page_header_basename) ?
g_path_get_basename(tmp_file_name) : g_strdup(tmp_file_name);
@@ -430,7 +430,7 @@
desc = pango_font_description_from_string(interface_prefs.editor_font);
/* init dinfo fields */
- dinfo->lines = sci_get_line_count(doc_list[dinfo->idx].sci);
+ dinfo->lines = sci_get_line_count(documents[dinfo->idx]->sci);
dinfo->lines_per_page = 0;
dinfo->cur_line = 0;
dinfo->cur_pos = 0;
@@ -446,7 +446,7 @@
dinfo->n_pages = get_page_count(context, dinfo);
/* read all styles from Scintilla */
- style_max = pow(2, scintilla_send_message(doc_list[dinfo->idx].sci, SCI_GETSTYLEBITS, 0, 0));
+ style_max = pow(2, scintilla_send_message(documents[dinfo->idx]->sci, SCI_GETSTYLEBITS, 0, 0));
/* if the lexer uses only the first 32 styles(style bits = 5),
* we need to add the pre-defined styles */
if (style_max == 32)
@@ -454,21 +454,21 @@
for (i = 0; i < style_max; i++)
{
dinfo->styles[i][FORE] = ROTATE_RGB(scintilla_send_message(
- doc_list[dinfo->idx].sci, SCI_STYLEGETFORE, i, 0));
+ documents[dinfo->idx]->sci, SCI_STYLEGETFORE, i, 0));
if (i == STYLE_LINENUMBER)
{ /* ignore background colour for line number margin to avoid trouble with wrapped lines */
dinfo->styles[STYLE_LINENUMBER][BACK] = ROTATE_RGB(scintilla_send_message(
- doc_list[dinfo->idx].sci, SCI_STYLEGETBACK, STYLE_DEFAULT, 0));
+ documents[dinfo->idx]->sci, SCI_STYLEGETBACK, STYLE_DEFAULT, 0));
}
else
{
dinfo->styles[i][BACK] = ROTATE_RGB(scintilla_send_message(
- doc_list[dinfo->idx].sci, SCI_STYLEGETBACK, i, 0));
+ documents[dinfo->idx]->sci, SCI_STYLEGETBACK, i, 0));
}
dinfo->styles[i][BOLD] =
- scintilla_send_message(doc_list[dinfo->idx].sci, SCI_STYLEGETBOLD, i, 0);
+ scintilla_send_message(documents[dinfo->idx]->sci, SCI_STYLEGETBOLD, i, 0);
dinfo->styles[i][ITALIC] =
- scintilla_send_message(doc_list[dinfo->idx].sci, SCI_STYLEGETITALIC, i, 0);
+ scintilla_send_message(documents[dinfo->idx]->sci, SCI_STYLEGETITALIC, i, 0);
}
if (dinfo->n_pages >= 0)
@@ -562,8 +562,8 @@
/* data */
else
{
- style = sci_get_style_at(doc_list[dinfo->idx].sci, dinfo->cur_pos);
- c = sci_get_char_at(doc_list[dinfo->idx].sci, dinfo->cur_pos);
+ style = sci_get_style_at(documents[dinfo->idx]->sci, dinfo->cur_pos);
+ c = sci_get_char_at(documents[dinfo->idx]->sci, dinfo->cur_pos);
if (c == '\0' || style == -1)
{ /* if c gets 0, we are probably out of document boundaries,
* so stop to break out of outer loop */
@@ -583,7 +583,7 @@
/* don't add line breaks, they are handled manually below */
else if (c == '\r' || c == '\n')
{
- gchar c_next = sci_get_char_at(doc_list[dinfo->idx].sci, dinfo->cur_pos);
+ gchar c_next = sci_get_char_at(documents[dinfo->idx]->sci, dinfo->cur_pos);
at_eol = TRUE;
if (c == '\r' && c_next == '\n')
dinfo->cur_pos++; /* skip LF part of CR/LF */
@@ -599,7 +599,7 @@
* style doesn't change since it is only one character with multiple bytes. */
while (c < 0)
{
- c = sci_get_char_at(doc_list[dinfo->idx].sci, dinfo->cur_pos);
+ c = sci_get_char_at(documents[dinfo->idx]->sci, dinfo->cur_pos);
if (c < 0)
{ /* only add the byte when it is part of the UTF-8 character
* otherwise we could add e.g. a '\n' and it won't be visible in the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list