[Libreoffice-commits] .: lingucomponent/source linguistic/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 9 14:38:25 PDT 2012


 lingucomponent/source/spellcheck/macosxspell/macspellimp.mm |    8 ---
 lingucomponent/source/spellcheck/spell/sspellimp.cxx        |    8 ---
 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 ---
 7 files changed, 6 insertions(+), 101 deletions(-)

New commits:
commit ebf82e52c945f8c2a7c021b547064e5bbeadfe2f
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Fri Oct 5 23:42:12 2012 -0300

    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 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/778
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index f34eabd..7be1983 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 473e6c7..94d8fd0 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 5a2f7d7..68a7581 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 c22841a..df06ef2 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 6328664..37af9e9 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 1ddfa1c..bc1939c 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 f182b12..d9e5ce0 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, ' ' );


More information about the Libreoffice-commits mailing list