summaryrefslogtreecommitdiff
path: root/linguistic/source/dlistimp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'linguistic/source/dlistimp.cxx')
-rw-r--r--linguistic/source/dlistimp.cxx42
1 files changed, 25 insertions, 17 deletions
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 7c8b4ddc06..32f30b88ba 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,18 +39,25 @@
#include <tools/fsys.hxx>
#include <tools/stream.hxx>
#include <tools/urlobj.hxx>
+#include <i18npool/mslangid.hxx>
+#include <unotools/pathoptions.hxx>
+#include <unotools/useroptions.hxx>
+#include <cppuhelper/factory.hxx> // helper for factories
#include <unotools/localfilehelper.hxx>
-#include <unotools/processfactory.hxx>
+#include <comphelper/processfactory.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <vcl/svapp.hxx>
-
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/linguistic2/DictionaryEventFlags.hpp>
#include <com/sun/star/linguistic2/DictionaryListEventFlags.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+
+#include "defs.hxx"
+#include "dlistimp.hxx"
+#include "dicimp.hxx"
+#include "lngopt.hxx"
#include "defs.hxx"
#include "dlistimp.hxx"
@@ -322,9 +329,9 @@ DicList::~DicList()
}
-void DicList::SearchForDictionaries(
+void DicList::SearchForDictionaries(
DictionaryVec_t&rDicList,
- const String &rDicDirURL,
+ const String &rDicDirURL,
BOOL bIsWriteablePath )
{
osl::MutexGuard aGuard( GetLinguMutex() );
@@ -379,10 +386,10 @@ void DicList::SearchForDictionaries(
{
// get decoded dictionary file name
INetURLObject aURLObj( aURL );
- String aDicName = aURLObj.getName( INetURLObject::LAST_SEGMENT,
- true, INetURLObject::DECODE_WITH_CHARSET,
+ String aDicName = aURLObj.getName( INetURLObject::LAST_SEGMENT,
+ true, INetURLObject::DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8 );
-
+
DictionaryType eType = bNeg ? DictionaryType_NEGATIVE : DictionaryType_POSITIVE;
uno::Reference< XDictionary > xDic =
new DictionaryNeo( aDicName, nLang, eType, aURL, bIsWriteablePath );
@@ -691,8 +698,8 @@ void DicList::_CreateDicList()
xIgnAll->setActive( TRUE );
addDictionary( xIgnAll );
}
-
-
+
+
// evaluate list of dictionaries to be activated from configuration
//
//! to suppress overwriting the list of active dictionaries in the
@@ -712,11 +719,11 @@ void DicList::_CreateDicList()
xDic->setActive( TRUE );
}
}
-
+
// suppress collected events during creation of the dictionary list.
// there should be no events during creation.
pDicEvtLstnrHelper->ClearEvents();
-
+
pDicEvtLstnrHelper->EndCollectEvents();
bInCreation = FALSE;
@@ -934,8 +941,9 @@ static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg )
if(aExt != aDIC)
return FALSE;
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() );
-
+ // get stream to be used
+ uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
+
// get XInputStream stream
uno::Reference< io::XInputStream > xStream;
try
@@ -958,7 +966,7 @@ static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg )
int nDicVersion = ReadDicVersion(pStream, nLng, bNeg);
if (2 == nDicVersion || nDicVersion >= 5)
return TRUE;
-
+
return FALSE;
}