diff options
author | Andrés <andmarti@gmail.com> | 2021-05-08 10:04:24 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-05-08 10:04:24 -0300 |
commit | bb778d33a25686e0fa924ee453037a5e104187c2 (patch) | |
tree | 42bc432ea3fe85fb63a1dbf4471af7bdca5f743f | |
parent | f9c591171a878ddc52d547cd8d784946f15824bb (diff) |
Work on issue 493
-rw-r--r-- | CHANGES | 9 | ||||
-rwxr-xr-x | src/doc | 1 | ||||
-rw-r--r-- | src/file.c | 16 |
3 files changed, 25 insertions, 1 deletions
@@ -55,14 +55,21 @@ free lua memory at exit Added @getent (FR issue #451) +Fix when saving marks in file after importing xlsx file and saving it in sc format. + import mkd files +The save format for :w command would be according to current file format. #493 + Pending for v0.8.2 release ---------------------------- -+ modify :w to check current file name and save the file with the correct format. +#pkg-config with libxlsxwriter doesnt seem to work well + ++ modify savefile() from file.c to check current file format (applies to xlsx, ods, xlx formats) +and save the file with the same format, rather than sc format. + Add to (or check the text in) doc file: @getent @@ -392,6 +392,7 @@ Commands for handling cell content: :w {file} Save the current spreadsheet as {file}. :w! {file} Save the current spreadsheet as {file}, forcing an overwrite if {file} already exists. + The format in which it will be save will be according to the current file extension, if any. :h Show this help. :help Show this help. @@ -308,6 +308,21 @@ int savefile() { export_markdown(curfile, 0, 0, maxrow, maxcol); modflg = 0; return 0; + + // treat xlsx format + } else if (strlen(curfile) > 5 && ( ! strcasecmp( & curfile[strlen(curfile)-5], ".xlsx") || + ! strcasecmp( & curfile[strlen(curfile)-5], ".xlsx"))){ +#ifndef XLSX_EXPORT + sc_error("XLSX export support not compiled in. Please save file in other extension."); + return -1; +#else + if (export_xlsx(curfile, 0, 0, maxrow, maxcol) == 0) { + sc_info("File \"%s\" written", curfile); + modflg = 0; + } else + sc_error("File could not be saved"); + return 0; +#endif } // save in sc format @@ -315,6 +330,7 @@ int savefile() { sc_error("File could not be saved"); return -1; } + modflg = 0; return 0; } |