diff options
author | sb <sb@openoffice.org> | 2010-12-07 15:07:07 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-12-07 15:07:07 +0100 |
commit | 16b85432277df4cfb6786802d7059fa087e655fe (patch) | |
tree | de5672b693eff123c1d181542ade007dcde55230 /configmgr | |
parent | 673238aef686eb3c3ce2f12d487477e9e7b5b3b0 (diff) | |
parent | 5e5f32868925e3fc20bad2b7cc1c23b77b524d5e (diff) |
sb135: merged in DEV300_m95
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/childaccess.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx index c20fa49fb18c..d387f351de30 100644 --- a/configmgr/source/childaccess.cxx +++ b/configmgr/source/childaccess.cxx @@ -282,8 +282,8 @@ 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 - // "en" locale, the first child (if any), or a nil value (even + // 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; @@ -296,6 +296,9 @@ 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()) { @@ -305,10 +308,13 @@ css::uno::Any ChildAccess::asValue() { child = getChild( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en"))); if (!child.is()) { - std::vector< rtl::Reference< ChildAccess > > all( - getAllChildren()); - if (!all.empty()) { - child = all.front(); + child = getChild(rtl::OUString()); + if (!child.is()) { + std::vector< rtl::Reference< ChildAccess > > + all(getAllChildren()); + if (!all.empty()) { + child = all.front(); + } } } } |