{
switch (s->type)
{
+#ifdef ODF_READ_SUPPORT
case SPREADSHEET_ODS:
ods_destroy (s);
break;
+#endif
+#ifdef GNM_READ_SUPPORT
case SPREADSHEET_GNUMERIC:
gnumeric_destroy (s);
break;
+#endif
default:
NOT_REACHED ();
break;
struct casereader *
spreadsheet_make_reader (struct spreadsheet *s, const struct spreadsheet_read_options *opts)
{
+#ifdef ODS_READ_SUPPORT
if ( s->type == SPREADSHEET_ODS)
return ods_make_reader (s, opts);
+#endif
+#ifdef GNM_READ_SUPPORT
if ( s->type == SPREADSHEET_GNUMERIC)
return gnumeric_make_reader (s, opts);
+#endif
return NULL;
}
const char *
spreadsheet_get_sheet_name (struct spreadsheet *s, int n)
{
+#ifdef ODF_READ_SUPPORT
if ( s->type == SPREADSHEET_ODS)
return ods_get_sheet_name (s, n);
-
+#endif
+#ifdef GNM_READ_SUPPORT
if ( s->type == SPREADSHEET_GNUMERIC)
return gnumeric_get_sheet_name (s, n);
+#endif
return NULL;
}
char *
spreadsheet_get_sheet_range (struct spreadsheet *s, int n)
{
+#ifdef ODF_READ_SUPPORT
if ( s->type == SPREADSHEET_ODS)
return ods_get_sheet_range (s, n);
+#endif
+#ifdef GNM_READ_SUPPORT
if ( s->type == SPREADSHEET_GNUMERIC)
return gnumeric_get_sheet_range (s, n);
+#endif
return NULL;
}
#define _(msgid) gettext (msgid)
#define N_(msgid) (msgid)
+
+#ifdef ODF_READ_SUPPORT
+static const bool odf_read_support = true;
+#else
+static const bool odf_read_support = false;
+#endif
+
+#ifdef GNM_READ_SUPPORT
+static const bool gnm_read_support = true;
+#else
+static const bool gnm_read_support = false;
+#endif
+
static bool parse_spreadsheet (struct lexer *lexer, char **filename,
struct spreadsheet_read_options *opts);
if (!parse_spreadsheet (lexer, &filename, &opts))
goto error;
- if ( 0 == strncasecmp (tok, "GNM", 3))
+ if ( gnm_read_support && 0 == strncasecmp (tok, "GNM", 3))
{
struct spreadsheet *spreadsheet = gnumeric_probe (filename, true);
if (spreadsheet == NULL)
dict = spreadsheet->dict;
gnumeric_destroy (spreadsheet);
}
- else if (0 == strncasecmp (tok, "ODS", 3))
+ else if ( odf_read_support && 0 == strncasecmp (tok, "ODS", 3))
{
struct spreadsheet *spreadsheet = ods_probe (filename, true);
if (spreadsheet == NULL)