summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-07-17 12:15:28 +1000
committerMike Kaganski <mike.kaganski@collabora.com>2019-07-17 09:53:50 +0200
commit2d4ccc58e9ef3b98a88407e1a7a3abf3379f0d20 (patch)
tree9518f96f00a8a3ca3a0ac7a0c9f38db229d30509 /sc/source
parent0e82806ed6841c0a6919f97660ed4622c89d2338 (diff)
tdf#126421: don't limit pasted data to allocated columns in destination
Change-Id: Ic30360795c5dac1dc232f95bd25f5a11946c7dee Reviewed-on: https://gerrit.libreoffice.org/75738 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/table2.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 388e0bb1be61..5b182c897b4b 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -670,17 +670,20 @@ bool ScTable::InitColumnBlockPosition( sc::ColumnBlockPosition& rBlockPos, SCCOL
return true;
}
+// pTable is source
+
void ScTable::CopyFromClip(
sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
SCCOL nDx, SCROW nDy, ScTable* pTable )
{
- if (nCol2 > aCol.size() - 1)
- nCol2 = aCol.size() - 1;
+ if (nCol2 > MAXCOL)
+ nCol2 = MAXCOL;
if (nRow2 > MAXROW)
nRow2 = MAXROW;
if (ValidColRow(nCol1, nRow1) && ValidColRow(nCol2, nRow2))
{
+ CreateColumnIfNotExists(nCol2);
for ( SCCOL i = nCol1; i <= nCol2; i++)
{
pTable->CreateColumnIfNotExists(i - nDx);