summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-11-18 18:39:08 +0100
committerobo <obo@openoffice.org>2010-11-18 18:39:08 +0100
commit0ba27a36e332f402ac6656c8d26cc40f111a640a (patch)
tree964f2a0dd121a70bf7e547fa31dc92205ed47d2f
parentf1be314fad35a4c0c64d57fd8c6d9c5b6c9479c8 (diff)
parent731881b92ce7131aff3f78ee8cd9d7c9c524174e (diff)
CWS-TOOLING: integrate CWS sb136
Notes
split repo tag: libs-core_ooo/OOO330_m16
-rw-r--r--configmgr/source/childaccess.cxx25
1 files changed, 18 insertions, 7 deletions
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index ef2b213d4ef1..d387f351de30 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -282,9 +282,10 @@ css::uno::Any ChildAccess::asValue() {
if (!Components::allLocales(locale)) {
// Find best match using an adaption of RFC 4647 lookup matching
// rules, removing "-" or "_" delimited segments from the end;
- // defaults are the empty string locale, the "en-US" locale, the
- // first child (if any), or a nil value (even though it may be
- // illegal for the given property), in that order:
+ // defaults are the "en-US" locale, the "en" locale, the empty
+ // string locale, the first child (if any), or a nil value (even
+ // though it may be illegal for the given property), in that
+ // order:
rtl::Reference< ChildAccess > child;
for (;;) {
child = getChild(locale);
@@ -295,16 +296,26 @@ css::uno::Any ChildAccess::asValue() {
while (i > 0 && locale[i] != '-' && locale[i] != '_') {
--i;
}
+ if (i == 0) {
+ break;
+ }
locale = locale.copy(0, i);
}
if (!child.is()) {
child = getChild(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US")));
if (!child.is()) {
- std::vector< rtl::Reference< ChildAccess > > all(
- getAllChildren());
- if (!all.empty()) {
- child = all.front();
+ child = getChild(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")));
+ if (!child.is()) {
+ child = getChild(rtl::OUString());
+ if (!child.is()) {
+ std::vector< rtl::Reference< ChildAccess > >
+ all(getAllChildren());
+ if (!all.empty()) {
+ child = all.front();
+ }
+ }
}
}
}