[Libreoffice-commits] core.git: linguistic/source
Rohan Kumar
rohankanojia420 at gmail.com
Tue Apr 5 12:06:24 UTC 2016
linguistic/source/hyphdsp.cxx | 6 ++----
linguistic/source/lngsvcmgr.cxx | 33 +++++++++------------------------
linguistic/source/spelldta.cxx | 4 ++--
3 files changed, 13 insertions(+), 30 deletions(-)
New commits:
commit 931d003ade7c4a88f46be1e89b32d58e5eb9d083
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Sat Mar 5 12:21:23 2016 +0530
tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals
I disentangled my previous patch and uploaded one patch
per module
Change-Id: Ic7351452833816358cff96e154d6d5d40f094aa8
Reviewed-on: https://gerrit.libreoffice.org/22666
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index 5ed22c5..42c42e4 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -120,8 +120,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord(
if (nHyphenationPos > 0)
{
-
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
{
if (aTmp.toString() != rOrigWord)
{
@@ -142,8 +141,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord(
sal_Int32 nL = aLonger.getLength();
if (nS > 0 && nL > 0)
{
- DBG_ASSERT( (nS + 1 == nL) && aLonger[nL-1] == '.',
- "HyphenatorDispatcher::buildHyphWord: unexpected difference between words!" );
+ assert( ((nS + 1 == nL) && aLonger[nL-1] == '.') && "HyphenatorDispatcher::buildHyphWord: unexpected difference between words!" );
}
}
}
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index d77a372..d45b409 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -782,12 +782,7 @@ void LngSvcMgr::UpdateAll()
{
// add new or replace existing entries.
bool bRes = aCfg.ReplaceSetProperties( aSubNodeName, aNewValues );
- if (!bRes)
- {
-#if OSL_DEBUG_LEVEL > 1
- SAL_WARN( "linguistic", "failed to set new configuration values" );
-#endif
- }
+ SAL_WARN_IF(!bRes, "linguistic", "failed to set new configuration values");
}
}
}
@@ -1428,8 +1423,8 @@ uno::Reference< linguistic2::XSpellChecker > SAL_CALL
throw(uno::RuntimeException, std::exception)
{
osl::MutexGuard aGuard( GetLinguMutex() );
-#if OSL_DEBUG_LEVEL > 1
- getAvailableLocales( SN_SPELLCHECKER );
+#if OSL_DEBUG_LEVEL > 0
+ getAvailableLocales(SN_SPELLCHECKER);
#endif
uno::Reference< linguistic2::XSpellChecker > xRes;
@@ -1448,10 +1443,9 @@ uno::Reference< linguistic2::XHyphenator > SAL_CALL
throw(uno::RuntimeException, std::exception)
{
osl::MutexGuard aGuard( GetLinguMutex() );
-#if OSL_DEBUG_LEVEL > 1
- getAvailableLocales( SN_HYPHENATOR );
+#if OSL_DEBUG_LEVEL > 0
+ getAvailableLocales(SN_HYPHENATOR);
#endif
-
uno::Reference< linguistic2::XHyphenator > xRes;
if (!bDisposing)
{
@@ -1468,10 +1462,9 @@ uno::Reference< linguistic2::XThesaurus > SAL_CALL
throw(uno::RuntimeException, std::exception)
{
osl::MutexGuard aGuard( GetLinguMutex() );
-#if OSL_DEBUG_LEVEL > 1
- getAvailableLocales( SN_THESAURUS );
+#if OSL_DEBUG_LEVEL > 0
+ getAvailableLocales(SN_THESAURUS);
#endif
-
uno::Reference< linguistic2::XThesaurus > xRes;
if (!bDisposing)
{
@@ -1645,9 +1638,6 @@ void SAL_CALL
osl::MutexGuard aGuard( GetLinguMutex() );
-#if OSL_DEBUG_LEVEL > 1
-#endif
-
LanguageType nLanguage = LinguLocaleToLanguage( rLocale );
if (!LinguIsUnspecified( nLanguage))
{
@@ -1814,15 +1804,14 @@ static uno::Sequence< OUString > GetLangSvcList( const uno::Any &rVal )
if (rVal.hasValue())
{
rVal >>= aRes;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
sal_Int32 nSvcs = aRes.getLength();
if (nSvcs)
{
const OUString *pSvcName = aRes.getConstArray();
for (sal_Int32 j = 0; j < nSvcs; ++j)
{
- OUString aImplName( pSvcName[j] );
- SAL_WARN_IF( aImplName.isEmpty(), "linguistic", "service impl-name missing" );
+ SAL_WARN_IF( pSvcName[j].isEmpty(), "linguistic", "service impl-name missing" );
}
}
#endif
@@ -1930,10 +1919,6 @@ uno::Sequence< OUString > SAL_CALL
}
}
-#if OSL_DEBUG_LEVEL > 1
- const OUString *pImplNames = aSvcImplNames.getConstArray();
- (void) pImplNames;
-#endif
return aSvcImplNames;
}
diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx
index 6a0a938..34027d9 100644
--- a/linguistic/source/spelldta.cxx
+++ b/linguistic/source/spelldta.cxx
@@ -82,10 +82,10 @@ void SearchSimilarText( const OUString &rText, sal_Int16 nLanguage,
if ( xDic.is() && xDic->isActive()
&& (nLang == nLanguage || LinguIsUnspecified( nLang)) )
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
DictionaryType eType = xDic->getDictionaryType();
(void) eType;
- DBG_ASSERT( eType != DictionaryType_MIXED, "unexpected dictionary type" );
+ assert( eType != DictionaryType_MIXED && "unexpected dictionary type" );
#endif
const Sequence< Reference< XDictionaryEntry > > aEntries = xDic->getEntries();
const Reference< XDictionaryEntry > *pEntries = aEntries.getConstArray();
More information about the Libreoffice-commits
mailing list