sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 041b3d8166fcfe38aa04c39f94c2ada140eaf991 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Sun Jul 21 21:05:04 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Jul 22 08:23:18 2024 +0200 drawpage::getCount is expensive so only call it once at the start of the loop. Shaves 1% off the cost of loading complex documents with lots of shapes. Change-Id: Ieb985b2523f6b4db3313eb000cf64e9c689e65c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx index 5c22378a166f..857922dc833e 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -3799,7 +3799,7 @@ bool isContentEmpty(uno::Reference<text::XText> const& xText, uno::Reference<tex auto xDrawPage = xDrawPageSupplier->getDrawPage(); if (xDrawPage && xDrawPage->hasElements()) { - for (sal_Int32 i = 0; i < xDrawPage->getCount(); ++i) + for (sal_Int32 i = 0, nCount = xDrawPage->getCount(); i < nCount; ++i) { uno::Reference<text::XTextContent> xShape(xDrawPage->getByIndex(i), uno::UNO_QUERY); if (xShape.is())