diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2012-10-05 23:42:12 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-09 21:37:59 +0000 |
commit | ebf82e52c945f8c2a7c021b547064e5bbeadfe2f (patch) | |
tree | f002ddbef0c5eb2eefd751e443a168aafbe2d4a5 | |
parent | 55149144cb926513ef250c87fdf0c59e11e2f6cf (diff) |
Kill use of macro LINGU_EXCEPTIONS
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 <marcos.souza.org@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/778
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | lingucomponent/source/spellcheck/macosxspell/macspellimp.mm | 8 | ||||
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 8 | ||||
-rw-r--r-- | linguistic/source/dicimp.cxx | 27 | ||||
-rw-r--r-- | linguistic/source/hyphdsp.cxx | 16 | ||||
-rw-r--r-- | linguistic/source/lngopt.cxx | 24 | ||||
-rw-r--r-- | linguistic/source/spelldsp.cxx | 16 | ||||
-rw-r--r-- | linguistic/source/thesdsp.cxx | 8 |
7 files changed, 6 insertions, 101 deletions
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm index f34eabdaee46..7be1983e1d16 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm @@ -281,11 +281,7 @@ sal_Bool SAL_CALL return sal_True; if (!hasLocale( rLocale )) -#ifdef LINGU_EXCEPTIONS - throw( IllegalArgumentException() ); -#else return sal_True; -#endif // Get property values to be used. // These are be the default values set in the SN_LINGU_PROPERTIES @@ -395,11 +391,7 @@ Reference< XSpellAlternatives > SAL_CALL return NULL; if (!hasLocale( rLocale )) -#ifdef LINGU_EXCEPTIONS - throw( IllegalArgumentException() ); -#else return NULL; -#endif Reference< XSpellAlternatives > xAlt; if (!isValid( rWord, rLocale, rProperties )) diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 473e6c79ac05..94d8fd025a8d 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -359,11 +359,7 @@ sal_Bool SAL_CALL SpellChecker::isValid( const OUString& rWord, const Locale& rL return sal_True; if (!hasLocale( rLocale )) -#ifdef LINGU_EXCEPTIONS - throw( IllegalArgumentException() ); -#else return sal_True; -#endif // return sal_False to process SPELLML requests (they are longer than the header) if (rWord.match(A2OU(SPELLML_HEADER), 0) && (rWord.getLength() > 10)) return sal_False; @@ -480,11 +476,7 @@ Reference< XSpellAlternatives > SAL_CALL SpellChecker::spell( return NULL; if (!hasLocale( rLocale )) -#ifdef LINGU_EXCEPTIONS - throw( IllegalArgumentException() ); -#else return NULL; -#endif Reference< XSpellAlternatives > xAlt; if (!isValid( rWord, rLocale, rProperties )) 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, ' ' ); |