summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/CppunitTest_sw_layoutwriter.mk1
-rw-r--r--sw/qa/extras/layout/layout.cxx6
2 files changed, 5 insertions, 2 deletions
diff --git a/sw/CppunitTest_sw_layoutwriter.mk b/sw/CppunitTest_sw_layoutwriter.mk
index eb25e0258fd8..aaddcffb4d8a 100644
--- a/sw/CppunitTest_sw_layoutwriter.mk
+++ b/sw/CppunitTest_sw_layoutwriter.mk
@@ -34,6 +34,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_layoutwriter, \
vcl \
tl \
utl \
+ i18nlangtag \
))
$(eval $(call gb_CppunitTest_use_externals,sw_layoutwriter,\
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index bb3aea800d0e..af45e6ba8db4 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -15,6 +15,7 @@
#include <officecfg/Office/Common.hxx>
#include <comphelper/scopeguard.hxx>
#include <unotools/syslocaleoptions.hxx>
+#include <i18nlangtag/languagetag.hxx>
#include <vcl/scheduler.hxx>
#include <fmtanchr.hxx>
#include <fmtfsize.hxx>
@@ -2536,10 +2537,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testUserFieldTypeLanguage)
{
// Set the system locale to German, the document will be English.
SvtSysLocaleOptions aOptions;
+ OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
aOptions.SetLocaleConfigString("de-DE");
aOptions.Commit();
- comphelper::ScopeGuard g([&aOptions] {
- aOptions.SetLocaleConfigString(OUString());
+ comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
+ aOptions.SetLocaleConfigString(sLocaleConfigString);
aOptions.Commit();
});