diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-28 13:25:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-28 17:17:55 +0100 |
commit | 3819e4f6f70ee60fc5c805f0d33c0062a396918c (patch) | |
tree | 407522623d156aaecf520752a8cb765767491c1f /sc/source | |
parent | 5ec7c4eecf955090cc3bdd7a283aa5a291d12385 (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/documen9.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
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)); |