Kaydet (Commit) 54a28b33 authored tarafından Eike Rathke's avatar Eike Rathke Kaydeden (comit) Andras Timar

Resolves: tdf#95629 quote CSV also if cell contains embedded '\r' CR

Change-Id: I37fb62a53338a7edcac1c72153eefcee6096e6f9
(cherry picked from commit 12993544)
Reviewed-on: https://gerrit.libreoffice.org/20340Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
(cherry picked from commit f7d37735)
üst 8355a28f
...@@ -1778,11 +1778,12 @@ sal_Int32 getTextSepPos( ...@@ -1778,11 +1778,12 @@ sal_Int32 getTextSepPos(
const StrT& rStr, const ScImportOptions& rAsciiOpt, const SepCharT& rTextSep, const SepCharT& rFieldSep, bool& rNeedQuotes) const StrT& rStr, const ScImportOptions& rAsciiOpt, const SepCharT& rTextSep, const SepCharT& rFieldSep, bool& rNeedQuotes)
{ {
// #i116636# quotes are needed if text delimiter (quote), field delimiter, // #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); sal_Int32 nPos = rStr.indexOf(rTextSep);
rNeedQuotes = rAsciiOpt.bQuoteAllText || (nPos >= 0) || rNeedQuotes = rAsciiOpt.bQuoteAllText || (nPos >= 0) ||
(rStr.indexOf(rFieldSep) >= 0) || (rStr.indexOf(rFieldSep) >= 0) ||
(rStr.indexOf('\n') >= 0); (rStr.indexOf('\n') >= 0) ||
(rStr.indexOf('\r') >= 0);
return nPos; return nPos;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment