[Libreoffice-commits] core.git: linguistic/source

Muhammet Kara muhammet.kara at pardus.org.tr
Tue Jan 3 19:40:01 UTC 2017


 linguistic/source/misc.cxx |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 80e6671cacbe1785948de0311be972f897e962d9
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date:   Wed Dec 28 16:07:48 2016 +0300

    tdf#43157 Cleanup DBG_ASSERT in misc.cxx
    
    Change-Id: I92faaf758e08776b731411c964f168c6ced253bc
    Reviewed-on: https://gerrit.libreoffice.org/32474
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 37f20fb..6fe170c 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <sal/macros.h>
-#include <tools/debug.hxx>
 #include <unotools/pathoptions.hxx>
 #include <svl/lngmisc.hxx>
 #include <ucbhelper/content.hxx>
@@ -149,9 +148,9 @@ IntArray2D::~IntArray2D()
 
 sal_Int32 & IntArray2D::Value( int i, int k  )
 {
-    DBG_ASSERT( 0 <= i && i < n1, "first index out of range" );
-    DBG_ASSERT( 0 <= k && k < n2, "first index out of range" );
-    DBG_ASSERT( i * n2 + k < n1 * n2, "index out of range" );
+    assert( (0 <= i && i < n1) && "first index out of range" );
+    assert( (0 <= k && k < n2) && "second index out of range" );
+    assert( (i * n2 + k < n1 * n2) && "index out of range" );
     return pData[ i * n2 + k ];
 }
 
@@ -299,8 +298,8 @@ uno::Reference< XDictionaryEntry > SearchDicList(
         if ( axDic.is() && axDic->isActive()
             && (nLang == nLanguage  ||  LinguIsUnspecified( nLang)) )
         {
-            DBG_ASSERT( eType != DictionaryType_MIXED,
-                "lng : unexpected dictionary type" );
+            // DictionaryType_MIXED is deprecated
+            SAL_WARN_IF(eType == DictionaryType_MIXED, "linguistic", "unexpected dictionary type");
 
             if (   (!bSearchPosDics  &&  eType == DictionaryType_NEGATIVE)
                 || ( bSearchPosDics  &&  eType == DictionaryType_POSITIVE))
@@ -477,7 +476,7 @@ static bool GetAltSpelling( sal_Int16 &rnChgPos, sal_Int16 &rnChgLen, OUString &
 
         rnChgPos = sal::static_int_cast< sal_Int16 >(nPosL);
         rnChgLen = sal::static_int_cast< sal_Int16 >(nAltPosR - nPosL);
-        DBG_ASSERT( rnChgLen >= 0, "nChgLen < 0");
+        assert( rnChgLen >= 0 && "nChgLen < 0");
 
         sal_Int32 nTxtStart = nPosL;
         sal_Int32 nTxtLen   = nAltPosR - nPosL + 1;


More information about the Libreoffice-commits mailing list