After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 574381 - Gnumeric fails to import OpenDocument files that lack a file extension
Gnumeric fails to import OpenDocument files that lack a file extension
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
git master
Other All
: Normal minor
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2009-03-06 15:41 UTC by sum1
Modified: 2009-03-12 20:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a patch that adds probing support (1.62 KB, patch)
2009-03-12 15:54 UTC, sum1
none Details | Review
a smarter probe patch (2.02 KB, patch)
2009-03-12 18:44 UTC, sum1
none Details | Review

Description sum1 2009-03-06 15:41:32 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
Comment 1 Andreas J. Guelzow 2009-03-06 16:39:59 UTC
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.
Comment 2 sum1 2009-03-06 17:31:04 UTC
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.
Comment 3 Andreas J. Guelzow 2009-03-06 19:59:53 UTC
If you select the odf file type, the files open just fine. 

It is the probing that doesn't work.
Comment 4 sum1 2009-03-12 15:54:43 UTC
Created attachment 130533 [details] [review]
a patch that adds probing support
Comment 5 Morten Welinder 2009-03-12 18:19:54 UTC
Shouldn't you check size against strlen(OOVersions[i].mime_type) ?
Right now you'll match any prefix, including the empty string.
Comment 6 sum1 2009-03-12 18:44:15 UTC
Created attachment 130547 [details] [review]
a smarter probe patch
Comment 7 Morten Welinder 2009-03-12 19:03:17 UTC
Go ahead.
Comment 8 Morten Welinder 2009-03-12 20:22:49 UTC
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.