Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b3bbdd5d
Kaydet (Commit)
b3bbdd5d
authored
Ock 28, 2008
tarafından
Vladimir Glazounov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
INTEGRATION: CWS ab42 (1.4.38); FILE MERGED
2008/01/07 13:17:23 ab 1.4.38.1: #i82278# Fixed closest match algorithm
üst
1142acab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
18 deletions
+38
-18
stringresource.cxx
scripting/source/stringresource/stringresource.cxx
+38
-18
No files found.
scripting/source/stringresource/stringresource.cxx
Dosyayı görüntüle @
b3bbdd5d
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
*
*
* $RCSfile: stringresource.cxx,v $
* $RCSfile: stringresource.cxx,v $
*
*
* $Revision: 1.
4
$
* $Revision: 1.
5
$
*
*
* last change: $Author:
rt $ $Date: 2007-01-29 16:26:23
$
* last change: $Author:
vg $ $Date: 2008-01-28 13:58:20
$
*
*
* The Contents of this file are made available subject to
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
* the terms of GNU Lesser General Public License Version 2.1.
...
@@ -394,23 +394,12 @@ void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindCl
...
@@ -394,23 +394,12 @@ void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindCl
{
{
::
osl
::
MutexGuard
aGuard
(
getMutex
()
);
::
osl
::
MutexGuard
aGuard
(
getMutex
()
);
(
void
)
locale
;
LocaleItem
*
pLocaleItem
=
NULL
;
(
void
)
FindClosestMatch
;
if
(
FindClosestMatch
)
pLocaleItem
=
getClosestMatchItemForLocale
(
locale
);
else
pLocaleItem
=
getItemForLocale
(
locale
,
true
);
LocaleItem
*
pLocaleItem
=
getItemForLocale
(
locale
,
!
FindClosestMatch
);
if
(
pLocaleItem
==
NULL
&&
FindClosestMatch
)
{
Locale
aTestLocale
(
locale
);
aTestLocale
.
Variant
=
::
rtl
::
OUString
();
pLocaleItem
=
getItemForLocale
(
locale
,
false
);
if
(
pLocaleItem
==
NULL
)
{
aTestLocale
.
Country
=
::
rtl
::
OUString
();
pLocaleItem
=
getItemForLocale
(
locale
,
false
);
if
(
pLocaleItem
==
NULL
&&
m_pDefaultLocaleItem
!=
NULL
)
pLocaleItem
=
m_pDefaultLocaleItem
;
}
}
if
(
pLocaleItem
!=
NULL
)
if
(
pLocaleItem
!=
NULL
)
{
{
loadLocale
(
pLocaleItem
);
loadLocale
(
pLocaleItem
);
...
@@ -724,6 +713,37 @@ LocaleItem* StringResourceImpl::getItemForLocale
...
@@ -724,6 +713,37 @@ LocaleItem* StringResourceImpl::getItemForLocale
return
pRetItem
;
return
pRetItem
;
}
}
// Returns the LocalItem for a given locale, if it exists, otherwise NULL
// This method performes a closest match search, at least the language must match
LocaleItem
*
StringResourceImpl
::
getClosestMatchItemForLocale
(
const
Locale
&
locale
)
{
LocaleItem
*
pRetItem
=
NULL
;
// Search for locale
for
(
sal_Int32
iPass
=
0
;
iPass
<=
2
;
++
iPass
)
{
for
(
LocaleItemVectorConstIt
it
=
m_aLocaleItemVector
.
begin
();
it
!=
m_aLocaleItemVector
.
end
();
it
++
)
{
LocaleItem
*
pLocaleItem
=
*
it
;
if
(
pLocaleItem
)
{
Locale
&
cmp_locale
=
pLocaleItem
->
m_locale
;
if
(
cmp_locale
.
Language
==
locale
.
Language
&&
(
iPass
>
1
||
cmp_locale
.
Country
==
locale
.
Country
)
&&
(
iPass
>
0
||
cmp_locale
.
Variant
==
locale
.
Variant
)
)
{
pRetItem
=
pLocaleItem
;
break
;
}
}
}
if
(
pRetItem
)
break
;
}
return
pRetItem
;
}
void
StringResourceImpl
::
implModified
(
void
)
void
StringResourceImpl
::
implModified
(
void
)
{
{
m_bModified
=
true
;
m_bModified
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment