diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-04-04 17:52:04 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-04-22 14:19:37 +0200 |
commit | 64cb1d10fffccebbc825c858083f13eb717b0553 (patch) | |
tree | bde2e6f19e2e10f691e1118911388c12b52a616c /sc/source/ui | |
parent | c315a2f7b99fc1dfbc3fc834590d22fbe41ea70f (diff) |
try to limit cell interpreting to only visible cells when drawing
If there's a document with a huge formula group, InterpretDirtyCells()
on load will only interpret the range needed for drawing. But then
scrolling just a bit could result in e.g. IsValue() call on a cell,
and that could result in unrestricted Interpret() on the whole
huge formula group, which could be slow. So explicitly interpret
just the drawn cells in the hope that it'll avoid any further
Interpret() calls.
Change-Id: I01c9f95cf8a1cf240b798feef27d21010957030c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133306
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/view/output2.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index a507e1da8452..3fbd8eab65e9 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1506,6 +1506,11 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co const SfxItemSet* pOldCondSet = nullptr; SvtScriptType nOldScript = SvtScriptType::NONE; + // Try to limit interpreting to only visible cells. Calling e.g. IsValue() + // on a formula cell that needs interpreting would call Interpret() + // for the entire formula group, which could be large. + mpDoc->InterpretCellsIfNeeded( ScRange( nX1, nY1, nTab, nX2, nY2, nTab )); + // alternative pattern instances in case we need to modify the pattern // before processing the cell value. std::vector<std::unique_ptr<ScPatternAttr> > aAltPatterns; |