diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-09-18 10:07:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-09-19 08:00:47 +0200 |
commit | c629d8322d89e6c318a772f74a7be5370f830bef (patch) | |
tree | 95f9fdfb063bc8abe0b316eaee2aad45f8b20bb3 /sc | |
parent | d02310ba14a4c400eef4821c99287c797d376714 (diff) |
pull some code out of hot loop
Change-Id: Ic19888296d1a7be7c691714b0353f18a1ea074f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173591
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/attarray.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 9f1e37913514..94b9153b1c41 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -2400,10 +2400,11 @@ void ScAttrArray::CopyArea( SCROW nDestEnd = std::min(static_cast<tools::Long>(static_cast<tools::Long>(nEndRow) + nDy), tools::Long(rDocument.MaxRow())); const bool bSameCellAttributeHelper(&rDocument.getCellAttributeHelper() == &rAttrArray.rDocument.getCellAttributeHelper()); + const ScPatternAttr* pSourceDefaultPattern = &rDocument.getCellAttributeHelper().getDefaultCellAttribute(); + const ScPatternAttr* pDestDefaultPattern = &rAttrArray.rDocument.getCellAttributeHelper().getDefaultCellAttribute(); if ( mvData.empty() ) { - const ScPatternAttr* pNewPattern = &rAttrArray.rDocument.getCellAttributeHelper().getDefaultCellAttribute(); - rAttrArray.SetPatternArea(nDestStart, nDestEnd, pNewPattern); + rAttrArray.SetPatternArea(nDestStart, nDestEnd, pDestDefaultPattern); return; } @@ -2414,10 +2415,10 @@ void ScAttrArray::CopyArea( const ScPatternAttr* pOldPattern = mvData[i].getScPatternAttr(); CellAttributeHolder aNewPattern; - if (ScPatternAttr::areSame(&rDocument.getCellAttributeHelper().getDefaultCellAttribute(), pOldPattern )) + if (ScPatternAttr::areSame(pSourceDefaultPattern, pOldPattern )) { // default: nothing changed - aNewPattern.setScPatternAttr(&rAttrArray.rDocument.getCellAttributeHelper().getDefaultCellAttribute()); + aNewPattern.setScPatternAttr(pDestDefaultPattern); } else if ( nStripFlags != ScMF::NONE ) { |