GNOME Bugzilla – Bug 574381
Gnumeric fails to import OpenDocument files that lack a file extension
Last modified: 2009-03-12 20:22:49 UTC
Version: r17178 OS: Ubuntu Intrepid Steps to reproduce: - Run Gnumeric - File > Save As - Choose the "OpenDocument..." file type - Press Save (save the file to a folder you can easily find, like the desktop) - Remove the ".ods" extension from the recently saved file - File > Open - Change the type of files from "Spreadsheets" to "All Files" - Attempt to open the newly renamed file to receive an "Unsupported file format" error message
There is really no reason to assume that the odf file created by gnumeric is a valid odf file. That saver is marked as in development. You may want to try this out with likely more correct odf files.
This bug also occurs with spreadsheets created by OpenOffice.org 2.4.1. I created two files, one blank and one with some nonsense strings. Gnumeric can import both as long as they have file extensions. Once I remove the extensions, however, I get the unsupported error message.
If you select the odf file type, the files open just fine. It is the probing that doesn't work.
Created attachment 130533 [details] [review] a patch that adds probing support
Shouldn't you check size against strlen(OOVersions[i].mime_type) ? Right now you'll match any prefix, including the empty string.
Created attachment 130547 [details] [review] a smarter probe patch
Go ahead.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.