diff options
author | Mark Hung <marklh9@gmail.com> | 2019-04-28 23:22:20 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2019-05-10 13:48:39 +0200 |
commit | b67fbe0a163a8bb5bc30eb84ad796dcd24a27145 (patch) | |
tree | 8329931ddb8607b7f5379b475bec82c0e9ff05fb /sw/qa | |
parent | 5ad4e88c0521024bf9d94a6199c5c8f6060fc93b (diff) |
sw/qa: recover locale in testUserFieldTypeLanguage.
In testUserFieldTypeLanguage the locale was set to de-DE
first then revert by calling SetLocaleConfigString with an
empty string when the test finished. Calling
SetLocaleConfigString with an empty string set the system
locale to the system default, which is not necessarily en-US
which is the default for unit tests.
Unfortunately it makes testTdf108021 fail because the
layouts in the testTdf108021 are different in en-US and
zh-TW locale in my environment. This locale-dependent layout
issue is tracked as tdf#125025 now.
Change-Id: I50ae2df5fb4624f94d070742c6189bf333370137
Reviewed-on: https://gerrit.libreoffice.org/71480
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
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(); }); |