[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 2 commits - configmgr/source
René Engelhard
rene at kemper.freedesktop.org
Sun Nov 21 05:49:52 PST 2010
configmgr/source/childaccess.cxx | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
New commits:
commit 07117ad2a4c7cf9b09bc6d7636df81ad10c0bed0
Author: sb <sb at openoffice.org>
Date: Wed Nov 17 15:16:52 2010 +0100
sb136: #i115386# prefer en[-US] over empty xml:lang value, to accomodate existing extensions with bad .xcu content
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index d3b5480..3ec23b7 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -283,8 +283,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;
@@ -297,6 +297,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()) {
@@ -306,10 +309,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();
+ }
}
}
}
commit f5fca8ffd0bf39198ed424240fa83556c568b7dd
Author: sb <sb at openoffice.org>
Date: Thu Sep 23 16:17:38 2010 +0200
sb132: #i114155# use "en" as additional fallback locale after "en-US"
(transplanted from 630d6876c61cd1e0d42b8aa18bfc2ab22079a20f)
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 81e0feb..d3b5480 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -284,8 +284,9 @@ css::uno::Any ChildAccess::asValue() {
// 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:
+ // "en" 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);
@@ -302,10 +303,14 @@ css::uno::Any ChildAccess::asValue() {
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()) {
+ std::vector< rtl::Reference< ChildAccess > > all(
+ getAllChildren());
+ if (!all.empty()) {
+ child = all.front();
+ }
}
}
}
More information about the Libreoffice-commits
mailing list