diff options
author | Thomas Lange <tl@openoffice.org> | 2000-11-14 08:58:45 +0000 |
---|---|---|
committer | Thomas Lange <tl@openoffice.org> | 2000-11-14 08:58:45 +0000 |
commit | c06780e8e0889e77cf21fcfdfa11ee526ff34bbe (patch) | |
tree | 4398c3b5d1f3dba01edc9331a762466ae87c038e /svx/source | |
parent | c30a5a4dfc4ac872c140250901116e12ba5c410c (diff) |
SvtPathOptions now used to find dictionries instead of SfxIniManager
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/editeng/unolingu.cxx | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/svx/source/editeng/unolingu.cxx b/svx/source/editeng/unolingu.cxx index d701a846e9d2..5870a80ad590 100644 --- a/svx/source/editeng/unolingu.cxx +++ b/svx/source/editeng/unolingu.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unolingu.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: tl $ $Date: 2000-10-27 10:25:31 $ + * last change: $Author: tl $ $Date: 2000-11-14 09:58:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,9 +63,6 @@ #include <unolingu.hxx> -#ifndef _SFXINIMGR_HXX -#include <svtools/iniman.hxx> -#endif #ifndef _LANG_HXX #include <tools/lang.hxx> #endif @@ -75,6 +72,9 @@ #ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> #endif +#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX +#include <svtools/pathoptions.hxx> +#endif #ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_ #include <com/sun/star/frame/XStorable.hpp> #endif @@ -548,7 +548,7 @@ SvxAlternativeSpelling SvxGetAltSpelling( OUString aRplc( aHyphenatedWord.copy( nTxtStart, nTxtLen ) ); aRes.aReplacement = aRplc; - aRes.nChangedPos = nPosL; + aRes.nChangedPos = (INT16) nPosL; aRes.nChangedLength = nChgLen; aRes.bIsAltSpelling = TRUE; aRes.xHyphWord = rHyphWord; @@ -634,19 +634,11 @@ sal_Int32 SvxGetLanguagePos(const Sequence< Language > &rSeq, Language nLang) String SvxGetDictionaryURL(const String &rDicName, sal_Bool bIsUserDic) { // get directory to use - SfxIniManager *pIniMgr = SfxIniManager::Get(); - sal_uInt16 nSfxIniKey = bIsUserDic ? - SFX_KEY_USERDICTIONARY_DIR : SFX_KEY_DICTIONARY_PATH; - String aDirName ( pIniMgr->Get( nSfxIniKey ) ); - - INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); - aURLObj.SetSmartURL( aDirName ); - DBG_ASSERT(!aURLObj.HasError(), "lng : invalid URL"); - aURLObj.Append( rDicName ); - DBG_ASSERT(!aURLObj.HasError(), "lng : invalid URL"); - - return aURLObj.GetMainURL(); + String aURL ( rDicName ); + SvtPathOptions::Pathes ePath = bIsUserDic ? + SvtPathOptions::PATH_USERDICTIONARY : SvtPathOptions::PATH_DICTIONARY; + BOOL bRes = SvtPathOptions().SearchFile( aURL, ePath ); + return bRes ? aURL : String(); } //TL:TODO: soll mal den rictigen Rckgabetyp bekommen! @@ -718,8 +710,8 @@ sal_Bool SvxSaveDictionaries( const Reference< XDictionaryList > &xDicList ) Sequence< Reference< XDictionary > > aDics( xDicList->getDictionaries() ); const Reference< XDictionary > *pDic = aDics.getConstArray(); - sal_Int16 nCount = aDics.getLength(); - for (sal_Int16 i = 0; i < nCount; i++) + INT32 nCount = aDics.getLength(); + for (INT32 i = 0; i < nCount; i++) { try { |