Commit dd77cd95 authored by Nick Lamb /GIMP's avatar Nick Lamb /GIMP

First step of process to merge non-OLE Excel support into 1.1.x

parent d82807cb
2002-10-10 Nick Lamb <njl98r@ecs.soton.ac.uk>
* plugin.xml.in: Excel 4.x had .XLW workbooks as well as .XLS
* boot.c: Try to load non-OLE files too
2002-10-09 Morten Welinder <terra@diku.dk>
* ms-excel-read.c (ms_excel_workbook_destroy): Don't leak
......
......@@ -26,6 +26,7 @@
#include "ms-excel-util.h"
#include "ms-excel-read.h"
#include <gsf/gsf-input.h>
#include <gsf/gsf-infile.h>
#include <gsf/gsf-infile-msole.h>
#include <gsf/gsf-msole-utils.h>
......@@ -75,8 +76,10 @@ excel_file_probe (GnumFileOpener const *fo, GsfInput *input, FileProbeLevel pl)
if (input == NULL)
return FALSE;
ole = gsf_infile_msole_new (input, NULL);
if (ole == NULL)
if (ole == NULL) {
/* FIXME Perhaps this is a pure BIFF file */
return FALSE;
}
stream = gsf_infile_child_by_name (ole, "Workbook");
if (stream == NULL)
......@@ -131,6 +134,18 @@ excel_file_open (GnumFileOpener const *fo, IOContext *context,
unsigned i = 0;
if (ole == NULL) {
guint8 const *data;
/* Test for non-OLE BIFF file */
gsf_input_seek (input, 0, G_SEEK_SET);
data= gsf_input_read (input, 2, NULL);
if (data[0] == 0x09 && (data[1] & 0xf1) == 0) {
gsf_input_seek (input, -2, G_SEEK_CUR);
ms_excel_read_workbook (context, wbv, input);
return;
}
/* OK, it really isn't an Excel file */
g_return_if_fail (err != NULL);
gnumeric_error_read (COMMAND_CONTEXT (context),
err->message);
......
......@@ -15,6 +15,7 @@
</information>
<file_patterns>
<file_pattern type="shell_pattern" value="*.xls"/>
<file_pattern type="shell_pattern" value="*.xlw"/>
<file_pattern type="shell_pattern" value="*.xlt"/>
</file_patterns>
<save_info saver_id="excel95" format_level="manual_remember"/>
......
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