Got the ODS reader model (sort of) working.
[pspp] / src / data / spreadsheet-reader.c
index 2b4178835a2dae2af78e1c9d4deb34bfeb42bd01..efaafa30c597cd3a6c3528c96e9df995d8313914 100644 (file)
 
 #include "spreadsheet-reader.h"
 
+#include "gnumeric-reader.h"
+#include "ods-reader.h"
+
 #include <libpspp/str.h>
 #include <stdio.h>
 #include <string.h>
-
+#include <gl/xalloc.h>
+#include <gl/c-xvasprintf.h>
+#include <stdlib.h>
 
 struct spreadsheet * 
 spreadsheet_open (const char *filename)
 {
   struct spreadsheet *ss = NULL;
 
-  ss = gnumeric_probe (filename);
+  ss = ods_probe (filename, true);
   
   return ss;
 }
 
 void 
-spreadsheet_close (struct spreadsheet *spreadsheet)
+spreadsheet_close (UNUSED struct spreadsheet *spreadsheet)
 {
 }
 
@@ -107,7 +112,7 @@ int_to_ps26 (int i)
   i -= lower;
   i += base;
 
-  ret = malloc (exp);
+  ret = xmalloc (exp);
 
   exp = 0;
   do
@@ -137,7 +142,7 @@ create_cell_ref (int col0, int row0, int coli, int rowi)
 
   cs0 =  int_to_ps26 (col0);
   csi =  int_to_ps26 (coli);
-  s =  c_xasprintf ("%s%d:%s%ld",
+  s =  c_xasprintf ("%s%d:%s%d",
                         cs0, row0 + 1,
                         csi, rowi + 1);
   free (cs0);