Bug 106678 - CSV Filter Option for quoting everything is ignored
Summary: CSV Filter Option for quoting everything is ignored
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
(earliest affected) release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
Whiteboard: target:6.3.0
Depends on:
Blocks: CSV-Dialog
  Show dependency treegraph
Reported: 2017-03-21 15:30 UTC by Andy
Modified: 2020-04-26 13:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:

Spreadsheet with Makro that will export 2 CSV to /tmp/ (14.31 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-12-15 22:59 UTC, Andy Pillip
a fixed test case (10.74 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-12-25 09:30 UTC, Takeshi Abe

Note You need to log in before you can comment on or make changes to this bug.
Description Andy 2017-03-21 15:30:57 UTC
To me it seems like a bug, `document.StoreToURL` will ignore the 8th filter option for CSV.

Unfortunately the interface to export CSV is not well designed in that there's no real function call for it, but only `document.StoreToURL` along with arguments in a certain, undocumented order.

So I'm not quite sure about the intended behaviour.

I found OpenOffice's Documentation of Filter Options, but I'm not sure if it applies to LibreOffice. There seems to be nothing in the wiki.

Anyway, it states:

> Token 8, csv export
> This token has no UI equivalent. If true, the number cells are stored as numbers. If false, the numbers are stored as text, with text delimiters.
> String, either false or true. Default value : true.

So using it should quote every single cell, which is not the case.

I asked abouth this on Ask LibreOffice, with no answer. There you can find an example to verify.

I'm on Fedora 25.
My Build-ID:

CPU-Threads: 4; BS-Version: Linux 4.8; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.utf8); Calc: group

Thanks for checking.
Comment 1 Xisco Faulí 2017-12-14 09:13:05 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
Comment 2 Andy Pillip 2017-12-15 22:59:41 UTC
Created attachment 138470 [details]
Spreadsheet with Makro that will export 2 CSV to /tmp/

Voilà, I uploaded a test spreadsheet with a piece of Makro code.

There is text fields and number fields. The makro will export one CSV with parameter 8=false, and one with 8=true.

You'll see that there is no difference in the exported CSV files.

If you're not on a Unix system, you might need to adjust the path. Currently it's /tmp/. 

Thanks for checking.
Comment 3 Buovjaga 2017-12-16 13:13:09 UTC

Arch Linux 64-bit
Build ID: 1390c91c7584a89298906849cdabae131f8a6191
CPU threads: 8; OS: Linux 4.14; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on December 14th 2017
Comment 4 QA Administrators 2018-12-17 03:41:32 UTC Comment hidden (obsolete)
Comment 5 Andy 2018-12-17 13:20:16 UTC
I just ran the demo macro with my latest lo, and the bug persists.

CPU-Threads: 4; BS: Linux 4.19; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group threaded

Thanks very much for looking into that some when.
Comment 9 Takeshi Abe 2018-12-25 09:30:52 UTC
Created attachment 147811 [details]
a fixed test case

Found that LibO's CSV filter had not handled the 8th token ever.
I have implemented the feature described in
and submitted the patch for review:

Besides, I also found that the test macro attached by Andy
has a flaw which has not Join()'ed 8th token into Propval(1).
Attached an ods with a fixed macro, in which the option
"save cell as shown" (9th token) is given false, because my
implementation makes the true value of the 9th token take
priority over the false value of the 8th.
Comment 10 Commit Notification 2019-01-16 16:45:14 UTC
Takeshi Abe committed a patch related to this issue.
It has been pushed to "master":


tdf#106678 Implement CSV filter option's 8th token

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.