brechtsanders / xlsxio

XLSX I/O - C library for reading and writing .xlsx files
MIT License
417 stars 112 forks source link

cannot read xlsm-, xltx- or xltm files #61

Closed coproc closed 4 years ago

coproc commented 4 years ago

The current code can only read xlsx-files, although the format of xlsm-, xltx- and xltm files is the same. (xlsm- and xltm-files can additionally contain macros.)

The reason is the constant "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" used for the content type of the workbook. But this is only the case for xlsx-files. The other file types have these content types:

brechtsanders commented 4 years ago

Thank you so much for the suggestion an the patch. However I prefer to do it a little different, not messing up the functions too much. In particular I didn't like to remove the content type parameter from contenttype_file_callback_fn. But I did add support for these file types in version 0.2.24.

coproc commented 4 years ago

Ok, thank you for reacting so quickly! I removed the content type parameter, because it was not used in any of these callbacks ... so why keep it?

brechtsanders commented 4 years ago

You're welcome. The function was abstract and intended to iterate different content types. Design should remain abstract to support future changes (like OpenOffice spreadsheet format).