Kaydet (Commit) b4b8a501 authored tarafından Noel Grandin's avatar Noel Grandin

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: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e226571a
...@@ -1768,18 +1768,23 @@ void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const Sfx ...@@ -1768,18 +1768,23 @@ void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const Sfx
ScDocument& rDoc = pDocShell->GetDocument(); ScDocument& rDoc = pDocShell->GetDocument();
if ( eFamily == SfxStyleFamily::Para ) if ( eFamily == SfxStyleFamily::Para )
{ {
// update line height // If we are loading, we can delay line height calculcation, because we are going to re-calc all of those
ScopedVclPtrInstance< VirtualDevice > pVDev; // after load.
Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); if (pDocShell && !pDocShell->IsLoading())
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 ); // update line height
pDocShell->SetDocumentModified(); 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 else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment