feat(soffice): add support for Excel and Calc spreadsheet conversions (#609)

This commit is contained in:
Orban Gergo
2026-08-19 22:58:02 +03:00
committed by GitHub
parent a7722c1f77
commit 3f91d518ba
+15 -6
View File
@@ -6,7 +6,6 @@ export const properties = {
text: [
"602",
"abw",
"csv",
"cwk",
"doc",
"docm",
@@ -35,7 +34,6 @@ export const properties = {
"stw",
"sxw",
"tab",
"tsv",
"txt",
"wn",
"wpd",
@@ -46,10 +44,10 @@ export const properties = {
"xml",
"zabw",
],
calc: ["csv", "ods", "tsv", "xls", "xlsx"],
},
to: {
text: [
"csv",
"doc",
"docm",
"docx",
@@ -65,13 +63,13 @@ export const properties = {
"pdf",
"rtf",
"tab",
"tsv",
"txt",
"wps",
"wpt",
"xhtml",
"xml",
],
calc: ["csv", "ods", "pdf", "tsv", "xls", "xlsx", "ots", "xlsm", "xlt", "xltm"],
},
};
@@ -117,7 +115,7 @@ const filters: Record<FileCategories, Record<string, string | null>> = {
// filter makes soffice reject a genuine Works document with "source file
// could not be loaded", even though it converts the same file fine with
// no --infilter at all (LibreOffice auto-detects it correctly).
//
// null is deliberate for BOTH directions here, not just the import side:
// this map feeds both --infilter (import) and the --convert-to suffix
// (export). On import, null lets LibreOffice auto-detect - its Works
@@ -133,7 +131,18 @@ const filters: Record<FileCategories, Record<string, string | null>> = {
xml: "OpenDocument Text Flat XML",
zabw: "AbiWord",
},
calc: {},
calc: {
csv: "Text - txt - csv (StarCalc)",
ods: "calc8",
ots: "calc8_template",
pdf: "calc_pdf_Export",
tsv: "Text - txt - csv (StarCalc)",
xls: "MS Excel 97",
xlsx: "Calc MS Excel 2007 XML",
xlsm: "Calc MS Excel 2007 XML VBA",
xlt: "MS Excel 97 Vorlage",
xltm: "Calc MS Excel 2007 XML Template",
},
};
const getFilters = (fileType: string, converto: string) => {