[GSOC] ODS Row height import

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Jun 25 18:46:47 PDT 2012


Hello Daniel,

2012/6/25 Daniel Bankston <daniel.dev.libreoffice at gmail.com>:
> Hi, Markus,
>
> I was right about some things, and I was wrong about some other things.
>
> XMLTableStylesContext::EndElement() did use ScXMLImport::InsertStyles()
> which used ScTable::SetOptimalHeight() (or something similar) to set the row
> heights.  I used ScDocument::EnableAdjustHeight(false) to prevent
> SetOptimalHeight() from actually doing any work.
>
> ScXMLImport::endDocument() did use ScMyTables::UpdateRowHeights() which used
> ScTable::SetOptimalHeightOnly() to set the row heights for the visible sheet
> and any sheets with tabs.  I removed the call to this method, and I removed
> the method itself since nothing else was using it.
>
> Turns out that the row height was already being imported using UNO.
>  ScXMLTableRowContext::EndElement() uses
> XMLTableStyleContext::FillPropertySet() which uses
> ScDocument::SetRowHeightOnly() to set the row height to the imported row
> height values.  This remains.
>
> With these changes, the all unit tests passed and visual inspection of the
> heights appeared correct.  Using my slow debug build on my laptop (Intel
> Core2 Duo T7500 @ 2.20GHz running 32bit GNU/Linux with 3.5GB of ram) and the
> large test file that you gave me, the total load time was consistently
> shorter from 1:48 to 1:37.

I still wonder why we need so long to import this document. Anyway
1:37 is already a great improvement.

>
> I'll push my commits to my feature branch so you can see the changes.
>
> Do you think there is something I am missing here?  For example, will there
> ever be a case where row height is not specified, requiring us to calculate
> the row height?
>

I'm not sure if we need to recalculate the row height in case of
style:use-optimal-row-height
 but that is something we can figure out later. Except for this case I
currently see no reason why we would need to calculate row height but
Kohei or Eike may have an idea.

Regards,
Markus


More information about the LibreOffice mailing list