[Libreoffice-commits] core.git: svl/source svtools/source

Rohan Kumar rohankanojia420 at gmail.com
Tue Apr 5 10:22:37 UTC 2016


 svl/source/items/poolitem.cxx         |    8 ++++----
 svtools/source/brwbox/brwbox3.cxx     |    6 +++---
 svtools/source/config/helpopt.cxx     |    4 +---
 svtools/source/config/menuoptions.cxx |    5 +----
 svtools/source/misc/sampletext.cxx    |   10 +++++-----
 5 files changed, 14 insertions(+), 19 deletions(-)

New commits:
commit 0452db13db40e81522fb6bc49136d25b6ffcff41
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date:   Wed Mar 9 19:08:34 2016 +0530

    tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals
    
    I removed OSL_DEBUG_LEVEL > 1 conditionals, replaced DBG_ASSERT to
    standard assert(..) and used SAL_INFO() in some places
    
    Change-Id: Ib6d6065e3f141e60f865fef1faacdb5598e12431
    Reviewed-on: https://gerrit.libreoffice.org/23073
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index 50a91fe..90f5b73 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -25,7 +25,7 @@
 #include <typeinfo>
 
 
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 static sal_uLong nItemCount = 0;
 
 const char* pw1 = "Wow! 10.000 items!";
@@ -41,7 +41,7 @@ SfxPoolItem::SfxPoolItem(sal_uInt16 const nWhich)
     , m_nKind(SFX_ITEMS_NONE)
 {
     DBG_ASSERT(nWhich <= SHRT_MAX, "invalid WhichId");
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
     ++nItemCount;
     if ( pw1 && nItemCount>=10000 )
     {
@@ -77,7 +77,7 @@ SfxPoolItem::SfxPoolItem( const SfxPoolItem& rCpy )
     , m_nWhich(rCpy.Which()) // call function because of ChkThis() (WTF does that mean?)
     , m_nKind( SFX_ITEMS_NONE )
 {
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
     ++nItemCount;
     if ( pw1 && nItemCount>=10000 )
     {
@@ -112,7 +112,7 @@ SfxPoolItem::~SfxPoolItem()
 {
     DBG_ASSERT(m_nRefCount == 0 || m_nRefCount > SFX_ITEMS_MAXREF,
             "destroying item in use");
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
     --nItemCount;
 #endif
 }
diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx
index c98cc99..4562ddd 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -234,7 +234,7 @@ OUString BrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType e
             }
             else
                 aRetText = "TableCell";
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
             aRetText += " [";
             aRetText += OUString::number(sal_Int32(GetCurRow()));
             aRetText += ",";
@@ -247,7 +247,7 @@ OUString BrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType e
                 sal_Int32 rowId = _nPosition + 1;
                 aRetText = OUString::number( rowId );
             }
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
             aRetText += " [";
             aRetText += OUString::number(sal_Int32(GetCurRow()));
             aRetText += ",";
@@ -257,7 +257,7 @@ OUString BrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType e
             break;
         case ::svt::BBTYPE_COLUMNHEADERCELL:
             aRetText = GetColumnDescription( sal_Int16( _nPosition ) );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
             aRetText += " [";
             aRetText += OUString::number(sal_Int32(GetCurRow()));
             aRetText += ",";
diff --git a/svtools/source/config/helpopt.cxx b/svtools/source/config/helpopt.cxx
index 01bf065..f03ebcf 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -150,9 +150,7 @@ void  SvtHelpOptions_Impl::Load(const uno::Sequence< OUString>& rPropertyNames)
     {
         for ( int nProp = 0; nProp < rPropertyNames.getLength(); nProp++ )
         {
-#if OSL_DEBUG_LEVEL > 1
-            DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" );
-#endif
+            assert(pValues[nProp].hasValue() && "property value missing");
             if ( pValues[nProp].hasValue() )
             {
                 bool bTmp;
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx
index 1f27fc7..7146b23 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -276,10 +276,7 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
             DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" );
             bMenuSettingsChanged |= seqValues[nProperty] >>= bSystemMenuIcons;
         }
-
-        #if OSL_DEBUG_LEVEL > 1
-        else DBG_ASSERT( sal_False, "SvtMenuOptions_Impl::Notify()\nUnknown property detected ... I can't handle these!\n" );
-        #endif
+        else assert( false && "SvtMenuOptions_Impl::Notify()\nUnknown property detected ... I can't handle these!\n" );
     }
 
     if ( bMenuSettingsChanged )
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index 9815951..dce3024 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -742,7 +742,7 @@ OUString makeRepresentativeTextForLanguage(LanguageType eLang)
 
 namespace
 {
-#if OSL_DEBUG_LEVEL > 2
+#if OSL_DEBUG_LEVEL > 0
     void lcl_dump_unicode_coverage(const boost::dynamic_bitset<sal_uInt32> &rIn)
     {
         if (rIn.none())
@@ -1277,7 +1277,7 @@ OUString makeShortRepresentativeTextForSelectedFont(OutputDevice &rDevice)
         if (!rDevice.GetFontCapabilities(aFontCapabilities))
             return OUString();
 
-#if OSL_DEBUG_LEVEL > 2
+#if OSL_DEBUG_LEVEL > 0
         lcl_dump_unicode_coverage(aFontCapabilities.maUnicodeRange);
         lcl_dump_codepage_coverage(aFontCapabilities.maCodePageRange);
 #endif
@@ -1631,7 +1631,7 @@ OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &r
         vcl::FontCapabilities aFontCapabilities;
         if (aDevice->GetFontCapabilities(aFontCapabilities))
         {
-#if OSL_DEBUG_LEVEL > 2
+#if OSL_DEBUG_LEVEL > 0
             lcl_dump_unicode_coverage(aFontCapabilities.maUnicodeRange);
 #endif
 
@@ -1647,8 +1647,8 @@ OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &r
             if (nScriptType != css::i18n::ScriptType::COMPLEX)
                 aFontCapabilities.maUnicodeRange &= getCTLMask();
 
-#if OSL_DEBUG_LEVEL > 2
-            fprintf(stderr, "minimal\n");
+#if OSL_DEBUG_LEVEL > 0
+            SAL_INFO("svtools", "minimal");
             lcl_dump_unicode_coverage(aFontCapabilities.maUnicodeRange);
             lcl_dump_codepage_coverage(aFontCapabilities.maCodePageRange);
 #endif


More information about the Libreoffice-commits mailing list