office-gobmx/include/sfx2/sidebar
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
..
AsynchronousCall.hxx
Context.hxx
ControllerItem.hxx
Deck.hxx
FocusManager.hxx
IContextChangeReceiver.hxx
ILayoutableWindow.hxx
Panel.hxx
PanelLayout.hxx
ResourceManager.hxx
Sidebar.hxx
SidebarChildWindow.hxx
SidebarController.hxx
SidebarDockingWindow.hxx
SidebarModelUpdate.hxx
SidebarPanelBase.hxx
TabBar.hxx
Theme.hxx