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.grandin@collabora.co.uk>
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index add1d15..7785d4b 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -1768,18 +1768,23 @@
        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