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

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


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

commit 783073635d90a1975acc92f88b2b9c049e9b617a
Author: Damjan Jovanovic <[email protected]>
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
    
    (cherry picked from commit c7ace38fedbe61bc12c11cf4f428626429620f06)
---
 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();

Reply via email to