CppunitTest_sc_tiledrendering fails when building with multiple langs

d84c0d493b changed how the langauge list
is handled, before it just cached the English names and used those even
after the UI langauge was changed, after the change it will recreate the
list and use the localized names.
That broke the checks, so forcing the language to en-US is a workaround,
but it doesn't seem like the proper fix esp. for the second instance:
* open a french document, so content is in French, using janvier as
  expected.
* script sets language to Spanish, that works since at that point LO's
  UI is English still, recalculating with that returns ene / enero
* script then tries to set the language to English but fails, document
  stays in Spanish and still returns ene

the language selection depends on the available languages, so setting
the language to Enlish before trying to set a different language seems
like an unnecessary hack/surely there's a way to set the document
language without depending on localized names.

Change-Id: I95957c0900523a49112eb48dc7a016950ffc7ab8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206313
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Christian Lohmaier
2026-06-16 12:18:25 +02:00
parent 70bf50bb8d
commit bffafd8d08
@@ -1160,6 +1160,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testLanguageStatus)
// view #1
SfxViewShell* pView1 = SfxViewShell::Current();
pView1->SetLOKLocale(u"en-US"_ustr);
// view #2
int nView1 = SfxLokHelper::getCurrentView();
@@ -3693,6 +3694,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testLOKLanguageStatus)
}
{
pView->SetLOKLocale(u"en-US"_ustr);
uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
{ "Language", uno::Any(u"Default_English (USA)"_ustr) },
}));