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>
This commit is contained in:
parent
55149144cb
commit
ebf82e52c9
7 changed files with 6 additions and 101 deletions
|
@ -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 ))
|
||||
|
|
|
@ -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 ))
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
|
@ -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, ' ' );
|
||||
|
|
Loading…
Reference in a new issue