summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-08-20 14:38:27 +0200
committerEike Rathke <erack@redhat.com>2012-08-20 14:44:05 +0200
commitb44a402d5a05dd32aa2e1ab80c9ea75b560dc3b9 (patch)
treef06bfa3cc301b55e5c9b6bd42a7fd84688ae7355 /sc
parentc767178bd30e2a9430ff9140e0f2fcac5d2a5a10 (diff)
resolved fdo#53325 CSV space delimiter and quoted field
CSV import didn't recognize end of field if a field was quoted and the delimiter was space. Change-Id: I46de608d545011437fe8a298854c134d6cf54b6b
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/impex.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 09da442ac90e..d1104813dfc2 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -571,7 +571,10 @@ static QuoteType lcl_isFieldEndQuote( const sal_Unicode* p, const sal_Unicode* p
// Due to broken CSV generators that don't double embedded quotes check if
// a field separator immediately or with trailing spaces follows the quote,
// only then end the field, or at end of string.
- while (p[1] == ' ')
+ const sal_Unicode cBlank = ' ';
+ if (p[1] == cBlank && ScGlobal::UnicodeStrChr( pSeps, cBlank))
+ return FIELDEND_QUOTE;
+ while (p[1] == cBlank)
++p;
if (!p[1] || ScGlobal::UnicodeStrChr( pSeps, p[1]))
return FIELDEND_QUOTE;