[Libreoffice-commits] core.git: Branch 'aoo/trunk' - lingucomponent/source
Tsutomu Uchino
hanya at apache.org
Fri Sep 23 14:10:45 UTC 2016
lingucomponent/source/spellcheck/spell/sspellimp.cxx | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
New commits:
commit 76c1ee2548c52f393151abec9c2690656527558d
Author: Tsutomu Uchino <hanya at apache.org>
Date: Fri Sep 23 12:26:31 2016 +0000
#i127071# Fix illegal index on locations of spell cheker dictionary
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 921986c..1958b03 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -179,14 +179,23 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
std::list< SvtLinguConfigDictionaryEntry >::const_iterator aDictIt;
for (aDictIt = aDics.begin(); aDictIt != aDics.end(); ++aDictIt)
{
- uno::Sequence< rtl::OUString > aLocaleNames( aDictIt->aLocaleNames );
uno::Sequence< rtl::OUString > aLocations( aDictIt->aLocations );
- sal_Int32 nLen2 = aLocaleNames.getLength();
- for (k = 0; k < nLen2; ++k)
+ if ( xAccess.is() && aLocations.getLength() )
{
- if (xAccess.is() && xAccess->exists(aLocations[k]))
+ sal_Bool bAllFileExists = sal_False;
+ sal_Int32 nLength = aLocations.getLength();
+ for (sal_Int32 i = 0; i < nLength; ++i)
{
- aLocaleNamesSet.insert( aLocaleNames[k] );
+ bAllFileExists |= xAccess->exists( aLocations[i] );
+ }
+ if ( bAllFileExists )
+ {
+ uno::Sequence< rtl::OUString > aLocaleNames( aDictIt->aLocaleNames );
+ sal_Int32 nLen2 = aLocaleNames.getLength();
+ for (k = 0; k < nLen2; ++k)
+ {
+ aLocaleNamesSet.insert( aLocaleNames[k] );
+ }
}
}
}
More information about the Libreoffice-commits
mailing list