Commit ea7581d4 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Use glib 2's g_string_append_len. (calculate_replacement): Ditto.

2002-07-10  Morten Welinder  <terra@diku.dk>

	* src/search.c (search_replace_string): Use glib 2's
	g_string_append_len.
	(calculate_replacement): Ditto.
	(cb_order_sheet_col_row, cb_order_sheet_row_col): Make UTF-8 safe.
parent 766e19e5
2002-07-10 Morten Welinder <terra@diku.dk>
* src/search.c (search_replace_string): Use glib 2's
g_string_append_len.
(calculate_replacement): Ditto.
(cb_order_sheet_col_row, cb_order_sheet_row_col): Make UTF-8 safe.
2002-07-09 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (random_poisson): Fix loop (by switching method).
......
2002-07-10 Morten Welinder <terra@diku.dk>
* src/search.c (search_replace_string): Use glib 2's
g_string_append_len.
(calculate_replacement): Ditto.
(cb_order_sheet_col_row, cb_order_sheet_row_col): Make UTF-8 safe.
2002-07-09 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (random_poisson): Fix loop (by switching method).
......
2002-07-10 Morten Welinder <terra@diku.dk>
* src/search.c (search_replace_string): Use glib 2's
g_string_append_len.
(calculate_replacement): Ditto.
(cb_order_sheet_col_row, cb_order_sheet_row_col): Make UTF-8 safe.
2002-07-09 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (random_poisson): Fix loop (by switching method).
......
......@@ -227,13 +227,13 @@ calculate_replacement (SearchReplace *sr, const char *src, const regmatch_t *pm)
switch (*s) {
case '$':
{
int i;
int n = s[1] - '0';
s++;
g_assert (n > 0 && n <= (int)sr->comp_search->re_nsub);
for (i = pm[n].rm_so; i < pm[n].rm_eo; i++)
g_string_append_c (gres, src[i]);
g_string_append_len (gres,
src + pm[n].rm_so,
pm[n].rm_eo - pm[n].rm_so);
break;
}
case '\\':
......@@ -383,11 +383,8 @@ search_replace_string (SearchReplace *sr, const char *src)
res = g_string_sized_new (size);
}
if (pmatch[0].rm_so) {
int i;
/* This is terrible! */
for (i = 0; i < pmatch[0].rm_so; i++)
g_string_append_c (res, src[i]);
if (pmatch[0].rm_so > 0) {
g_string_append_len (res, src, pmatch[0].rm_so);
}
if (sr->match_words && !match_is_word (sr, src, pmatch,
......@@ -444,7 +441,7 @@ cb_order_sheet_row_col (const void *_a, const void *_b)
int i;
/* By sheet name. FIXME: Any better way than this? */
i = strcmp (a->sheet->name_unquoted, b->sheet->name_unquoted);
i = g_utf8_collate (a->sheet->name_unquoted, b->sheet->name_unquoted);
/* By row number. */
if (!i) i = (a->eval.row - b->eval.row);
......@@ -463,7 +460,7 @@ cb_order_sheet_col_row (const void *_a, const void *_b)
int i;
/* By sheet name. FIXME: Any better way than this? */
i = strcmp (a->sheet->name_unquoted, b->sheet->name_unquoted);
i = g_utf8_collate (a->sheet->name_unquoted, b->sheet->name_unquoted);
/* By column number. */
if (!i) i = (a->eval.col - b->eval.col);
......
......@@ -244,7 +244,6 @@ cb_edit_copy (GtkWidget *widget, BonoboControl *control)
{
WorkbookControlGUI *wbcg = bcontrol_get_wbcg (control);
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
Sheet *sheet;
g_return_if_fail (wbcg != NULL);
......
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