diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-11-30 16:19:53 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-11-30 16:19:53 +0100 |
commit | f9c03e6704fb1a2caeb2a152c493708505e9df67 (patch) | |
tree | 4aba461736876772fb199fb2f19ce5f25b25f355 /configmgr/source | |
parent | 8e7be2d16b30830d547e7478e55fe0e32e149b7d (diff) | |
parent | 406dec43952fa9a7afa55738c6e7df317ad26275 (diff) |
OOO330
Diffstat (limited to 'configmgr/source')
-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(); + } } } } |