diff options
Diffstat (limited to 'lingucomponent')
30 files changed, 104 insertions, 110 deletions
diff --git a/lingucomponent/inc/pch/precompiled_lingucomponent.cxx b/lingucomponent/inc/pch/precompiled_lingucomponent.cxx index 5e9246aec..250f31762 100644 --- a/lingucomponent/inc/pch/precompiled_lingucomponent.cxx +++ b/lingucomponent/inc/pch/precompiled_lingucomponent.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,3 +28,4 @@ #include "precompiled_lingucomponent.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/inc/pch/precompiled_lingucomponent.hxx b/lingucomponent/inc/pch/precompiled_lingucomponent.hxx index debf1b13e..0aeb34493 100644 --- a/lingucomponent/inc/pch/precompiled_lingucomponent.hxx +++ b/lingucomponent/inc/pch/precompiled_lingucomponent.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,3 +32,4 @@ #include <tools/debug.hxx> #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hreg.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hreg.cxx index 8ccf152d7..2ae63c8fa 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hreg.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hreg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,4 @@ void * SAL_CALL component_getFactory( /////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index e486927ca..95282ac0c 100755..100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,8 +36,6 @@ #include <cppuhelper/factory.hxx> // helper for factories #include <com/sun/star/registry/XRegistryKey.hpp> #include <i18npool/mslangid.hxx> -#include <unotools/pathoptions.hxx> -#include <unotools/useroptions.hxx> #include <tools/debug.hxx> #include <unotools/processfactory.hxx> #include <osl/mutex.hxx> @@ -65,7 +64,6 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -73,6 +71,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; + // values asigned to capitalization types #define CAPTYPE_UNKNOWN 0 #define CAPTYPE_NOCAP 1 @@ -81,8 +81,6 @@ using namespace linguistic; #define CAPTYPE_MIXED 4 // min, max - -//#define Min(a,b) (a < b ? a : b) #define Max(a,b) (a > b ? a : b) /////////////////////////////////////////////////////////////////////////// @@ -208,7 +206,7 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() // add dictionary information aDicts = new HDInfo[numdict]; - + k = 0; for (aDictIt = aDics.begin(); aDictIt != aDics.end(); ++aDictIt) { @@ -652,7 +650,6 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const while((n >=0) && (lcword[n] == '.')) n--; n++; - // fprintf(stderr,"hyphenate... %s\n",lcword); fflush(stderr); if (n > 0) { const bool bFailed = 0 != hnj_hyphen_hyphenate3(dict, lcword, n, hyphens, NULL, @@ -682,7 +679,6 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const for (int c = n; c < wordlen; c++) hyphens[c] = '0'; hyphens[wordlen] = '\0'; - // fprintf(stderr,"... %s\n",hyphens); fflush(stderr); sal_Int16 nHyphCount = 0; sal_Int16 i; @@ -712,8 +708,6 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const } hyphenatedWord = hyphenatedWordBuffer.makeStringAndClear(); - //fprintf(stderr,"result is %s\n",OU2A(hyphenatedWord)); - //fflush(stderr); xRes = new PossibleHyphens( aWord, LocaleToLanguage( aLocale ), hyphenatedWord, aHyphPos ); @@ -863,9 +857,8 @@ void SAL_CALL Hyphenator::initialize( const Sequence< Any >& rArguments ) xPropHelper = pPropHelper; pPropHelper->AddAsPropListener(); //! after a reference is established } - else - { - DBG_ERROR( "wrong number of arguments in sequence" ); + else { + OSL_FAIL( "wrong number of arguments in sequence" ); } } } @@ -978,3 +971,5 @@ void * SAL_CALL Hyphenator_getFactory( const sal_Char * pImplName, #undef CAPTYPE_INITCAP #undef CAPTYPE_ALLCAP #undef CAPTYPE_MIXED + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx index 92511cac0..e0e984908 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -158,3 +159,4 @@ inline OUString Hyphenator::getImplementationName_Static() throw() #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk index 6f767d8bf..bc5d1ae66 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk @@ -47,7 +47,7 @@ HNJLIB=hyphen.lib # --- Files -------------------------------------------------------- .IF "$(SYSTEM_HUNSPELL)" != "YES" -HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell +HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell -DHUNSPELL_STATIC .ENDIF CFLAGS += -I..$/..$/..$/lingutil $(HUNSPELL_CFLAGS) diff --git a/lingucomponent/source/languageguessing/altstrfunc.cxx b/lingucomponent/source/languageguessing/altstrfunc.cxx index 210285a7c..5461a2267 100644 --- a/lingucomponent/source/languageguessing/altstrfunc.cxx +++ b/lingucomponent/source/languageguessing/altstrfunc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*************************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,4 @@ int start(const std::string &s1, const std::string &s2){ return ret; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/languageguessing/altstrfunc.hxx b/lingucomponent/source/languageguessing/altstrfunc.hxx index 87d339d8d..5ddeda4ee 100644 --- a/lingucomponent/source/languageguessing/altstrfunc.hxx +++ b/lingucomponent/source/languageguessing/altstrfunc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*************************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,3 +40,4 @@ int start(const std::string &s1, const std::string &s2); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx index 24fe34b4e..2a377dc0f 100644 --- a/lingucomponent/source/languageguessing/guess.cxx +++ b/lingucomponent/source/languageguessing/guess.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*************************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -134,3 +135,5 @@ bool Guess::operator==(string lang) toString += GetEncoding(); return start(toString, lang); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/languageguessing/guess.hxx b/lingucomponent/source/languageguessing/guess.hxx index e007a1ba9..b05913bb2 100644 --- a/lingucomponent/source/languageguessing/guess.hxx +++ b/lingucomponent/source/languageguessing/guess.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*************************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,3 +70,5 @@ class Guess{ }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx index 0314f1757..bc942e32a 100644 --- a/lingucomponent/source/languageguessing/guesslang.cxx +++ b/lingucomponent/source/languageguessing/guesslang.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,9 +42,6 @@ #include <simpleguesser.hxx> #include <guess.hxx> -//#include <cppuhelper/queryinterface.hxx> // helper for queryInterface() impl - -//#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/linguistic2/XLanguageGuessing.hpp> @@ -51,6 +49,8 @@ #include <unotools/localfilehelper.hxx> #include <osl/thread.h> +#include <sal/macros.h> + using namespace ::rtl; using namespace ::osl; using namespace ::cppu; @@ -66,7 +66,6 @@ namespace css = ::com::sun::star; #define A2OU(x) ::rtl::OUString::createFromAscii( x ) #define SERVICENAME "com.sun.star.linguistic2.LanguageGuessing" - #define IMPLNAME "com.sun.star.lingu2.LanguageGuessing" static Sequence< OUString > getSupportedServiceNames_LangGuess_Impl() @@ -174,7 +173,7 @@ void LangGuess_Impl::EnsureInitialized() {"sa", ""}, {"ta", ""}, {"th", ""}, {"qu", ""}, {"yi", ""} }; - sal_Int32 nNum = sizeof(aDisable) / sizeof(aDisable[0]); + sal_Int32 nNum = SAL_N_ELEMENTS(aDisable); Sequence< Locale > aDisableSeq( nNum ); Locale *pDisableSeq = aDisableSeq.getArray(); for (sal_Int32 i = 0; i < nNum; ++i) @@ -191,40 +190,6 @@ void LangGuess_Impl::EnsureInitialized() //************************************************************************* -/* TL: currently not part of the API -Sequence< com::sun::star::lang::Locale > SAL_CALL LangGuess_Impl::guessLanguages( - const rtl::OUString &rText, - sal_Int32 nStartPos, - sal_Int32 nLen ) - throw (RuntimeException) -{ - Sequence< com::sun::star::lang::Locale > aRes; - - OString o = OUStringToOString( rText, RTL_TEXTENCODING_UTF8 ); - vector<Guess> gs = m_aGuesser.GuessLanguage(o.pData->buffer); - - aRes.realloc(gs.size()); - - com::sun::star::lang::Locale *pRes = aRes.getArray(); - -#ifdef DEBUG - std::cout << " We have " << gs.size() << " candidates" << std::endl; -#endif - - for(int i = 0; i < gs.size() ; i++ ){ - com::sun::star::lang::Locale current_aRes; - - current_aRes.Language = A2OU( gs[i].getLanguage().c_str() ); - current_aRes.Country = A2OU( gs[i].getCountry().c_str() ); - - pRes[i] = current_aRes; - } - - return aRes; -} -*/ -//************************************************************************* - Locale SAL_CALL LangGuess_Impl::guessPrimaryLanguage( const ::rtl::OUString& rText, ::sal_Int32 nStartPos, @@ -262,8 +227,6 @@ void LangGuess_Impl::SetFingerPrintsDB( OString conf_file_path(path); conf_file_path += conf_file_name; - //cout << "Conf file : " << conf_file_path.getStr() << " directory : " << path.getStr() << endl; - m_aGuesser.SetDBPath((const char*)conf_file_path.getStr(), (const char*)path.getStr()); } @@ -475,3 +438,4 @@ void * SAL_CALL component_getFactory( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx b/lingucomponent/source/languageguessing/simpleguesser.cxx index b6a8ee527..8bc444b8f 100644 --- a/lingucomponent/source/languageguessing/simpleguesser.cxx +++ b/lingucomponent/source/languageguessing/simpleguesser.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*************************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -232,3 +233,5 @@ void SimpleGuesser::SetDBPath(const char* path, const char* prefix){ } h = special_textcat_Init(path, prefix); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/languageguessing/simpleguesser.hxx b/lingucomponent/source/languageguessing/simpleguesser.hxx index d10f41bcb..ee76b0781 100644 --- a/lingucomponent/source/languageguessing/simpleguesser.hxx +++ b/lingucomponent/source/languageguessing/simpleguesser.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*************************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -119,3 +120,5 @@ protected: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index 15c019a14..0f286292b 100755 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,7 @@ #include "precompiled_lingucomponent.hxx" #if defined(WNT) -#include <tools/prewin.h> +#include <prewin.h> #endif #if defined(WNT) @@ -37,7 +38,7 @@ #endif #if defined(WNT) -#include <tools/postwin.h> +#include <postwin.h> #endif @@ -60,7 +61,7 @@ #include <lingutil.hxx> #include <dictmgr.hxx> - +#include <sal/macros.h> using ::com::sun::star::lang::Locale; @@ -88,7 +89,7 @@ rtl::OString Win_GetShortPathName( const rtl::OUString &rLongPathName ) rtl::OString aRes; sal_Unicode aShortBuffer[1024] = {0}; - sal_Int32 nShortBufSize = sizeof( aShortBuffer ) / sizeof( aShortBuffer[0] ); + sal_Int32 nShortBufSize = SAL_N_ELEMENTS( aShortBuffer ); // use the version of 'GetShortPathName' that can deal with Unicode... sal_Int32 nShortLen = GetShortPathNameW( @@ -99,7 +100,7 @@ rtl::OString Win_GetShortPathName( const rtl::OUString &rLongPathName ) if (nShortLen < nShortBufSize) // conversion successful? aRes = rtl::OString( OU2ENC( rtl::OUString( aShortBuffer, nShortLen ), osl_getThreadTextEncoding()) ); else - DBG_ERROR( "Win_GetShortPathName: buffer to short" ); + OSL_FAIL( "Win_GetShortPathName: buffer to short" ); return aRes; } @@ -124,9 +125,6 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy rtl::OUString aSystemPrefix; rtl::OUString aSystemSuffix; #endif - bool bSpell = false; - bool bHyph = false; - bool bThes = false; if (strcmp( pDicType, "DICT" ) == 0) { aFormatName = A2OU("DICT_SPELL"); @@ -135,7 +133,6 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy aSystemDir = A2OU( DICT_SYSTEM_DIR ); aSystemSuffix = aDicExtension; #endif - bSpell = true; } else if (strcmp( pDicType, "HYPH" ) == 0) { @@ -146,7 +143,6 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy aSystemPrefix = A2OU( "hyph_" ); aSystemSuffix = aDicExtension; #endif - bHyph = true; } else if (strcmp( pDicType, "THES" ) == 0) { @@ -157,7 +153,6 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy aSystemPrefix = A2OU( "th_" ); aSystemSuffix = A2OU( "_v2.dat" ); #endif - bThes = true; } @@ -254,7 +249,7 @@ void MergeNewStyleDicsAndOldStyleDics( if (nLang == LANGUAGE_DONTKNOW || nLang == LANGUAGE_NONE) { - DBG_ERROR( "old style dictionary with invalid language found!" ); + OSL_FAIL( "old style dictionary with invalid language found!" ); continue; } @@ -264,7 +259,7 @@ void MergeNewStyleDicsAndOldStyleDics( } else { - DBG_ERROR( "old style dictionary with no language found!" ); + OSL_FAIL( "old style dictionary with no language found!" ); } } } @@ -291,3 +286,4 @@ rtl_TextEncoding getTextEncodingFromCharset(const sal_Char* pCharset) ////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/lingutil/lingutil.hxx b/lingucomponent/source/lingutil/lingutil.hxx index d636dcbaa..53f322d80 100644 --- a/lingucomponent/source/lingutil/lingutil.hxx +++ b/lingucomponent/source/lingutil/lingutil.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,7 +39,9 @@ #include <list> -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) +#ifndef A2OU +# define A2OU(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x )) +#endif #define OU2A(rtlOUString) \ ::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), \ @@ -111,3 +114,4 @@ rtl_TextEncoding getTextEncodingFromCharset(const sal_Char* pCharset); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/lingutil/makefile.mk b/lingucomponent/source/lingutil/makefile.mk index 7d19eac9e..87df6aea5 100644 --- a/lingucomponent/source/lingutil/makefile.mk +++ b/lingucomponent/source/lingutil/makefile.mk @@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk .IF "$(SYSTEM_HUNSPELL)" != "YES" -HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell +HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell -DHUNSPELL_STATIC .ENDIF .IF "$(SYSTEM_DICTS)" == "YES" diff --git a/lingucomponent/source/spellcheck/macosxspell/macreg.cxx b/lingucomponent/source/spellcheck/macosxspell/macreg.cxx index 8c431d4be..f3b3d8586 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macreg.cxx +++ b/lingucomponent/source/spellcheck/macosxspell/macreg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,7 +35,6 @@ #include <com/sun/star/registry/XRegistryKey.hpp> -using namespace rtl; using namespace com::sun::star::lang; using namespace com::sun::star::registry; @@ -76,3 +76,4 @@ void * SAL_CALL component_getFactory( /////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.cxx b/lingucomponent/source/spellcheck/macosxspell/macspellimp.cxx index eb73aca71..fd9004e28 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.cxx +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,27 +38,29 @@ #include <unotools/processfactory.hxx> #include <osl/mutex.hxx> -//#include <hunspell.hxx> #include <dictmgr.hxx> #include <macspellimp.hxx> -//#include <linguistic/lngprops.hxx> #include <linguistic/spelldta.hxx> #include <unotools/pathoptions.hxx> #include <unotools/useroptions.hxx> #include <osl/file.hxx> #include <rtl/ustrbuf.hxx> - using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; + +using ::rtl::OUString; +using ::rtl::OString; +using ::rtl::OUStringBuffer; +using ::rtl::OUStringToOString; + /////////////////////////////////////////////////////////////////////////// // dbg_dump for development #if OSL_DEBUG_LEVEL > 1 @@ -94,7 +97,6 @@ const sal_Char *dbg_dump(rtl_uString *pStr) MacSpellChecker::MacSpellChecker() : aEvtListeners ( GetLinguMutex() ) { -// aDicts = NULL; aDEncs = NULL; aDLocs = NULL; aDNames = NULL; @@ -111,14 +113,6 @@ MacSpellChecker::MacSpellChecker() : MacSpellChecker::~MacSpellChecker() { - // if (aDicts) { - // for (int i = 0; i < numdict; i++) { - // if (aDicts[i]) delete aDicts[i]; - // aDicts[i] = NULL; - // } - // delete[] aDicts; - // } - // aDicts = NULL; numdict = 0; if (aDEncs) delete[] aDEncs; aDEncs = NULL; @@ -163,7 +157,6 @@ Sequence< Locale > SAL_CALL MacSpellChecker::getLocales() rtl_TextEncoding aEnc = RTL_TEXTENCODING_UTF8; std::vector<objc_object *> postspdict; - //std::vector<dictentry *> postspdict; std::vector<dictentry *> postupdict; @@ -225,11 +218,7 @@ Sequence< Locale > SAL_CALL MacSpellChecker::getLocales() numlocs++; } aDLocs[k] = nLoc; - //pointer to Hunspell dictionary - not needed for MAC - //aDicts[k] = NULL; aDEncs[k] = 0; - // Dictionary file names not valid for Mac Spell - //aDNames[k] = aPathOpt.GetLinguisticPath() + A2OU("/ooo/") + A2OU(postspdict[i]->filename); k++; } @@ -238,7 +227,6 @@ Sequence< Locale > SAL_CALL MacSpellChecker::getLocales() } else { /* no dictionary.lst found so register no dictionaries */ numdict = 0; - //aDicts = NULL; aDEncs = NULL; aDLocs = NULL; aDNames = NULL; @@ -555,7 +543,7 @@ void SAL_CALL pPropHelper->AddAsPropListener(); //! after a reference is established } else - DBG_ERROR( "wrong number of arguments in sequence" ); + OSL_FAIL( "wrong number of arguments in sequence" ); } } @@ -665,3 +653,5 @@ void * SAL_CALL MacSpellChecker_getFactory( const sal_Char * pImplName, /////////////////////////////////////////////////////////////////////////// + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx b/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx index b7445a3c0..7e20d332c 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,12 +55,13 @@ #include <lingutil.hxx> -using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::linguistic2; +using ::rtl::OUString; + /////////////////////////////////////////////////////////////////////////// @@ -150,3 +152,4 @@ inline OUString MacSpellChecker::getImplementationName_Static() throw() #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/spellcheck/macosxspell/makefile.mk b/lingucomponent/source/spellcheck/macosxspell/makefile.mk index 4e88b808d..0a724f0f1 100644 --- a/lingucomponent/source/spellcheck/macosxspell/makefile.mk +++ b/lingucomponent/source/spellcheck/macosxspell/makefile.mk @@ -39,7 +39,7 @@ USE_DEFFILE=TRUE .INCLUDE : settings.mk .IF "$(SYSTEM_HUNSPELL)" != "YES" -HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell +HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell -DHUNSPELL_STATIC .ENDIF CXXFLAGS += $(HUNSPELL_CFLAGS) @@ -65,7 +65,6 @@ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1STDLIBS= \ $(CPPULIB) \ $(CPPUHELPERLIB) \ - $(VOSLIB) \ $(TOOLSLIB) \ $(SVLLIB) \ $(SALLIB) \ diff --git a/lingucomponent/source/spellcheck/spell/makefile.mk b/lingucomponent/source/spellcheck/spell/makefile.mk index 56dd79939..81a683c99 100644 --- a/lingucomponent/source/spellcheck/spell/makefile.mk +++ b/lingucomponent/source/spellcheck/spell/makefile.mk @@ -33,7 +33,7 @@ ENABLE_EXCEPTIONS=TRUE USE_DEFFILE=TRUE .IF "$(SYSTEM_HUNSPELL)" != "YES" -HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell +HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell -DHUNSPELL_STATIC .ENDIF #----- Settings --------------------------------------------------------- diff --git a/lingucomponent/source/spellcheck/spell/sreg.cxx b/lingucomponent/source/spellcheck/spell/sreg.cxx index fa2c67840..68ee24d10 100644 --- a/lingucomponent/source/spellcheck/spell/sreg.cxx +++ b/lingucomponent/source/spellcheck/spell/sreg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,12 @@ #include <com/sun/star/registry/XRegistryKey.hpp> -using namespace rtl; using namespace com::sun::star::lang; using namespace com::sun::star::registry; //////////////////////////////////////// // declaration of external RegEntry-functions defined by the service objects // - extern void * SAL_CALL SpellChecker_getFactory( const sal_Char * pImplName, XMultiServiceFactory * pServiceManager, @@ -75,3 +74,4 @@ void * SAL_CALL component_getFactory( /////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index f4ffaea95..dd073bb4c 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,7 +60,6 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -67,6 +67,10 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; +using ::rtl::OString; + // XML-header of SPELLML queries #define SPELLML_HEADER "<?xml?>" @@ -584,9 +588,8 @@ void SAL_CALL SpellChecker::initialize( const Sequence< Any >& rArguments ) xPropHelper = pPropHelper; pPropHelper->AddAsPropListener(); //! after a reference is established } - else - { - DBG_ERROR( "wrong number of arguments in sequence" ); + else { + OSL_FAIL( "wrong number of arguments in sequence" ); } } } @@ -693,3 +696,5 @@ void * SAL_CALL SpellChecker_getFactory( const sal_Char * pImplName, /////////////////////////////////////////////////////////////////////////// + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.hxx b/lingucomponent/source/spellcheck/spell/sspellimp.hxx index 1f6224a84..45ac8a6a8 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.hxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -140,3 +141,4 @@ inline OUString SpellChecker::getImplementationName_Static() throw() #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/thesaurus/libnth/makefile.mk b/lingucomponent/source/thesaurus/libnth/makefile.mk index 91d39d2d3..d204fb2c7 100644 --- a/lingucomponent/source/thesaurus/libnth/makefile.mk +++ b/lingucomponent/source/thesaurus/libnth/makefile.mk @@ -52,7 +52,7 @@ MYTHESLIB=libmythes.lib # --- Files -------------------------------------------------------- .IF "$(SYSTEM_HUNSPELL)" != "YES" -HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell +HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell -DHUNSPELL_STATIC .ENDIF .IF "$(SYSTEM_MYTHES)" != "YES" diff --git a/lingucomponent/source/thesaurus/libnth/nthesdta.cxx b/lingucomponent/source/thesaurus/libnth/nthesdta.cxx index f0c81f66b..549c9c0e4 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesdta.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesdta.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,18 +36,16 @@ #include "nthesdta.hxx" #include <linguistic/misc.hxx> -// #include "lngsvcmgr.hxx" - - using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; +using ::rtl::OUString; + namespace linguistic { @@ -114,3 +113,4 @@ void Meaning::SetMeaning( const OUString &rTerm ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/thesaurus/libnth/nthesdta.hxx b/lingucomponent/source/thesaurus/libnth/nthesdta.hxx index 4e1766840..6e0352bf7 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesdta.hxx +++ b/lingucomponent/source/thesaurus/libnth/nthesdta.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,3 +85,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index 75c921fdc..e2f7363e9 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,7 +66,6 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -73,7 +73,9 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; - +using ::rtl::OUString; +using ::rtl::OString; +using ::rtl::OUStringToOString; /////////////////////////////////////////////////////////////////////////// @@ -606,7 +608,7 @@ void SAL_CALL Thesaurus::initialize( const Sequence< Any >& rArguments ) pPropHelper->AddAsPropListener(); //! after a reference is established } else - DBG_ERROR( "wrong number of arguments in sequence" ); + OSL_FAIL( "wrong number of arguments in sequence" ); } } @@ -782,3 +784,5 @@ void * SAL_CALL Thesaurus_getFactory( const sal_Char * pImplName, #undef CAPTYPE_INITCAP #undef CAPTYPE_ALLCAP #undef CAPTYPE_MIXED + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx index 0028e3673..78c948b9b 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -168,3 +169,5 @@ inline OUString Thesaurus::getImplementationName_Static() throw() /////////////////////////////////////////////////////////////////////////// #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/thesaurus/libnth/ntreg.cxx b/lingucomponent/source/thesaurus/libnth/ntreg.cxx index 71dbe7d08..4628cc60c 100644 --- a/lingucomponent/source/thesaurus/libnth/ntreg.cxx +++ b/lingucomponent/source/thesaurus/libnth/ntreg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -74,3 +75,4 @@ void * SAL_CALL component_getFactory( /////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |