Commit 3730c2c6 authored by Michael Meeks's avatar Michael Meeks

Skeleton of lotus-123 support.

Changed missing glade file g_error to g_warning.
'fixed' Makefile.am to stop ::Unknown and untold grief with Gnumeric.idl
for those without Bonobo.
parent 139a3192
1999-07-21 Michael Meeks <michael@edenproject.org>
* src/widget-font-selector.c (fs_init): Convert g_error to
g_warning on missing glade_xml_new.
* src/Makefile.am (GNUMERIC_CORBA_GENERATED): Make this empty
if BONOBO is not installed, should kill peoples Gnumeric.idl
problems with luck.
* configure.in: Add lotus-123
* plugins/Makefile.am: ditto.
* src/main.c: Remove xbase include.
1999-07-20 Jody Goldberg <jgoldberg@home.com>
......
1999-07-21 Michael Meeks <michael@edenproject.org>
* src/widget-font-selector.c (fs_init): Convert g_error to
g_warning on missing glade_xml_new.
* src/Makefile.am (GNUMERIC_CORBA_GENERATED): Make this empty
if BONOBO is not installed, should kill peoples Gnumeric.idl
problems with luck.
* configure.in: Add lotus-123
* plugins/Makefile.am: ditto.
* src/main.c: Remove xbase include.
1999-07-20 Jody Goldberg <jgoldberg@home.com>
......
......@@ -189,6 +189,7 @@ plugins/Makefile
plugins/sample/Makefile
plugins/excel/Makefile
plugins/excel/libole2/Makefile
plugins/lotus-123/Makefile
plugins/python/Makefile
plugins/perl/Makefile
plugins/perl/ext/Makefile.PL
......
......@@ -19,4 +19,6 @@ endif
#SUBDIRS = sample stat excel ff-csv text $(PYTHON) $(PERL) $(GUILE_DIR) xbase
SUBDIRS = sample stat excel ff-csv text xbase html $(PYTHON) $(GUILE_DIR)
SUBDIRS = sample stat excel lotus-123 ff-csv text xbase html $(PYTHON) $(GUILE_DIR)
1999-07-21 Michael Meeks <michael@edenproject.org>
* lotus.[ch]: Created.
* boot.[ch]: Created
* Makefile.am: Created.
GNUMERIC_SRC_DIR = $(top_srcdir)/src
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DGNUMERIC_VERSION=\""$(VERSION)"\" \
-I$(includedir) \
-I$(top_srcdir)/src \
$(GNOME_INCLUDEDIR)
plugindir = $(libdir)/gnumeric/plugins
plugin_LTLIBRARIES = liblotus.la
liblotus_la_SOURCES = \
boot.c \
boot.h \
lotus.c \
lotus.h
This plugin provides Lotus 123 I/O
This was originally written by:
Jon K. Hellan <Jon.K.Hellan@item.ntnu.no>
Adapted to SIAG by;
Ulric Eriksson <ulric@edu.stockholm.se>
And then ported to gnumeric, some support code snarfed from Sean Atkinson.
More documentation on the Lotus fule format can be found at:
http://www.wotsit.org/ OR http://www.lotus.com/
/**
* boot.c: Lotus 123 support for Gnumeric
*
* Author:
* See: README
* Michael Meeks <michael@imagiantor.com>
**/
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <assert.h>
#include <config.h>
#include <stdio.h>
#include <ctype.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "main.h"
#include "sheet.h"
#include "file.h"
#include "lotus.h"
#include "plugin.h"
static char *
filename_ext(const char *filename)
{
char *p = strrchr (filename, '.');
if (p==NULL)
return NULL;
return ++p;
}
static gboolean
lotus_probe (const char *filename)
{
char *ext;
if (!filename)
return FALSE;
ext = filename_ext (filename);
if (!ext)
return FALSE;
if (g_strcasecmp ("wk1", ext))
return FALSE;
return TRUE;
}
static Workbook *
lotus_load (const char *filename)
{
char *name, *p;
Workbook *wb;
wb = lotus_read (filename);
if (wb) {
if ((p = filename_ext (name)) != NULL)
*p = '\0'; /* remove "wk1" */
name = g_strconcat (p, "gnumeric", NULL);
g_free (p);
workbook_set_filename (wb, name);
g_free (name);
}
return wb;
}
static int
lotus_can_unload (PluginData *pd)
{
return TRUE;
}
static void
lotus_cleanup_plugin (PluginData *pd)
{
file_format_unregister_open (lotus_probe, lotus_load);
}
int
init_plugin (PluginData *pd)
{
char *descr = _("Lotus (*.wk1) file format");
file_format_register_open (50, descr, lotus_probe, lotus_load);
pd->can_unload = lotus_can_unload;
pd->cleanup_plugin = lotus_cleanup_plugin;
pd->title = g_strdup (_("Lotus 123 file import/export plugin"));
return 0;
}
/**
* lotus.c: Lotus 123 support for Gnumeric
*
* Author:
* See: README
* Michael Meeks <michael@imagiantor.com>
**/
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <assert.h>
#include <config.h>
#include <stdio.h>
#include <ctype.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "main.h"
#include "sheet.h"
#include "file.h"
#include "lotus.h"
Workbook *
lotus_read (const char *filename)
{
Workbook *wb;
Sheet *sheet;
cell_deep_freeze_redraws ();
wb = workbook_new ();
sheet = sheet_new (wb, filename);
workbook_attach_sheet (wb, sheet);
if (wb)
workbook_recalc (wb);
cell_deep_thaw_redraws ();
}
Workbook *lotus_read (const char *filename);
......@@ -175,11 +175,15 @@ GNUMERIC_BASE_SOURCES = \
xml-io.c \
xml-io.h
if BONOBO
GNUMERIC_CORBA_GENERATED = \
Gnumeric-common.c \
Gnumeric-skels.c \
Gnumeric-stubs.c \
Gnumeric.h
else
GNUMERIC_CORBA_GENERATED =
endif
GNUMERIC_BONOBO_SOURCES = \
embeddable-grid.c \
......
......@@ -218,8 +218,8 @@ fs_init (FontSelector *fs)
GtkWidget *old_parent;
fs->gui = glade_xml_new (GNUMERIC_GLADEDIR "/font-sel.glade", NULL);
if (!fs->gui){
g_error ("Could not load font-sel.glade");
if (!fs->gui) {
g_warning ("Could not load font-sel.glade");
return;
}
toplevel = glade_xml_get_widget (fs->gui, "toplevel-table");
......
......@@ -218,8 +218,8 @@ fs_init (FontSelector *fs)
GtkWidget *old_parent;
fs->gui = glade_xml_new (GNUMERIC_GLADEDIR "/font-sel.glade", NULL);
if (!fs->gui){
g_error ("Could not load font-sel.glade");
if (!fs->gui) {
g_warning ("Could not load font-sel.glade");
return;
}
toplevel = glade_xml_get_widget (fs->gui, "toplevel-table");
......
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