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
e57401ae
Kaydet (Commit)
e57401ae
authored
Mar 29, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#704287 Logically dead code
Change-Id: Iab22d2d12319bc01f9aebc1dcf40f47881d40446
üst
44aa2dc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
43 deletions
+40
-43
stringresource.cxx
scripting/source/stringresource/stringresource.cxx
+40
-43
No files found.
scripting/source/stringresource/stringresource.cxx
Dosyayı görüntüle @
e57401ae
...
@@ -481,57 +481,54 @@ void StringResourceImpl::newLocale( const Locale& locale )
...
@@ -481,57 +481,54 @@ void StringResourceImpl::newLocale( const Locale& locale )
}
}
// TODO?: Check if locale is valid? How?
// TODO?: Check if locale is valid? How?
bool
bValid
=
true
;
//if (!bValid)
if
(
bValid
)
//{
{
// OUString errorMsg("StringResourceImpl: Invalid locale");
LocaleItem
*
pLocaleItem
=
new
LocaleItem
(
locale
);
// throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
m_aLocaleItemVector
.
push_back
(
pLocaleItem
);
//}
pLocaleItem
->
m_bModified
=
true
;
LocaleItem
*
pLocaleItem
=
new
LocaleItem
(
locale
);
// Copy strings from default locale
m_aLocaleItemVector
.
push_back
(
pLocaleItem
);
LocaleItem
*
pCopyFromItem
=
m_pDefaultLocaleItem
;
pLocaleItem
->
m_bModified
=
true
;
if
(
pCopyFromItem
==
NULL
)
pCopyFromItem
=
m_pCurrentLocaleItem
;
// Copy strings from default locale
if
(
pCopyFromItem
!=
NULL
&&
loadLocale
(
pCopyFromItem
)
)
LocaleItem
*
pCopyFromItem
=
m_pDefaultLocaleItem
;
if
(
pCopyFromItem
==
NULL
)
pCopyFromItem
=
m_pCurrentLocaleItem
;
if
(
pCopyFromItem
!=
NULL
&&
loadLocale
(
pCopyFromItem
)
)
{
const
IdToStringMap
&
rSourceMap
=
pCopyFromItem
->
m_aIdToStringMap
;
IdToStringMap
&
rTargetMap
=
pLocaleItem
->
m_aIdToStringMap
;
IdToStringMap
::
const_iterator
it
;
for
(
it
=
rSourceMap
.
begin
();
it
!=
rSourceMap
.
end
();
++
it
)
{
{
const
IdToStringMap
&
rSourceMap
=
pCopyFromItem
->
m_aIdToStringMap
;
OUString
aId
=
(
*
it
).
first
;
IdToStringMap
&
rTargetMap
=
pLocaleItem
->
m_aIdToStringMap
;
OUString
aStr
=
(
*
it
).
second
;
IdToStringMap
::
const_iterator
it
;
rTargetMap
[
aId
]
=
aStr
;
for
(
it
=
rSourceMap
.
begin
();
it
!=
rSourceMap
.
end
();
++
it
)
{
OUString
aId
=
(
*
it
).
first
;
OUString
aStr
=
(
*
it
).
second
;
rTargetMap
[
aId
]
=
aStr
;
}
const
IdToIndexMap
&
rSourceIndexMap
=
pCopyFromItem
->
m_aIdToIndexMap
;
IdToIndexMap
&
rTargetIndexMap
=
pLocaleItem
->
m_aIdToIndexMap
;
IdToIndexMap
::
const_iterator
it_index
;
for
(
it_index
=
rSourceIndexMap
.
begin
();
it_index
!=
rSourceIndexMap
.
end
();
++
it_index
)
{
OUString
aId
=
(
*
it_index
).
first
;
sal_Int32
nIndex
=
(
*
it_index
).
second
;
rTargetIndexMap
[
aId
]
=
nIndex
;
}
pLocaleItem
->
m_nNextIndex
=
pCopyFromItem
->
m_nNextIndex
;
}
}
if
(
m_pCurrentLocaleItem
==
NULL
)
const
IdToIndexMap
&
rSourceIndexMap
=
pCopyFromItem
->
m_aIdToIndexMap
;
m_pCurrentLocaleItem
=
pLocaleItem
;
IdToIndexMap
&
rTargetIndexMap
=
pLocaleItem
->
m_aIdToIndexMap
;
IdToIndexMap
::
const_iterator
it_index
;
if
(
m_pDefaultLocaleItem
==
NULL
)
for
(
it_index
=
rSourceIndexMap
.
begin
();
it_index
!=
rSourceIndexMap
.
end
();
++
it_index
)
{
{
m_pDefaultLocaleItem
=
pLocaleItem
;
OUString
aId
=
(
*
it_index
).
first
;
m_bDefaultModified
=
true
;
sal_Int32
nIndex
=
(
*
it_index
).
second
;
rTargetIndexMap
[
aId
]
=
nIndex
;
}
}
pLocaleItem
->
m_nNextIndex
=
pCopyFromItem
->
m_nNextIndex
;
implModified
();
}
}
else
if
(
m_pCurrentLocaleItem
==
NULL
)
m_pCurrentLocaleItem
=
pLocaleItem
;
if
(
m_pDefaultLocaleItem
==
NULL
)
{
{
OUString
errorMsg
(
"StringResourceImpl: Invalid locale"
)
;
m_pDefaultLocaleItem
=
pLocaleItem
;
throw
IllegalArgumentException
(
errorMsg
,
Reference
<
XInterface
>
(),
0
)
;
m_bDefaultModified
=
true
;
}
}
implModified
();
}
}
void
StringResourceImpl
::
removeLocale
(
const
Locale
&
locale
)
void
StringResourceImpl
::
removeLocale
(
const
Locale
&
locale
)
...
...
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