sc/source/ui/docshell/impex.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit be13ca182d7b0b59ad0c9509200cfdc45bd15cf2
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Thu Feb 17 18:28:17 2022 +0100
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Thu Feb 17 19:10:03 2022 +0100

    Resolves: tdf#147496 No line feed for one single cell in clipboard 
Doc2Text()
    
    Change-Id: If6326bf414e1da43d846f952d88ceae37b2b9cd2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130109
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 953aa0eb8167..5ff892fe19ca 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1980,7 +1980,11 @@ bool ScImportExport::Doc2Text( SvStream& rStrm )
                 if( nCol < nEndCol )
                     lcl_WriteSimpleString( rStrm, OUString(cSep) );
             }
-            WriteUnicodeOrByteEndl( rStrm );
+            // Do not append a line feed for one single cell.
+            // NOTE: this Doc2Text() is only called for clipboard via
+            // ScImportExport::ExportStream().
+            if (nStartRow != nEndRow || nStartCol != nEndCol)
+                WriteUnicodeOrByteEndl( rStrm );
             if( rStrm.GetError() != ERRCODE_NONE )
                 break;
             if( nSizeLimit && rStrm.Tell() > nSizeLimit )

Reply via email to