Commit 67836fc7 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

delete. (excel_iconv_open_for_import) : realize that 1200 and 1201 are

2002-08-17  Jody Goldberg <jody@gnome.org>

	* ms-excel-util.c (get_locale_charset_name) : delete.
	(excel_iconv_open_for_import) : realize that 1200 and 1201 are both
	  unicode and that we only want to convert to utf8.
	(excel_wcstombs) : die die die.  We may need this again one day when
	  exporting utf8 back to xl 95.  But we'll cross that bridge when we
	  come to it.

	* ms-excel-read.c (get_chars) : internally text should always be utf8.
	(ms_excel_read_workbook) : fix the warning.
	  I've found some references for the code pages.

2002-08-17  Jody Goldberg <jody@gnome.org>

	* src/xml-io.c (xml_probe) : clear the sax routines so that it is
	  actually quiet.

2002-08-16  Jody Goldberg <jody@gnome.org>

	* src/gui-clipboard.c (x_clipboard_received) : tidy up a bit and
	  prepare to receive utf8.
parent 6e7dd887
2002-08-17 Jody Goldberg <jody@gnome.org>
* src/xml-io.c (xml_probe) : clear the sax routines so that it is
actually quiet.
2002-08-16 Jody Goldberg <jody@gnome.org>
* src/gui-clipboard.c (x_clipboard_received) : tidy up a bit and
prepare to receive utf8.
2002-08-16 Jon K Hellan <hellan@acm.org>
* src/xml-io.h (gnumeric_xml_read_workbook): Declare.
......@@ -22,6 +32,21 @@
2002-08-14 Jody Goldberg <jody@gnome.org>
* gnumeric.keys.in (application) : convert to use gnumeric_icondir
* src/workbook-control-gui.c (workbook_control_gui_ctor_class) : move
the default icon init here.
* src/libgnumeric.c (gnm_common_init) : from here. I'd like to make
this non-gui. That will take a fair amount of cleanup, but it
should be doable.
2002-08-14 Jody Goldberg <jody@gnome.org>
* src/gui-util.c (gnumeric_load_image) : Use gtk_image_new_from_file
directly.
* src/xml-io.c (xml_read_cell) : make the warning more informative.
* src/workbook-control-component.c (wbcc_set_sensitive) : fix warning.
* src/rendered-value.c (rendered_value_calc_size_ext) : some utf8
......
......@@ -41,7 +41,7 @@ gnumeric_version="$(VERSION)"
endif
gnumeric.keys: gnumeric.keys.in Makefile
sed -e 's^\@icondir\@^$(appicondir)^g' < $(srcdir)/gnumeric.keys.in > gnumeric.keys.tmp \
sed -e 's^\@gnumeric_icondir\@^$(gnumeric_icondir)^g' < $(srcdir)/gnumeric.keys.in > gnumeric.keys.tmp \
&& mv gnumeric.keys.tmp gnumeric.keys
dist-hook: gnumeric.spec
......
......@@ -6,6 +6,11 @@ dorami@bu.iij4u.or.jp:
Jody:
* Add XL for polygon colours.
* More pango work.
* Fix icon assignment.
* Support pasting utf8
* Rewrite plan perfect import, significantly more useful now.
Includes some format transfer and uses the wordperfect
charset map from kword (thanks to Ariya Hidayat)
Jukka:
* Solver improvements:
......
2002-08-17 Jody Goldberg <jody@gnome.org>
* src/xml-io.c (xml_probe) : clear the sax routines so that it is
actually quiet.
2002-08-16 Jody Goldberg <jody@gnome.org>
* src/gui-clipboard.c (x_clipboard_received) : tidy up a bit and
prepare to receive utf8.
2002-08-16 Jon K Hellan <hellan@acm.org>
* src/xml-io.h (gnumeric_xml_read_workbook): Declare.
......@@ -22,6 +32,21 @@
2002-08-14 Jody Goldberg <jody@gnome.org>
* gnumeric.keys.in (application) : convert to use gnumeric_icondir
* src/workbook-control-gui.c (workbook_control_gui_ctor_class) : move
the default icon init here.
* src/libgnumeric.c (gnm_common_init) : from here. I'd like to make
this non-gui. That will take a fair amount of cleanup, but it
should be doable.
2002-08-14 Jody Goldberg <jody@gnome.org>
* src/gui-util.c (gnumeric_load_image) : Use gtk_image_new_from_file
directly.
* src/xml-io.c (xml_read_cell) : make the warning more informative.
* src/workbook-control-component.c (wbcc_set_sensitive) : fix warning.
* src/rendered-value.c (rendered_value_calc_size_ext) : some utf8
......
2002-08-17 Jody Goldberg <jody@gnome.org>
* src/xml-io.c (xml_probe) : clear the sax routines so that it is
actually quiet.
2002-08-16 Jody Goldberg <jody@gnome.org>
* src/gui-clipboard.c (x_clipboard_received) : tidy up a bit and
prepare to receive utf8.
2002-08-16 Jon K Hellan <hellan@acm.org>
* src/xml-io.h (gnumeric_xml_read_workbook): Declare.
......@@ -22,6 +32,21 @@
2002-08-14 Jody Goldberg <jody@gnome.org>
* gnumeric.keys.in (application) : convert to use gnumeric_icondir
* src/workbook-control-gui.c (workbook_control_gui_ctor_class) : move
the default icon init here.
* src/libgnumeric.c (gnm_common_init) : from here. I'd like to make
this non-gui. That will take a fair amount of cleanup, but it
should be doable.
2002-08-14 Jody Goldberg <jody@gnome.org>
* src/gui-util.c (gnumeric_load_image) : Use gtk_image_new_from_file
directly.
* src/xml-io.c (xml_read_cell) : make the warning more informative.
* src/workbook-control-component.c (wbcc_set_sensitive) : fix warning.
* src/rendered-value.c (rendered_value_calc_size_ext) : some utf8
......
......@@ -524,6 +524,7 @@ if test "x$try_bonobo" = "xtrue"; then
libbonobo-2.0 >= 1.115.0
libbonoboui-2.0
bonobo-activation-2.0
libgsf-gnome-1 >= 1.3.0
],
[bonobo_msg="yes"],
[bonobo_msg="NO. xxx problem"])
......
application/x-gnumeric:
open=gnumeric %f
view=gnumeric %f
icon-filename=@icondir@/gnome-application-x-gnumeric.png
icon-filename=@gnumeric_icondir@/gnome-application-x-gnumeric.png
application/vnd.ms-excel:
open=gnumeric %f
view=gnumeric %f
icon-filename=@icondir@/gnome-application-x-xls.png
icon-filename=@gnumeric_icondir@/gnome-application-x-xls.png
application/vnd.lotus-1-2-3:
open=gnumeric %f
view=gnumeric %f
icon-filename=@icondir@/gnome-application-vnd.lotus-1-2-3.png
icon-filename=@gnumeric_icondir@/gnome-application-vnd.lotus-1-2-3.png
application/x-applix-spreadsheet
open=gnumeric %f
view=gnumeric %f
icon-filename=@icondir@/gnome-application-x-applix-spreadsheet.png
icon-filename=@gnumeric_icondir@/gnome-application-x-applix-spreadsheet.png
application/x-oleo
open=gnumeric %f
view=gnumeric %f
icon-filename=@icondir@/gnome-application-x-generic-spreadsheet.png
icon-filename=@gnumeric_icondir@/gnome-application-x-generic-spreadsheet.png
application/x-xbase
open=gnumeric %f
view=gnumeric %f
icon-filename=@icondir@/gnome-application-x-generic-spreadsheet.png
icon-filename=@gnumeric_icondir@/gnome-application-x-generic-spreadsheet.png
iconsdir = $(datadir)/pixmaps/gnumeric
iconsdir = $(gnumeric_icondir)
# keep in sync with gnumeric/src/libgnumeric.c:gnm_common_init
appicondir = $(datadir)/pixmaps
appicon_DATA = gnome-gnumeric.png \
gnome-application-x-gnumeric.png \
......
2002-08-17 Jody Goldberg <jody@gnome.org>
* ms-excel-util.c (get_locale_charset_name) : delete.
(excel_iconv_open_for_import) : realize that 1200 and 1201 are both
unicode and that we only want to convert to utf8.
(excel_wcstombs) : die die die. We may need this again one day when
exporting utf8 back to xl 95. But we'll cross that bridge when we
come to it.
* ms-excel-read.c (get_chars) : internally text should always be utf8.
(ms_excel_read_workbook) : fix the warning.
I've found some references for the code pages.
2002-08-16 Jon K Hellan <hellan@acm.org>
* ms-excel-read.c (ms_excel_read_SUPBOOK): Shut up warning.
......
......@@ -670,48 +670,28 @@ get_xtn_lens (guint32 *pre_len, guint32 *end_len, guint8 const *ptr, gboolean ex
}
static char *
get_chars (char const *ptr, guint length, gboolean high_byte)
get_chars (char const *ptr, guint length, gboolean use_utf16)
{
char* ans;
guint32 lp;
if (high_byte) {
wchar_t* wc = g_new (wchar_t, length + 2);
size_t retlength;
ans = g_new (char, (length + 2) * 8);
unsigned i;
for (lp = 0; lp < length; lp++) {
guint16 c = GSF_LE_GET_GUINT16 (ptr);
ptr += 2;
wc[lp] = c;
}
if (use_utf16) {
gunichar2 *uni_text = g_alloca (sizeof (gunichar2)*length);
retlength = excel_wcstombs (ans, wc, length);
g_free (wc);
if (retlength == (size_t)-1)
retlength = 0;
ans[retlength] = 0;
ans = g_realloc (ans, retlength + 2);
for (i = 0; i < length; i++, ptr += 2)
uni_text [i] = GSF_LE_GET_GUINT16 (ptr);
ans = g_utf16_to_utf8 (uni_text, length, NULL, NULL, NULL);
} else {
size_t inbytes = length,
outbytes = (length + 2) * 8,
retlength;
char* inbuf = g_new (char, length), *outbufptr;
char const * inbufptr = inbuf;
ans = g_new (char, outbytes + 1);
outbufptr = ans;
for (lp = 0; lp < length; lp++) {
inbuf[lp] = GSF_LE_GET_GUINT8 (ptr);
ptr++;
}
size_t outbytes = (length + 2) * 8;
char *outbuf = g_new (char, outbytes + 1);
ans = outbuf;
excel_iconv (current_workbook_iconv,
&inbufptr, &inbytes, &outbufptr, &outbytes);
&ptr, &length, &outbuf, &outbytes);
retlength = outbufptr-ans;
ans[retlength] = 0;
ans = g_realloc (ans, retlength + 1);
g_free (inbuf);
i = outbuf - ans;
ans [i] = 0;
ans = g_realloc (ans, i + 1);
}
return ans;
}
......@@ -730,7 +710,7 @@ biff_get_text (guint8 const *pos, guint32 length, guint32 *byte_length)
guint8 const *ptr;
guint32 byte_len;
gboolean header;
gboolean high_byte;
gboolean use_utf16;
gboolean ext_str;
gboolean rich_str;
......@@ -739,8 +719,9 @@ biff_get_text (guint8 const *pos, guint32 length, guint32 *byte_length)
*byte_length = 0;
if (!length) {
/* FIXME FIXME FIXME: What about the 1 byte for the header?
* The length may be wrong in this case.
/* NOTE : This is WRONG in some cases. There is also the 1
* byte header which is sometimes part of the count and
* sometimes not.
*/
return 0;
}
......@@ -751,7 +732,7 @@ biff_get_text (guint8 const *pos, guint32 length, guint32 *byte_length)
});
header = biff_string_get_flags (pos,
&high_byte,
&use_utf16,
&ext_str,
&rich_str);
if (header) {
......@@ -771,7 +752,7 @@ biff_get_text (guint8 const *pos, guint32 length, guint32 *byte_length)
d (4, {
printf ("String len %d, byte length %d: %d %d %d:\n",
length, (*byte_length), high_byte, rich_str, ext_str);
length, (*byte_length), use_utf16, rich_str, ext_str);
gsf_mem_dump (pos, *byte_length);
});
......@@ -780,8 +761,8 @@ biff_get_text (guint8 const *pos, guint32 length, guint32 *byte_length)
ans = g_new (char, 2);
g_warning ("Warning unterminated string floating.");
} else {
(*byte_length) += (high_byte ? 2 : 1)*length;
ans = get_chars ((char *) ptr, length, high_byte);
(*byte_length) += (use_utf16 ? 2 : 1)*length;
ans = get_chars ((char *) ptr, length, use_utf16);
}
return ans;
}
......@@ -819,7 +800,7 @@ sst_read_string (char **output, BiffQuery *q, guint32 offset)
guint32 total_end_len;
/* Will be localy scoped when gdb gets its act together */
gboolean header;
gboolean high_byte;
gboolean use_utf16;
gboolean ext_str = FALSE;
gboolean rich_str = FALSE;
guint32 chars_left;
......@@ -841,7 +822,7 @@ sst_read_string (char **output, BiffQuery *q, guint32 offset)
new_offset = sst_bound_check (q, new_offset);
header = biff_string_get_flags (q->data + new_offset,
&high_byte,
&use_utf16,
&ext_str,
&rich_str);
if (!header) {
......@@ -856,7 +837,7 @@ sst_read_string (char **output, BiffQuery *q, guint32 offset)
total_end_len += end_len;
/* the - end_len is an educated guess based on insufficient data */
chars_left = (q->length - new_offset - pre_len) / (high_byte ? 2 : 1);
chars_left = (q->length - new_offset - pre_len) / (use_utf16 ? 2 : 1);
if (chars_left > total_len)
get_len = total_len;
else
......@@ -865,8 +846,8 @@ sst_read_string (char **output, BiffQuery *q, guint32 offset)
g_assert (get_len >= 0);
/* FIXME: split this simple bit out of here, it makes more sense damnit */
str = get_chars ((char *)(q->data + new_offset + pre_len), get_len, high_byte);
new_offset += pre_len + get_len * (high_byte ? 2 : 1);
str = get_chars ((char *)(q->data + new_offset + pre_len), get_len, use_utf16);
new_offset += pre_len + get_len * (use_utf16 ? 2 : 1);
if (!(*output))
*output = str;
......@@ -4778,7 +4759,7 @@ ms_excel_read_workbook (IOContext *context, WorkbookView *wb_view,
int current_sheet = 0;
char *problem_loading = NULL;
gboolean stop_loading = FALSE;
gboolean prev_was_eof;
gboolean prev_was_eof = FALSE;
io_progress_message (context, _("Reading file..."));
#warning Possible overflow
......@@ -4914,12 +4895,11 @@ ms_excel_read_workbook (IOContext *context, WorkbookView *wb_view,
case 0x8000:
puts ("CodePage = Apple Macintosh");
break;
case 0x04e4:
case 1252:
puts ("CodePage = ANSI (Microsoft Windows)");
break;
case 0x04b0:
/* FIXME FIXME: This is a guess */
puts ("CodePage = Auto");
case 1200:
puts ("CodePage = little endian unicode");
break;
default:
printf ("CodePage = UNKNOWN(%hx)\n",
......
This diff is collapsed.
......@@ -79,12 +79,6 @@ void excel_iconv_close (excel_iconv_t handle);
size_t excel_iconv (excel_iconv_t handle, char const **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft);
/* Same as wcstombs(3), but tries to convert as much characters as possible,
* replacing the ones it can't convert with '?' or something resembling
* original character (e.g. "(C)" for copyright sign).
*/
size_t excel_wcstombs(char* outbuf,wchar_t* wc,size_t length);
void destroy_xl_font_widths (void);
#endif
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gui-clipboard.c: Implements the X11 based copy/paste operations
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
* Jody Goldberg (jody@gnome.org)
*/
#include <gnumeric-config.h>
#include "gnumeric.h"
......@@ -39,12 +41,11 @@
static CellRegion *
x_clipboard_to_cell_region (WorkbookControlGUI *wbcg,
const guchar *src, int len)
guchar const *src, int len)
{
DialogStfResult_t *dialogresult;
CellRegion *cr = NULL;
char *data;
char const *c;
data = g_new (char, len + 1);
memcpy (data, src, len);
......@@ -56,19 +57,6 @@ x_clipboard_to_cell_region (WorkbookControlGUI *wbcg,
return cellregion_new (NULL);
}
if ((c = stf_parse_is_valid_data (data, len)) != NULL) {
char *message;
message = g_strdup_printf (_("The data on the clipboard does not seem to be valid text.\nThe character '%c' (ASCII decimal %d) was encountered.\nMost likely your locale settings are wrong."),
*c, (int) ((unsigned char)*c));
g_warning (message);
g_free (message);
g_free (data);
return cellregion_new (NULL);
}
/*
* See if this is a "single line + line end" or a "multiline"
* string. If this is _not_ the case we won't invoke the STF, it is
......@@ -145,26 +133,31 @@ x_clipboard_to_cell_region (WorkbookControlGUI *wbcg,
*/
static void
x_clipboard_received (GtkClipboard *clipboard, GtkSelectionData *sel,
WorkbookControlGUI *wbcg)
gpointer closure)
{
GdkAtom atom_targets = gdk_atom_intern (TARGETS_ATOM_NAME, FALSE);
GdkAtom atom_gnumeric = gdk_atom_intern (GNUMERIC_ATOM_NAME, FALSE);
GdkAtom atom_html = gdk_atom_intern ("text/html", FALSE);
PasteTarget *pt = wbcg->clipboard_paste_callback_data;
WorkbookControlGUI *wbcg = closure;
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
PasteTarget *pt = wbcg->clipboard_paste_callback_data;
CellRegion *content = NULL;
gboolean region_pastable = FALSE;
gboolean free_closure = FALSE;
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
if (sel->target == atom_targets) { /* The data is a list of atoms */
GdkAtom *atoms = (GdkAtom *) sel->data;
gboolean gnumeric_format, html_format;
int atom_count = (sel->length / sizeof (GdkAtom));
int i;
gboolean clear_content = FALSE;
/* The data is a list of atoms */
if (sel->target == gdk_atom_intern (TARGETS_ATOM_NAME, FALSE)) {
/* in order of preference */
static char const *formats [] = {
GNUMERIC_ATOM_NAME,
/* "text/html", */
"UTF8_STRING",
"COMPOUND_TEXT",
NULL
};
GdkAtom const *targets = (GdkAtom *) sel->data;
unsigned const atom_count = (sel->length / sizeof (GdkAtom));
unsigned i, j;
/* Nothing on clipboard? */
if (sel->length < 0) {
if (wbcg->clipboard_paste_callback_data != NULL) {
g_free (wbcg->clipboard_paste_callback_data);
wbcg->clipboard_paste_callback_data = NULL;
......@@ -172,13 +165,23 @@ x_clipboard_received (GtkClipboard *clipboard, GtkSelectionData *sel,
return;
}
gnumeric_format = html_format = FALSE;
/* Does the remote app support Gnumeric xml ? */
for (i = 0; i < atom_count; i++)
if (atoms[i] == atom_gnumeric)
gnumeric_format = TRUE;
else if (atoms[i] == atom_html)
html_format = TRUE;
/* what do we like best */
for (i = 0 ; formats[i] != NULL ; i++) {
GdkAtom atom = gdk_atom_intern (formats[i], FALSE);
/* do they offer what we want ? */
for (j = 0; j < atom_count && targets [j] != atom ; j++)
;
if (j < atom_count) {
gtk_clipboard_request_contents (clipboard, atom,
x_clipboard_received, wbcg);
break;
}
}
/* If all else fails try STRING */
if (formats[i] == NULL)
gtk_clipboard_request_contents (clipboard, GDK_SELECTION_TYPE_STRING,
x_clipboard_received, wbcg);
/* NOTE : We don't release the date resources
* (wbcg->clipboard_paste_callback_data), the reason for
......@@ -187,31 +190,7 @@ x_clipboard_received (GtkClipboard *clipboard, GtkSelectionData *sel,
* and that call _will_ free the data (and also needs it).
* So we won't release anything.
*/
/* If another instance of gnumeric put this data on the clipboard
* request the data in gnumeric XML format. If not, just
* request it in string format
*/
if (gnumeric_format)
gtk_clipboard_request_contents
(clipboard, atom_gnumeric,
(GtkClipboardReceivedFunc)
x_clipboard_received,
wbcg);
else if (html_format)
gtk_clipboard_request_contents
(clipboard, atom_html,
(GtkClipboardReceivedFunc)
x_clipboard_received,
wbcg);
else
gtk_clipboard_request_contents
(clipboard, GDK_SELECTION_TYPE_STRING,
(GtkClipboardReceivedFunc)
x_clipboard_received,
wbcg);
} else if (sel->target == atom_gnumeric) {
} else if (sel->target == gdk_atom_intern (GNUMERIC_ATOM_NAME, FALSE)) {
/* The data is the gnumeric specific XML interchange format */
content = xml_cellregion_read (wbc, pt->sheet, sel->data, sel->length);
#if 0
......@@ -219,7 +198,7 @@ x_clipboard_received (GtkClipboard *clipboard, GtkSelectionData *sel,
content = html_cellregion_read (wbc, pt->sheet, sel->data, sel->length);
#endif
} else { /* The data is probably in String format */
free_closure = TRUE;
clear_content = TRUE;
/* Did X provide any selection? */
if (sel->length > 0)
content = x_clipboard_to_cell_region (wbcg, sel->data, sel->length);
......@@ -238,12 +217,9 @@ x_clipboard_received (GtkClipboard *clipboard, GtkSelectionData *sel,
cellregion_free (content);
}
if (region_pastable || free_closure) {
/* Remove our used resources */
if (wbcg->clipboard_paste_callback_data != NULL) {
g_free (wbcg->clipboard_paste_callback_data);
wbcg->clipboard_paste_callback_data = NULL;
}
if (clear_content && wbcg->clipboard_paste_callback_data != NULL) {
g_free (wbcg->clipboard_paste_callback_data);
wbcg->clipboard_paste_callback_data = NULL;
}
}
......@@ -349,7 +325,7 @@ void
x_request_clipboard (WorkbookControlGUI *wbcg, PasteTarget const *pt)
{
PasteTarget *new_pt;
GtkClipboard *primary = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
GtkClipboard *primary = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
GdkAtom atom_targets = gdk_atom_intern (TARGETS_ATOM_NAME, FALSE);
if (wbcg->clipboard_paste_callback_data != NULL)
......@@ -360,10 +336,8 @@ x_request_clipboard (WorkbookControlGUI *wbcg, PasteTarget const *pt)
wbcg->clipboard_paste_callback_data = new_pt;
/* Query the formats, This will callback x_clipboard_received */
gtk_clipboard_request_contents
(primary, atom_targets,
(GtkClipboardReceivedFunc) x_clipboard_received,
wbcg);
gtk_clipboard_request_contents (primary, atom_targets,
x_clipboard_received, wbcg);
}
gboolean
......@@ -372,21 +346,17 @@ x_claim_clipboard (WorkbookControlGUI *wbcg)
gboolean clipboard_owner_set;
gboolean primary_owner_set;
static const GtkTargetEntry targets[] = {
{(char *) GNUMERIC_ATOM_NAME, GTK_TARGET_SAME_WIDGET,
GNUMERIC_ATOM_INFO},
{ (char *) GNUMERIC_ATOM_NAME, GTK_TARGET_SAME_WIDGET, GNUMERIC_ATOM_INFO },
/* { (char *)"text/html", 0, 0 }, */
{ (char *)"UTF8_STRING", 0, 0 },
{ (char *)"COMPOUND_TEXT", 0, 0 },
{ (char *)"STRING", 0, 0 },
};
GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
GtkClipboard *primary = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
clipboard_owner_set = gtk_clipboard_set_with_owner
(clipboard, targets, G_N_ELEMENTS (targets),
(GtkClipboardGetFunc) x_clipboard_get_cb,
NULL, G_OBJECT (wbcg));
primary_owner_set = gtk_clipboard_set_with_owner
(primary, targets, G_N_ELEMENTS (targets),
(GtkClipboardGetFunc) x_clipboard_get_cb,
(GtkClipboardClearFunc) x_clipboard_clear_cb,
G_OBJECT (wbcg));
return clipboard_owner_set || primary_owner_set;
return gtk_clipboard_set_with_owner (clipboard,
targets, G_N_ELEMENTS (targets),
(GtkClipboardGetFunc) x_clipboard_get_cb,
(GtkClipboardClearFunc) x_clipboard_clear_cb,
G_OBJECT (wbcg));
}
......@@ -31,7 +31,6 @@
# include "workbook-private.h"
#endif
#include <libgnome/gnome-util.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-help.h>
......@@ -1238,13 +1237,13 @@ int_to_entry (GtkEntry *entry, gint the_int)
}
GtkWidget *
gnumeric_load_image (char const * const name)
gnumeric_load_image (char const *filename)
{
GtkWidget *image;
char *path;
path = g_strconcat (GNUMERIC_ICONDIR "/", name, NULL);
image = gnome_pixmap_new_from_file (path);
path = g_strconcat (GNUMERIC_ICONDIR "/", filename, NULL);
image = gtk_image_new_from_file (path);
g_free (path);
if (image)
......
......@@ -51,10 +51,7 @@ extern gboolean EmbeddableGridFactory_init (void);
#include <glade/glade.h>
#include <libgnome/gnome-config.h>
#ifdef USE_WM_ICONS
#include <libgnomeui/gnome-window-icon.h>
#endif
#ifdef WITH_BONOBO
#include <bonobo.h>
......@@ -106,6 +103,7 @@ gnumeric_check_for_components (void)
}
#endif
extern char *gnumeric_data_dir;
/*
* FIXME: We hardcode the GUI command context. Change once we are able
* to tell whether we are in GUI or not.
......@@ -113,10 +111,6 @@ gnumeric_check_for_components (void)
void
gnm_common_init (void)
{
#ifdef USE_WM_ICONS
gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-gnumeric.png");
#endif
g_object_new (GNUMERIC_APPLICATION_TYPE, NULL);
value_init ();
expr_init ();
......
......@@ -4931,6 +4931,13 @@ workbook_control_gui_ctor_class (GObjectClass *object_class)
wbc_class->paste_from_selection = wbcg_paste_from_selection;
wbc_class->validation_msg = wbcg_validation_msg;
wbcg_class->set_transient = wbcg_set_transient_for;
{
char *iconfile = g_strconcat (GNUMERIC_ICONDIR, G_DIR_SEPARATOR_S,
"gnome-gnumeric.png", NULL);
gnome_window_icon_set_default_from_file (iconfile);
g_free (iconfile);
}
}
GSF_CLASS (WorkbookControlGUI, workbook_control_gui,
......
......@@ -1948,7 +1948,8 @@ xml_read_cell (XmlParseContext *ctxt, xmlNodePtr tree)
if (shared_expr_index > 0) {
if (shared_expr_index == (int)ctxt->shared_exprs->len + 1) {
if (!cell_has_expr (cell)) {
g_warning ("XML-IO: Shared expression with no expession?");
g_warning ("XML-IO: Shared expression with no expession? id = %d\ncontent ='%s'",
shared_expr_index, content);