You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2022/12/27 12:52:36 UTC

[openoffice] branch trunk updated: When we reach EOF, and SvStream.ReadCsvLine() returned some data, process that data before returning.

This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c7ace38fed When we reach EOF, and SvStream.ReadCsvLine() returned some data, process that data before returning.
c7ace38fed is described below

commit c7ace38fedbe61bc12c11cf4f428626429620f06
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Tue Dec 27 14:47:35 2022 +0200

    When we reach EOF, and SvStream.ReadCsvLine() returned some data,
    process that data before returning.
    
    Fixes https://bz.apache.org/ooo/show_bug.cgi?id=128548 -
    "Last CSV line is silently lost on import if last field is quoted
    and EOF is reached before closing quote"
    
    Patch by: me
---
 main/sc/source/ui/docshell/impex.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main/sc/source/ui/docshell/impex.cxx b/main/sc/source/ui/docshell/impex.cxx
index 2f3688ff2f..58aa039b49 100644
--- a/main/sc/source/ui/docshell/impex.cxx
+++ b/main/sc/source/ui/docshell/impex.cxx
@@ -1231,7 +1231,7 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
         for( ;; )
         {
             rStrm.ReadCsvLine( aLine, !bFixed, rSeps, cStr);
-            if ( rStrm.IsEof() )
+            if ( rStrm.IsEof() && aLine.Len() == 0 )
                 break;
 
             xub_StrLen nLineLen = aLine.Len();