diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-03-25 15:30:11 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-03-25 15:30:11 +0000 |
commit | 5f97590cd1482c5f60ee6ce957e6e9b3eddcb543 (patch) | |
tree | 389d5a996bb55f23d6fc5dd0c03ad6f3235ee9e2 /linguistic | |
parent | 67a35c100ea5f7f976fd6f2e74abf0273913981e (diff) |
INTEGRATION: CWS tl41_DEV300 (1.7.8); FILE MERGED
2008/02/05 15:33:11 tl 1.7.8.7: #i80287#, #i81365# changes to linguistic.xcu and for dictionaries as extensions
2007/08/07 10:53:11 tl 1.7.8.6: #i80286# use multi-pathes for 'Dictionary' and 'Linguistic'
2007/08/06 14:20:18 tl 1.7.8.5: #i80286# use multi-pathes for 'Dictionary' and 'Linguistic'
2007/08/06 14:19:26 tl 1.7.8.4: #i80286# use multi-pathes for 'Dictionary' and 'Linguistic'
2007/08/06 13:01:29 tl 1.7.8.3: #i80286# use multi-pathes for 'Dictionary' and 'Linguistic'
2007/08/06 11:50:17 tl 1.7.8.2: #i80286# use multi-pathes for 'Dictionary' and 'Linguistic'
2007/08/06 11:22:18 tl 1.7.8.1: #i80286# use multi-pathes for 'Dictionary' and 'Linguistic'
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/supplang.cxx | 99 |
1 files changed, 6 insertions, 93 deletions
diff --git a/linguistic/source/supplang.cxx b/linguistic/source/supplang.cxx index af049f31dfbb..905a5155ae24 100644 --- a/linguistic/source/supplang.cxx +++ b/linguistic/source/supplang.cxx @@ -4,9 +4,9 @@ * * $RCSfile: supplang.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: ihi $ $Date: 2007-06-05 14:29:53 $ + * last change: $Author: obo $ $Date: 2008-03-25 16:30:11 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -63,7 +63,9 @@ #ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX #include <unotools/localedatawrapper.hxx> #endif - +#ifndef _UNOTOOLS_UCBHELPER_HXX +#include <unotools/ucbhelper.hxx> +#endif #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> @@ -107,42 +109,6 @@ namespace linguistic /////////////////////////////////////////////////////////////////////////// -BOOL FileExists( const String &rMainURL ) -{ - BOOL bExists = FALSE; - if (rMainURL.Len()) - { - try - { - ::ucbhelper::Content aContent( rMainURL, - uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >()); - bExists = aContent.isDocument(); - } - catch(Exception &) - { - } - } - return bExists; -} - -String GetFileURL( SvtPathOptions::Pathes ePath, const String &rFileName ) -{ - String aURL; - if (rFileName.Len()) - { - INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); - aURLObj.SetSmartURL( GetModulePath(ePath) ); - DBG_ASSERT(!aURLObj.HasError(), "lng : invalid URL"); - aURLObj.Append( rFileName ); - DBG_ASSERT(!aURLObj.HasError(), "lng : invalid URL"); - aURL = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); - } - return aURL; -} - -/////////////////////////////////////////////////////////////////////////// - INT16 & LanguageState::GetState( ModuleName eModule ) { if ( MOD_SPELL == eModule ) @@ -227,59 +193,6 @@ const Sequence< INT16 > SuppLanguages::GetLanguages() const /////////////////////////////////////////////////////////////////////////// -String GetModulePath( SvtPathOptions::Pathes ePath, BOOL bAddAccessDelim ) -{ - String aRes; - - SvtPathOptions aPathOpt; - switch (ePath) - { - case SvtPathOptions::PATH_MODULE : - aRes = aPathOpt.GetModulePath(); - break; - case SvtPathOptions::PATH_LINGUISTIC : - { - String aTmp( aPathOpt.GetLinguisticPath() ); - LocalFileHelper::ConvertURLToPhysicalName( aTmp, aRes ); - break; - } - case SvtPathOptions::PATH_USERDICTIONARY : - { - String aTmp( aPathOpt.GetUserDictionaryPath() ); - LocalFileHelper::ConvertURLToPhysicalName( aTmp, aRes ); - break; - } - default: - DBG_ERROR( "unexpected argument (path)" ); - } - if (bAddAccessDelim && aRes.Len()) - { -#ifdef WNT - aRes += '\\'; -#else - aRes += '/'; -#endif - } - - return aRes; -} - -/////////////////////////////////////////////////////////////////////////// - -OUString StripTrailingChars( OUString &rTxt, sal_Unicode cChar ) -{ - sal_Int32 nTrailing = 0; - sal_Int32 nTxtLen = rTxt.getLength(); - sal_Int32 nIdx = nTxtLen - 1; - while (nIdx >= 0 && rTxt[ nIdx-- ] == cChar) - ++nTrailing; - - OUString aRes( rTxt.copy( nTxtLen - nTrailing ) ); - rTxt = rTxt.copy( 0, nTxtLen - nTrailing ); - return aRes; -} - -/////////////////////////////////////////////////////////////////////////// - } // namespace linguistic + |