diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-02 00:19:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-05 12:04:40 +0200 |
commit | b094741e1d04f4e377c4a7d5c564e38d2f84c377 (patch) | |
tree | 7c1b7b46eaeb2831944771aabceac2224068dc77 /svx/Makefile | |
parent | 786802539587f2fe08ef57443e58af50146db33b (diff) |
tdf#135330: avoid replacing all settings when enabling IA2
Call to ImplHandleGetObject may happen in the middle of any UI operation,
including those that make use of references to parts of global settings,
like this:
const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
setValue(*m_xCurrentWordFT, rCurrent.nWord, rLocaleData); // < here ImplHandleGetObject may be called
setValue(*m_xCurrentCharacterFT, rCurrent.nChar, rLocaleData);
If all settings get replaced, then LocaleDataWrapper gets destroyed, and
the reference becomes invalid, and crashes in the next line.
So first, the change makes the call only modify settings when it's needed;
and second, it makes use of the implementation detail that aMisc modifies
the shared data. The check after the change will catch if implementation
changes so that this is no more true.
Yet, the problem stays that using any references to global settings objects
is unsafe, since any call to Application::SetSettings will invalidate them.
Change-Id: I96d237ee57e80465fe52bc6bb6c149b087c89af9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99947
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx/Makefile')
0 files changed, 0 insertions, 0 deletions