summaryrefslogtreecommitdiff
path: root/vcl/source/app/svapp.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-10-28 13:04:00 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-10-28 13:59:36 +0200
commit616e95c7044e8ea4fe3396dfa22c4ef7e9d4cd32 (patch)
tree4e589b50d42a5bd6fc211da00e4781667d7f2682 /vcl/source/app/svapp.cxx
parent8db9337f35829d8592545055d03718ba0a204950 (diff)
lok: You can't assume that destroyView would only destroy one view
In case you have some in-place clients (e.g., Math in-place editing is active), destroying the parent view would also destroy children, and then both numberOfViewsChanged (called from doc_destroyView) must tolerate 0 as a valid input, and lok_doc_view_destroy must make sure to destroy the document after the last views had gone. Change-Id: I32370fea49da0969e1fbbf971a397c4d657ec8f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141963 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'vcl/source/app/svapp.cxx')
-rw-r--r--vcl/source/app/svapp.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 6fb299f82a0f..6dfa35c61551 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1830,6 +1830,8 @@ bool isUnipoll()
void numberOfViewsChanged(int count)
{
+ if (count == 0)
+ return;
ImplSVData * pSVData = ImplGetSVData();
auto& rCache = pSVData->maGDIData.maScaleCache;
// Normally the cache size is set to 10, scale according to the number of users.