From ebf82e52c945f8c2a7c021b547064e5bbeadfe2f Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Fri, 5 Oct 2012 23:42:12 -0300 Subject: Kill use of macro LINGU_EXCEPTIONS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This macro is not defined, so we can kill all code that have the "#ifdef LINGU_EXCEPTIONS". Just a cleanup, the rationale is the same. Change-Id: Ib6f784859210d5a59210af51766ef4d7b8d7ead6 Signed-off-by: Marcos Paulo de Souza Reviewed-on: https://gerrit.libreoffice.org/778 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- linguistic/source/dicimp.cxx | 27 ++------------------------- linguistic/source/hyphdsp.cxx | 16 +--------------- linguistic/source/lngopt.cxx | 24 ------------------------ linguistic/source/spelldsp.cxx | 16 ++-------------- linguistic/source/thesdsp.cxx | 8 +------- 5 files changed, 6 insertions(+), 85 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 5a2f7d746860..68a7581f4cc2 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -333,10 +333,6 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL) break; if (0 != (nErr = pStream->GetError())) return nErr; -#ifdef LINGU_EXCEPTIONS - if (nLen >= BUFSIZE) - throw io::IOException() ; -#endif if (nLen < BUFSIZE) { @@ -1006,13 +1002,7 @@ void SAL_CALL DictionaryNeo::store() if (bIsModified && hasLocation() && !isReadonly()) { - if (saveEntries( aMainURL )) - { -#ifdef LINGU_EXCEPTIONS - throw io::IOException(); -#endif - } - else + if (!saveEntries( aMainURL )) bIsModified = sal_False; } } @@ -1024,13 +1014,7 @@ void SAL_CALL DictionaryNeo::storeAsURL( { MutexGuard aGuard( GetLinguMutex() ); - if (saveEntries( aURL )) - { -#ifdef LINGU_EXCEPTIONS - throw io::IOException(); -#endif - } - else + if (!saveEntries( aURL )) { aMainURL = aURL; bIsModified = sal_False; @@ -1044,13 +1028,6 @@ void SAL_CALL DictionaryNeo::storeToURL( throw(io::IOException, RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - - if (saveEntries( aURL )) - { -#ifdef LINGU_EXCEPTIONS - throw io::IOException(); -#endif - } } diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index c22841a835e4..df06ef2bd0db 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -264,11 +264,7 @@ Reference< XHyphenatedWord > SAL_CALL bool bWordModified = false; if (!pEntry || (nMaxLeading < 0 || nMaxLeading > nWordLen)) { -#ifdef LINGU_EXCEPTIONS - throw IllegalArgumentException(); -#else return NULL; -#endif } else { @@ -405,11 +401,7 @@ Reference< XHyphenatedWord > SAL_CALL bool bWordModified = false; if (!pEntry || !(0 <= nIndex && nIndex <= nWordLen - 2)) { -#ifdef LINGU_EXCEPTIONS - throw IllegalArgumentException(); -#else return NULL; -#endif } else { @@ -537,13 +529,7 @@ Reference< XPossibleHyphens > SAL_CALL HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - if (!pEntry) - { -#ifdef LINGU_EXCEPTIONS - throw IllegalArgumentException(); -#endif - } - else + if (pEntry) { OUString aChkWord( rWord ); diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index 63286648066b..37af9e9b1909 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -250,12 +250,6 @@ void SAL_CALL LinguProps::setPropertyValue( launchEvent( aChgEvt ); } } -#ifdef LINGU_EXCEPTIONS - else - { - throw UnknownPropertyException(); - } -#endif } Any SAL_CALL LinguProps::getPropertyValue( const OUString& rPropertyName ) @@ -270,12 +264,6 @@ Any SAL_CALL LinguProps::getPropertyValue( const OUString& rPropertyName ) { aRet = aConfig.GetProperty( pCur->nWID ); } -#ifdef LINGU_EXCEPTIONS - else - { - throw UnknownPropertyException(); - } -#endif return aRet; } @@ -292,12 +280,6 @@ void SAL_CALL LinguProps::addPropertyChangeListener( const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); if(pCur) aPropListeners.addInterface( pCur->nWID, rxListener ); -#ifdef LINGU_EXCEPTIONS - else - { - throw UnknownPropertyException(); - } -#endif } } @@ -313,12 +295,6 @@ void SAL_CALL LinguProps::removePropertyChangeListener( const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); if(pCur) aPropListeners.removeInterface( pCur->nWID, rxListener ); -#ifdef LINGU_EXCEPTIONS - else - { - throw UnknownPropertyException(); - } -#endif } } diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 1ddfa1ce0247..bc1939c2faca 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -295,13 +295,7 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl( SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - if (!pEntry) - { -#ifdef LINGU_EXCEPTIONS - throw IllegalArgumentException(); -#endif - } - else + if (pEntry) { OUString aChkWord( rWord ); Locale aLocale( CreateLocale( nLanguage ) ); @@ -461,13 +455,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - if (!pEntry) - { -#ifdef LINGU_EXCEPTIONS - throw IllegalArgumentException(); -#endif - } - else + if (pEntry) { OUString aChkWord( rWord ); Locale aLocale( CreateLocale( nLanguage ) ); diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index f182b122a959..d9e5ce030668 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -124,13 +124,7 @@ Sequence< Reference< XMeaning > > SAL_CALL ThesSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - if (!pEntry) - { -#ifdef LINGU_EXCEPTIONS - throw IllegalArgumentException(); -#endif - } - else + if (pEntry) { OUString aChkWord( rTerm ); aChkWord = aChkWord.replace( SVT_HARD_SPACE, ' ' ); -- cgit