[Libreoffice-commits] .: Branch 'libreoffice-3-5' - tools/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Jan 3 10:57:55 PST 2012


 tools/source/stream/stream.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9e184d07ee793939e4568632cd9be00d7440188e
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Tue Jan 3 13:54:41 2012 -0500

    Fix import of multi-line cell contents during csv import.
    
    Regression from 3.3.x.
    
    Import of tab-delimited csv documents containing multi-line cells
    were unfortunately broken with my fix for handling malformed csv
    documents.  The intent was to break out of the loop only when a tab
    character is encountered before the closing quote is encountered, but
    the old code would break out whenever a tab character is encountered
    even outside the quotes.
    
    This commit fixes it.

diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 33eef85..48798c5 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1073,7 +1073,7 @@ sal_Bool SvStream::ReadCsvLine( String& rStr, sal_Bool bEmbeddedLineBreak,
             {
                 if (nQuotes)
                 {
-                    if (bTabSep && *p == '\t')
+                    if (bTabSep && *p == '\t' && (nQuotes % 2) != 0)
                     {
                         // When tab-delimited, tab char ends quoted sequence
                         // even if we haven't reached the end quote.  Doing


More information about the Libreoffice-commits mailing list