sc/source/core/data/documen9.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
New commits: commit 3819e4f6f70ee60fc5c805f0d33c0062a396918c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Mar 28 13:25:10 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Mar 28 17:17:55 2024 +0100 tdf#160399 speed up print preview takes time from 5s to 2.5s for me Change-Id: I7e62e4a47d5b2aae982273cc3ea38c5c9b04256d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165461 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 2b6685bd0ee6..59e4984db7fa 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -440,13 +440,8 @@ bool ScDocument::IsPrintEmpty( SCCOL nStartCol, SCROW nStartRow, // keep vertical part of aMMRect, only update horizontal position aMMRect = *pLastMM; - tools::Long nLeft = 0; - SCCOL i; - for (i=0; i<nStartCol; i++) - nLeft += GetColWidth(i,nTab); - tools::Long nRight = nLeft; - for (i=nStartCol; i<=nEndCol; i++) - nRight += GetColWidth(i,nTab); + tools::Long nLeft = GetColWidth(0, nStartCol-1, nTab); + tools::Long nRight = nLeft + GetColWidth(nStartCol,nEndCol, nTab); aMMRect.SetLeft(o3tl::convert(nLeft, o3tl::Length::twip, o3tl::Length::mm100)); aMMRect.SetRight(o3tl::convert(nRight, o3tl::Length::twip, o3tl::Length::mm100));