diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-07 10:14:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-07 22:10:17 +0100 |
commit | aa6d11771d085803cdb811579f47debc30c4d94b (patch) | |
tree | ff2a91a441e95d7edf7bdd4c75055ee81d6813d7 | |
parent | 648878703d26cf73d66d9ac9132b0aa7f551ba28 (diff) |
cid#1559945 rearrange to silence Use after free
try and reassure coverity
Change-Id: I91c08b89d3345b9dcc32696a988906e2db81bb53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163087
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r-- | sc/source/core/data/table2.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 6f713ca9f957..fc34eb3b60ea 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1026,6 +1026,8 @@ static void lcl_SetTransposedPatternInRows(ScTable* pTransClip, SCROW nAttrRow1, const std::vector<SCROW>& rFilteredRows, SCROW nRowDestOffset) { + const CellAttributeHolder aPatternHolder(&rPatternAttr); + for (SCROW nRow = nAttrRow1; nRow <= nAttrRow2; nRow++) { size_t nFilteredRowAdjustment = 0; @@ -1046,7 +1048,7 @@ static void lcl_SetTransposedPatternInRows(ScTable* pTransClip, SCROW nAttrRow1, pTransClip->SetPattern( static_cast<SCCOL>(nCol1 + nRow - nRow1 - nFilteredRowAdjustment + nRowDestOffset), - static_cast<SCROW>(nCombinedStartRow + nCol - nCol1), rPatternAttr); + static_cast<SCROW>(nCombinedStartRow + nCol - nCol1), aPatternHolder); } } |