summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-12-01 21:24:27 +0100
committerAndras Timar <andras.timar@collabora.com>2015-12-06 14:33:30 +0100
commit54a28b33efab5e1d314b09818fd9ca92ed912012 (patch)
tree5921088f3fd7b1fe83186e0fa29532af987654c4
parent8355a28f0796a1e357f5591ab2b5f7307aa229a0 (diff)
Resolves: tdf#95629 quote CSV also if cell contains embedded '\r' CR
Change-Id: I37fb62a53338a7edcac1c72153eefcee6096e6f9 (cherry picked from commit 129935443cfd9378e1263489fc4bf47aee1f1a46) Reviewed-on: https://gerrit.libreoffice.org/20340 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f7d37735bbe1ba2aa11fd5d0b4abee0fe088471a)
-rw-r--r--sc/source/ui/docshell/docsh.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a93aea456625..d0c083625465 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1778,11 +1778,12 @@ sal_Int32 getTextSepPos(
const StrT& rStr, const ScImportOptions& rAsciiOpt, const SepCharT& rTextSep, const SepCharT& rFieldSep, bool& rNeedQuotes)
{
// #i116636# quotes are needed if text delimiter (quote), field delimiter,
- // or LF is in the cell text.
+ // or LF or CR is in the cell text.
sal_Int32 nPos = rStr.indexOf(rTextSep);
rNeedQuotes = rAsciiOpt.bQuoteAllText || (nPos >= 0) ||
(rStr.indexOf(rFieldSep) >= 0) ||
- (rStr.indexOf('\n') >= 0);
+ (rStr.indexOf('\n') >= 0) ||
+ (rStr.indexOf('\r') >= 0);
return nPos;
}