sc/source/ui/unoobj/styleuno.cxx | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-)
New commits: commit b4b8a50110474fd7221be6ab5e295197076ed427 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Apr 26 16:24:08 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Apr 27 08:57:14 2019 +0200 tdf#85482 FILEOPEN: very slow loading of .ODS On my machine, this takes the loading from 21s to 8s. We can delay doing line height calculation till after load, since we run the calculation over all rows after load Change-Id: I5c0d02297fb10bada28105a82da10c498ce8f6cf Reviewed-on: https://gerrit.libreoffice.org/71378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index add1d156cebf..7785d4b984c1 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1768,18 +1768,23 @@ void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const Sfx ScDocument& rDoc = pDocShell->GetDocument(); if ( eFamily == SfxStyleFamily::Para ) { - // update line height - ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); - double nPPTX = aLogic.X() / 1000.0; - double nPPTY = aLogic.Y() / 1000.0; - Fraction aZoom(1,1); - rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom ); - - if (!rDoc.IsImportingXML()) + // If we are loading, we can delay line height calculcation, because we are going to re-calc all of those + // after load. + if (pDocShell && !pDocShell->IsLoading()) { - pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PaintPartFlags::Grid|PaintPartFlags::Left ); - pDocShell->SetDocumentModified(); + // update line height + ScopedVclPtrInstance< VirtualDevice > pVDev; + Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); + double nPPTX = aLogic.X() / 1000.0; + double nPPTY = aLogic.Y() / 1000.0; + Fraction aZoom(1,1); + rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom ); + + if (!rDoc.IsImportingXML()) + { + pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PaintPartFlags::Grid|PaintPartFlags::Left ); + pDocShell->SetDocumentModified(); + } } } else _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits