summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-26 16:24:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-27 08:57:14 +0200
commitb4b8a50110474fd7221be6ab5e295197076ed427 (patch)
tree681bcfbc5ad39101f32d2c1614c1dd1640da8e06 /sc
parente226571a5a29d55a867e70f7e03e482d1bdcc3d0 (diff)
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>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx27
1 files changed, 16 insertions, 11 deletions
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