From: John Darrington Date: Tue, 28 Jul 2009 04:46:24 +0000 (+0200) Subject: Fix clipboard export of non-ascii strings. X-Git-Tag: build37~24 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edf539fc797fedcdf7a71894f707d3c9728335d6;p=pspp-builds.git Fix clipboard export of non-ascii strings. Fixed problem pasting sheet data from psppire to openoffice.org and gnumeric which contained non-ascii characters. Tested with openoffice.org 2.4 and gnumeric 1.8.3 --- diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index aa511e93..ec7263af 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -1620,6 +1620,7 @@ data_sheet_set_clip (PsppireSheet *sheet) /* Construct clip dictionary. */ clip_dict = dict_create (); + dict_set_encoding (clip_dict, dict_get_encoding (ds->dict->dict)); for (i = range.col0; i <= range.coli; i++) { const struct variable *old = dict_get_var (ds->dict->dict, i); @@ -1719,9 +1720,11 @@ clip_to_html (void) const casenumber case_cnt = casereader_get_case_cnt (clip_datasheet); const size_t var_cnt = dict_get_var_cnt (clip_dict); - /* Guestimate the size needed */ - string = g_string_sized_new (20 * val_cnt * case_cnt); + string = g_string_sized_new (80 + 20 * val_cnt * case_cnt); + + g_string_append (string, + "\n"); g_string_append (string, "\n"); for (r = 0 ; r < case_cnt ; ++r )