[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/qa
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue May 3 08:43:44 PDT 2011
sc/qa/unit/ucalc.cxx | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
New commits:
commit 5051d6a1f1e239fb38c60a227046111ec438a518
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue May 3 11:42:25 2011 -0400
Attempt to explicitly get UI locale to en-US during unit test.
But this currently causes runtime exception. I must be missing
something...
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 1138769..dd86f8b 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"));
More information about the Libreoffice-commits
mailing list