summaryrefslogtreecommitdiff
path: root/sc/qa/unit/data
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-10-02 01:16:00 +0200
committerEike Rathke <erack@redhat.com>2022-10-02 17:07:06 +0200
commitcf777cfcb22647b1f2d6ace307fbcc4f6d2cca30 (patch)
tree3859564c8389cc391a6f06c1e9bb04e76a1c7c44 /sc/qa/unit/data
parent2a7fcaf582df3ada57ca519b50e29011973a1b6f (diff)
Resolves: tdf#125110 tdf#151211 Disentangle the convoluted CSV/TSV-clip import
The chain of fixes for #i119960# tdf#48621 tdf#125440 produced code that is suboptimal and not robust enough against some further corner cases, taking quoted field content where there shouldn't be. First, in ReadCsvLine() assume that if a generator is broken enough to start a field quoted followed by containing an unescaped embedded quote and there is no closing quote (i.e. immediately before a field delimiter) until the line end then the generator will not be clever enough to write embedded linefeeds either and the field starting quote wasn't one but to be taken literally as all other quotes until the now unquoted field end. In this case do not read a subsequent source line for the current row. Then, for individual fields of a row make a similar assumption, a quote-started field has to end with a quote before a field separator (or line end) or otherwise all quotes of that field are literal data up to the next field separator. This made it necessary to adapt two test cases of the garbage CSV import test to produce different garbage than before. Change-Id: I4424b65c87c7f9dcbe717a7e6cf207352cb613f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140850 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sc/qa/unit/data')
-rw-r--r--sc/qa/unit/data/contentCSV/fdo48621_broken_quotes_exported.csv8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/qa/unit/data/contentCSV/fdo48621_broken_quotes_exported.csv b/sc/qa/unit/data/contentCSV/fdo48621_broken_quotes_exported.csv
index dfc83c5f3ced..8e10063eefe5 100644
--- a/sc/qa/unit/data/contentCSV/fdo48621_broken_quotes_exported.csv
+++ b/sc/qa/unit/data/contentCSV/fdo48621_broken_quotes_exported.csv
@@ -53,8 +53,8 @@ No it doesn't,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
",<- needed to end test file here,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
i80385_test2.csv,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-test,"a""b, ""a"," d""a""c ", m ,j ,d,"b""A""","D""E","f,1","a,b","de""b,a
-""abcdef"" test ""abc","def""g""h","def""gh""",,,,,,,,,,,,,,,,,,,,,,,
+test,"a""b, ""a"," d""a""c ", m ,j ,d,"b""A""","D""E","f,1","a,b","""de""b",a,,,,,,,,,,,,,,,,,,,,,,,,
+"abcdef"" test ""abc","def""g""h","def""gh""",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
"this is
a test","yes
it
@@ -78,8 +78,8 @@ No it doesn't,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
""a""b""",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
i80385_test4.csv,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-test,"a""b, ""a"," d""a""c ", m ,j ,d,"b""A""","D""E","f,1","a,b","de""b,a
-""abcdef"" test ""abc","def""g""h","def""gh""",,,,,,,,,,,,,,,,,,,,,,,
+test,"a""b, ""a"," d""a""c ", m ,j ,d,"b""A""","D""E","f,1","a,b","""de""b",a,,,,,,,,,,,,,,,,,,,,,,,,
+"abcdef"" test ""abc","def""g""h","def""gh""",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
"this is
a test","yes
it