diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-12-02 01:17:15 +0900 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-19 14:55:57 +0100 |
commit | 5edcad739aef770831d1fe5c3c6f4733474f338c (patch) | |
tree | c02727f63e7ffa2844be8fd9ca770a344f29ce23 /desktop/qa | |
parent | 27d8d3758957342053f8fdfcbf51ada0c9cd12f0 (diff) |
Calculate print page ranges only when needed, cache in print state
When printing or exporting PDF, we need to calculate the page
print (cell) ranges for the current zoom level (document size).
This is quite a expensive thing to do as you need to inspect
the properties of individual cells.
The calculation ideally needs to be done only once per printing
request, but because of the rendering UNO API, this was done
everytime ScPrintFunc was instantiated, which is for every page
twice (once getRenderer is called and then when render is called).
To fix this performance issue, the print page ranges need to be
carried from one call to ScPrintFunc to the other. There already
is a print state (ScPrintState) which is used for exactly that,
but it didn't do this for print page ranges.
With this, PDF export time in a test case decreased from 17 sec to
around 3 sec.
Change-Id: I97ade0e397960c5c98379e4bb28e57c5411ff757
Reviewed-on: https://gerrit.libreoffice.org/45689
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 5684e53b931eaaac658bc3246ae1c3249e252fdb)
Diffstat (limited to 'desktop/qa')
0 files changed, 0 insertions, 0 deletions