From 53dd6aa5f3817d42bf676980f980051c3b7cdb03 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 9 Jun 2021 17:11:15 +0200 Subject: scale VCL's scale cache according to the number of Online views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a document is opened in several Online views, each of them using a different zoom, then the scale cache is used for the scaling, and each view is sent updated tiles, so if there are too many views, the cache is not large enough. (Collabora T28503) Change-Id: I3fa719b0515064773fe4584fedbc8aff98e6e213 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116928 Tested-by: Luboš Luňák Reviewed-by: Luboš Luňák --- vcl/source/app/svapp.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vcl') diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index ecfaa3805bef..79d6dfa9c146 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1711,6 +1711,14 @@ bool isUnipoll() return pSVData && pSVData->mpPollCallback != nullptr; } +void numberOfViewsChanged(int count) +{ + ImplSVData * pSVData = ImplGetSVData(); + auto& rCache = pSVData->maGDIData.maScaleCache; + // Normally the cache size is set to 10, scale according to the number of users. + rCache.setMaxSize(count * 10); +} + } // namespace lok, namespace vcl /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit