summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-05-03 11:42:25 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-05-03 11:42:25 -0400
commitaca405778521ffd6c6c4d08ed25412ae35edb3f2 (patch)
treebe3c1a91c1cb8a70968cbf551929b1b3bda5cd56 /sc/qa/unit
parentb0b00b43b3c7a104b9e4a1f92ef2a2fd8c2fd061 (diff)
Attempt to explicitly get UI locale to en-US during unit test.
But this currently causes runtime exception. I must be missing something...
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/ucalc.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 17ebd3358a43..35558d1a75a3 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -304,6 +304,28 @@ Test::Test()
//of retaining references to the root ServiceFactory as its passed around
comphelper::setProcessServiceFactory(xSM);
+#if 0
+ // TODO: attempt to explicitly set UI locale to en-US, to get the unit
+ // test to work under non-English build environment. But this causes
+ // runtime exception....
+ uno::Reference<lang::XMultiServiceFactory> theConfigProvider =
+ uno::Reference<lang::XMultiServiceFactory> (
+ xSM->createInstance(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))), uno::UNO_QUERY_THROW);
+
+ uno::Sequence<uno::Any> theArgs(1);
+ OUString aLocalePath(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Linguistic/General"));
+ theArgs[0] <<= aLocalePath;
+ uno::Reference<beans::XPropertySet> xProp(
+ theConfigProvider->createInstanceWithArguments(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess")), theArgs), uno::UNO_QUERY_THROW);
+
+ OUString aLang(RTL_CONSTASCII_USTRINGPARAM("en-US"));
+ uno::Any aAny;
+ aAny <<= aLang;
+ xProp->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale")), aAny);
+#endif
+
// initialise UCB-Broker
uno::Sequence<uno::Any> aUcbInitSequence(2);
aUcbInitSequence[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local"));