View | Details | Raw Unified | Return to issue 126762
Collapse All | Expand All

(-)lingucomponent/source/spellcheck/spell/sspellimp.cxx (-1 / +18 lines)
Lines 33-38 Link Here
33
#include <tools/debug.hxx>
33
#include <tools/debug.hxx>
34
#include <unotools/processfactory.hxx>
34
#include <unotools/processfactory.hxx>
35
#include <osl/mutex.hxx>
35
#include <osl/mutex.hxx>
36
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
36
37
37
#include <lingutil.hxx>
38
#include <lingutil.hxx>
38
#include <hunspell.hxx>
39
#include <hunspell.hxx>
Lines 160-165 Link Here
160
        numdict = aDics.size();
161
        numdict = aDics.size();
161
        if (numdict)
162
        if (numdict)
162
        {
163
        {
164
            uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() );
165
            uno::Reference< ucb::XSimpleFileAccess > xAccess;
166
            try
167
            {
168
                xAccess.set( xServiceFactory->createInstance( 
169
                        A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW );
170
            }
171
            catch (uno::Exception & e)
172
            {
173
                DBG_ASSERT( 0, "failed to get input stream" );
174
                (void) e;
175
            }
163
            // get supported locales from the dictionaries-to-use...
176
            // get supported locales from the dictionaries-to-use...
164
            sal_Int32 k = 0;
177
            sal_Int32 k = 0;
165
            std::set< rtl::OUString, lt_rtl_OUString > aLocaleNamesSet;
178
            std::set< rtl::OUString, lt_rtl_OUString > aLocaleNamesSet;
Lines 167-176 Link Here
167
            for (aDictIt = aDics.begin();  aDictIt != aDics.end();  ++aDictIt)
180
            for (aDictIt = aDics.begin();  aDictIt != aDics.end();  ++aDictIt)
168
            {
181
            {
169
                uno::Sequence< rtl::OUString > aLocaleNames( aDictIt->aLocaleNames );
182
                uno::Sequence< rtl::OUString > aLocaleNames( aDictIt->aLocaleNames );
183
                uno::Sequence< rtl::OUString > aLocations( aDictIt->aLocations );
170
                sal_Int32 nLen2 = aLocaleNames.getLength();
184
                sal_Int32 nLen2 = aLocaleNames.getLength();
171
                for (k = 0;  k < nLen2;  ++k)
185
                for (k = 0;  k < nLen2;  ++k)
172
                {
186
                {
173
                    aLocaleNamesSet.insert( aLocaleNames[k] );
187
                    if (xAccess.is() && xAccess->exists(aLocations[k]))
188
                    {
189
                        aLocaleNamesSet.insert( aLocaleNames[k] );
190
                    }
174
                }
191
                }
175
            }
192
            }
176
            // ... and add them to the resulting sequence
193
            // ... and add them to the resulting sequence

Return to issue 126762