diff options
author | Eike Rathke <erack@redhat.com> | 2022-03-14 15:25:02 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2022-03-14 16:18:33 +0100 |
commit | 24e213b11569400751fc54bfbeb5a5f6afdd4172 (patch) | |
tree | 4a5c6befe97a9255a6f28c9e21a5a63841bbee41 /sw | |
parent | 7fced7bbd0d6d7769dcf13ab326c793d4096a247 (diff) |
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 <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
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 |