summaryrefslogtreecommitdiff
path: root/sc/source/core/data/document.cxx
diff options
context:
space:
mode:
authorscito <info@scito.ch>2021-05-21 13:11:51 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-05-21 17:01:24 +0200
commitde4c23fb38a7848e1030075b9c15cbb5c558694c (patch)
tree0c787bc7e8613159920da304b89b5bfbe2387103 /sc/source/core/data/document.cxx
parent2eb95408912f2292e2c7e8634c628a29f6c241b7 (diff)
tdf#68976 cut paste transposed: fix wrong position in clipdoc
The transposed cells were written always in A1 of the transposed clip. This is no problem for copy paste transposed. However, this is an issue for cut paste transposed as references of formulas pointing to cut cells are adjusted according to position changes. The solution is to write the transposed cells in the same top left corner of the transposed clipdoc as in the original non-transposed clipdoc. There are still issues with cut paste transposed: Formula references are not updated correctly in some cases (tdf#142065, tdf#142201). Comprehensive unit tests will follow with fixes for tdf#142065 and tdf#142201. Change-Id: Id691fabf89d7f25e05182b20bd379299fc18fbb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115535 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/core/data/document.cxx')
-rw-r--r--sc/source/core/data/document.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 012913d37924..cbce2c2a824b 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2367,8 +2367,7 @@ void ScDocument::TransposeClip(ScDocument* pTransClip, InsertDeleteFlags nFlags,
SCROW nRowCountNonFiltered = CountNonFilteredRows(
aClipRange.aStart.Row(), aClipRange.aEnd.Row(), aClipRange.aStart.Tab());
assert(!bIncludeFiltered && "bIsMultiRangeRowFilteredTranspose can only be true if bIncludeFiltered is false");
- SCROW nRowCountInRange = nRowCountNonFiltered;
- nRowCount += nRowCountInRange; // for next iteration
+ nRowCount += nRowCountNonFiltered; // for next iteration
}
for (SCTAB i = 0; i < static_cast<SCTAB>(maTabs.size()); i++)
@@ -2376,10 +2375,10 @@ void ScDocument::TransposeClip(ScDocument* pTransClip, InsertDeleteFlags nFlags,
if (maTabs[i])
{
OSL_ENSURE(pTransClip->maTabs[i], "TransposeClip: Table not there");
- maTabs[i]->TransposeClip(aClipRange.aStart.Col(), aClipRange.aStart.Row(),
- aClipRange.aEnd.Col(), aClipRange.aEnd.Row(), nRowOffset,
- pTransClip->maTabs[i].get(), nFlags, bAsLink,
- bIncludeFiltered);
+ maTabs[i]->TransposeClip(
+ aClipRange.aStart.Col(), aClipRange.aStart.Row(), aClipRange.aEnd.Col(),
+ aClipRange.aEnd.Row(), aCombinedClipRange.aStart.Row(), nRowOffset,
+ pTransClip->maTabs[i].get(), nFlags, bAsLink, bIncludeFiltered);
if ( mpDrawLayer && ( nFlags & InsertDeleteFlags::OBJECTS ) )
{