office-gobmx/test
Miklos Vajna aaf6ce108e cool#7492 sfx2 lok: set language/locale on async sidebar update
Create two Calc views, set the first view language to English, second
view language to German. Type in the English view, double-click on a
chart in the German view. The sidebar in the German view will have
English strings in it. This doesn't happen if there is no typing right
after the chart activation in the English view.

What happens is that the sidebar update is async, and
sfx2::sidebar::SidebarController::notifyContextChangeEvent() gets
called, which registers an aync event when it calls
AsynchronousCall::RequestCall(). Then later this job gets scheduled, but
possibly by that time the active view is the English one, leading to
English strings when chart::ColumnChartDialogController::getName() calls
SchResId(), which works from the language of the current view.

Fix the problem similar to what commit
fb7b0b9447 (cool#7492 sfx2 lok: just set
language/locale on async binding update, 2024-01-09), did: set the
language/locale from the current view before executing the async job and
restore the old value once we're done.

Extract the now duplicated code to a new SfxLokLanguageGuard, so in case
more places have a problem with incorrect l10n, then it's meant to be a
one-liner to fix further places.

Change-Id: I52724a24d93fb753175a3b9b99bc33178519d981
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161920
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2024-01-11 12:06:52 +01:00
..
qa/cppunit
signing-keys
source cool#7492 sfx2 lok: set language/locale on async sidebar update 2024-01-11 12:06:52 +01:00
user-template
CppunitTest_test_a11y.mk
CppunitTest_test_xpath.mk
IwyuFilter_test.yaml
Library_subsequenttest.mk
Library_test.mk
Library_test_setupvcl.mk
Library_vclbootstrapprotector.mk
Makefile
Module_test.mk
Package_unittest.mk
README.md
README.vars

Test Harness Code for C++ Unit Testing

Many of these tests are run during the build process. In that case on unix, if a test fails follow the error messages to debug it under gdb.