This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO41X by this push:
new d6a3fbd025 #i126762# patch by: hanya Ignore dictionary not in
specified location.
d6a3fbd025 is described below
commit d6a3fbd0259e572c54d626e74753693b08bd88fd
Author: Kay Schenk <[email protected]>
AuthorDate: Thu Jan 28 22:19:30 2016 +0000
#i126762# patch by: hanya
Ignore dictionary not in specified location.
git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1727441
13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit f47a9491cb8c1a3c71077c4073d7d9e69e1885f0)
---
.../source/spellcheck/spell/sspellimp.cxx | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/main/lingucomponent/source/spellcheck/spell/sspellimp.cxx
b/main/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 31efa2d940..0628702db9 100644
--- a/main/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/main/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -33,6 +33,7 @@
#include <tools/debug.hxx>
#include <unotools/processfactory.hxx>
#include <osl/mutex.hxx>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <lingutil.hxx>
#include <hunspell.hxx>
@@ -159,6 +160,18 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
numdict = aDics.size();
if (numdict)
{
+ uno::Reference< lang::XMultiServiceFactory > xServiceFactory(
utl::getProcessServiceFactory() );
+ uno::Reference< ucb::XSimpleFileAccess > xAccess;
+ try
+ {
+ xAccess.set( xServiceFactory->createInstance(
+ A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ),
uno::UNO_QUERY_THROW );
+ }
+ catch (uno::Exception & e)
+ {
+ DBG_ASSERT( 0, "failed to get input stream" );
+ (void) e;
+ }
// get supported locales from the dictionaries-to-use...
sal_Int32 k = 0;
std::set< rtl::OUString, lt_rtl_OUString > aLocaleNamesSet;
@@ -166,10 +179,14 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
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)
{
- aLocaleNamesSet.insert( aLocaleNames[k] );
+ if (xAccess.is() && xAccess->exists(aLocations[k]))
+ {
+ aLocaleNamesSet.insert( aLocaleNames[k] );
+ }
}
}
// ... and add them to the resulting sequence