sw/source/uibase/dochdl/swdtflvr.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 24e213b11569400751fc54bfbeb5a5f6afdd4172 Author: Eike Rathke <er...@redhat.com> AuthorDate: Mon Mar 14 15:25:02 2022 +0100 Commit: Eike Rathke <er...@redhat.com> CommitDate: Mon Mar 14 16:18:33 2022 +0100 Resolves: tdf#147935 A row may have no newline character, tdf#147496 follow-up Change-Id: I91672e31e324cdd17c02ca328863b636beeb5e45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131546 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 56b828187d67..004e57c24b3e 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2665,7 +2665,9 @@ bool SwTransferable::PasteDDE( const TransferableDataHelper& rData, ( rData.HasFormat( SotClipboardFormatId::SYLK ) || rData.HasFormat( SotClipboardFormatId::SYLK_BIGCAPS ) ) ) { - const sal_Int32 nRows = nNewlines ? nNewlines-1 : 0; + sal_Int32 nRows = nNewlines ? nNewlines-1 : 0; + if (!aExpand.endsWith("\n")) + ++nRows; // last row has no newline, e.g. one single cell const sal_Int32 nCols = comphelper::string::getTokenCount(aExpand.getToken(0, '\n'), '\t'); // don't try to insert tables that are too large for writer