[Libreoffice-commits] core.git: sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Apr 24 18:26:12 UTC 2021
sc/source/core/data/document.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 9b408a688704ad36ae2f728ef77dab9870daac97
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Apr 24 16:12:19 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Apr 24 20:25:33 2021 +0200
cid#1477317 Logically dead code
bIsMultiRangeRowFilteredTranspose can only be true if bIncludeFiltered is false
so nRowCountInRange is always set from nRowCountNonFiltered, and nRowCountAll
is then unused
Change-Id: I6b15a9d84b5db475a2ba2e230acc5d09d588dfce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114588
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 89322ceb2cdf..a0690931540c 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2356,7 +2356,7 @@ void ScDocument::TransposeClip(ScDocument* pTransClip, InsertDeleteFlags nFlags,
// handle this case specially, do not use GetClipParam().getWholeRange(),
// instead loop through the ranges, calculate the row offset and handle filtered rows and
// create in ScClipParam::transpose() a unified range.
- bool bIsMultiRangeRowFilteredTranspose
+ const bool bIsMultiRangeRowFilteredTranspose
= !bIncludeFiltered && GetClipParam().isMultiRange()
&& HasFilteredRows(aCombinedClipRange.aStart.Row(), aCombinedClipRange.aEnd.Row(),
aCombinedClipRange.aStart.Tab())
@@ -2382,10 +2382,10 @@ void ScDocument::TransposeClip(ScDocument* pTransClip, InsertDeleteFlags nFlags,
nRowOffset = nRowCount;
// calculate filtered rows of current clip range
- SCROW nRowCountAll = aClipRange.aEnd.Row() - aClipRange.aStart.Row() + 1;
SCROW nRowCountNonFiltered = CountNonFilteredRows(
aClipRange.aStart.Row(), aClipRange.aEnd.Row(), aClipRange.aStart.Tab());
- SCROW nRowCountInRange = bIncludeFiltered ? nRowCountAll : nRowCountNonFiltered;
+ assert(!bIncludeFiltered && "bIsMultiRangeRowFilteredTranspose can only be true if bIncludeFiltered is false");
+ SCROW nRowCountInRange = nRowCountNonFiltered;
nRowCount += nRowCountInRange; // for next iteration
}
More information about the Libreoffice-commits
mailing list