static Bonobo_Persist_ContentTypeList *
get_content_types(BonoboPersist *persist,CORBA_Environment *ev)
{
- //FIXME:il tipo di dato non e` noto
- return bonobo_persist_generate_content_types(0);
+ return bonobo_persist_generate_content_types(2, "application/mathml+xml", "text/mathml");
}
static void
FILE *tmpfile;
int fd;
- persist->tmp_path_name = g_strconcat(g_get_tmp_dir(), "/ggvXXXXXX", NULL);
+ persist->tmp_path_name = g_strconcat(g_get_tmp_dir(), "/gmvXXXXXX", NULL);
if((fd = mkstemp(persist->tmp_path_name)) < 0) {
g_free(persist->tmp_path_name),
persist->tmp_path_name = NULL;
return NULL;
}
+ printf("salvo nel file %s\n", persist->tmp_path_name);
tmpfile = fdopen(fd, "w");
if(!tmpfile) {
close(fd);
printf("persist stream loading\n");
#endif
+ printf("type = %s\n", type);
+
if (strcmp (type, "application/mathml+xml") != 0) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
ex_Bonobo_Persist_WrongDataType, NULL);
do {
Bonobo_Stream_read (stream, 4096, &buffer, ev);
- if (ev->_major != CORBA_NO_EXCEPTION || buffer->_length <= 0) {
- CORBA_free (buffer);
- goto clean;
- }
+ if (ev->_major != CORBA_NO_EXCEPTION) {
+ printf("*** eccezione 1\n");
+ goto clean;
+ }
len_read = buffer->_length;
+ printf("letti %d bytes\n", len_read);
+
if (buffer->_buffer && len_read)
if(fwrite(buffer->_buffer, 1, len_read, tmpfile) != len_read) {
CORBA_free (buffer);
+ printf("*** eccezione 2\n");
goto clean;
}
CORBA_free (buffer);
- } while (1);
+ } while (len_read > 0);
fclose(tmpfile);
result = gtk_math_view_load_uri(persist->math_view,persist->tmp_path_name);