unotools/source/config/fontcfg.cxx             |   37 ++++---------------------
 unotools/source/config/fontoptions.cxx         |    6 ++--
 unotools/source/config/localisationoptions.cxx |    8 ++---
 unotools/source/config/securityoptions.cxx     |    8 ++---
 4 files changed, 18 insertions(+), 41 deletions(-)

New commits:
commit 6326d76101857e94f241dc671c3e3a2a7bf9b031
Author: Rohan Kumar <rohankanojia...@gmail.com>
Date:   Mon Mar 7 19:42:54 2016 +0530

    tdf#91794 Remove OSL_DEBUG_LEVEL > 1 conditionals
    
    Updates pointed by Sweet5hark
    
    Change-Id: I747e92ca9ee39a027b1e9b27b131f249a33b77db
    Reviewed-on: https://gerrit.libreoffice.org/22980
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michael...@canonical.com>

diff --git a/unotools/source/config/fontcfg.cxx 
b/unotools/source/config/fontcfg.cxx
index e310b6a..62913d1 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -32,10 +32,6 @@
 #include <osl/diagnose.h>
 #include <sal/macros.h>
 
-#if OSL_DEBUG_LEVEL > 1
-#include <stdio.h>
-#endif
-
 #include <string.h>
 #include <list>
 #include <algorithm>
@@ -143,12 +139,8 @@ DefaultFontConfiguration::DefaultFontConfiguration()
     catch (const WrappedTargetException&)
     {
     }
-    #if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "config provider: %s, config access: %s\n",
-             m_xConfigProvider.is() ? "true" : "false",
-             m_xConfigAccess.is() ? "true" : "false"
-             );
-    #endif
+    SAL_INFO("unotools.config", "config provider: " << 
static_cast<bool>(m_xConfigProvider.is())
+            << ", config access: " << static_cast<bool>(m_xConfigAccess.is()));
 }
 
 DefaultFontConfiguration::~DefaultFontConfiguration()
@@ -400,12 +392,8 @@ FontSubstConfiguration::FontSubstConfiguration() :
         m_xConfigProvider.clear();
         m_xConfigAccess.clear();
     }
-    #if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "config provider: %s, config access: %s\n",
-             m_xConfigProvider.is() ? "true" : "false",
-             m_xConfigAccess.is() ? "true" : "false"
-             );
-    #endif
+    SAL_WARN("unotools.config", "config provider: " << 
static_cast<bool>(m_xConfigProvider.is())
+            << ", config access: " << static_cast<bool>(m_xConfigAccess.is()));
 }
 
 /*
@@ -937,11 +925,7 @@ FontWeight FontSubstConfiguration::getSubstWeight( const 
css::uno::Reference< XN
                     if( pLine->equalsIgnoreAsciiCaseAscii( 
pWeightNames[weight].pName ) )
                         break;
             }
-#if OSL_DEBUG_LEVEL > 1
-            if( weight < 0 )
-                fprintf( stderr, "Error: invalid weight %s\n",
-                         OUStringToOString( *pLine, RTL_TEXTENCODING_ASCII_US 
).getStr() );
-#endif
+            SAL_WARN_IF(weight < 0, "unotools.config", "Error: invalid weight 
" << *pLine);
         }
     }
     catch (const NoSuchElementException&)
@@ -969,11 +953,7 @@ FontWidth FontSubstConfiguration::getSubstWidth( const 
css::uno::Reference< XNam
                     if( pLine->equalsIgnoreAsciiCaseAscii( 
pWidthNames[width].pName ) )
                         break;
             }
-#if OSL_DEBUG_LEVEL > 1
-            if( width < 0 )
-                fprintf( stderr, "Error: invalid width %s\n",
-                         OUStringToOString( *pLine, RTL_TEXTENCODING_ASCII_US 
).getStr() );
-#endif
+            SAL_WARN_IF( width < 0, "unotools.config", "Error: invalid width " 
<< *pLine);
         }
     }
     catch (const NoSuchElementException&)
@@ -1072,10 +1052,7 @@ void FontSubstConfiguration::readLocaleSubst( const 
OUString& rBcp47 ) const
                     }
                     if( ! xFont.is() )
                     {
-                        #if OSL_DEBUG_LEVEL > 1
-                        fprintf( stderr, "did not get font attributes for 
%s\n",
-                                 OUStringToOString( pFontNames[i], 
RTL_TEXTENCODING_UTF8 ).getStr() );
-                        #endif
+                        SAL_WARN("unotools.config", "did not get font 
attributes for " << pFontNames[i]);
                         continue;
                     }
 
diff --git a/unotools/source/config/fontoptions.cxx 
b/unotools/source/config/fontoptions.cxx
index ad6fa0b..9214987 100644
--- a/unotools/source/config/fontoptions.cxx
+++ b/unotools/source/config/fontoptions.cxx
@@ -182,9 +182,9 @@ void SvtFontOptions_Impl::Notify( const Sequence< OUString 
>& seqPropertyNames )
             
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), 
"SvtFontOptions_Impl::Notify()\nWho has changed the value type of 
\"Office.Common\\Font\\View\\ShowFontBoxWYSIWYG\"?" );
             seqValues[nProperty] >>= m_bFontWYSIWYG;
         }
-        #if OSL_DEBUG_LEVEL > 1
-        else DBG_ASSERT( sal_False, "SvtFontOptions_Impl::Notify()\nUnknown 
property detected ... I can't handle these!\n" );
-        #endif
+#if OSL_DEBUG_LEVEL > 0
+        else assert(false && "SvtFontOptions_Impl::Notify()\nUnknown property 
detected ... I can't handle these!\n");
+#endif
     }
 }
 
diff --git a/unotools/source/config/localisationoptions.cxx 
b/unotools/source/config/localisationoptions.cxx
index 1ca612a..609577a 100644
--- a/unotools/source/config/localisationoptions.cxx
+++ b/unotools/source/config/localisationoptions.cxx
@@ -166,10 +166,10 @@ void SvtLocalisationOptions_Impl::Notify( const Sequence< 
OUString >& seqPropert
             
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), 
"SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl()\nWho has changed 
the value type of \"Office.Common\\View\\Localisation\\DialogScale\"?" );
             seqValues[nProperty] >>= m_nDialogScale;
         }
-        #if OSL_DEBUG_LEVEL > 1
-        else DBG_ASSERT( sal_False, 
"SvtLocalisationOptions_Impl::Notify()\nUnknown property detected ... I can't 
handle these!\n" );
-        #endif
-    }
+#if OSL_DEBUG_LEVEL > 0
+        else assert(false && "SvtLocalisationOptions_Impl::Notify()\nUnknown 
property detected ... I can't handle these!\n");
+#endif
+        }
 
     NotifyListeners(0);
 }
diff --git a/unotools/source/config/securityoptions.cxx 
b/unotools/source/config/securityoptions.cxx
index 5660442..59de838 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -399,11 +399,11 @@ void SvtSecurityOptions_Impl::SetProperty( sal_Int32 
nProperty, const Any& rValu
         break;
         // xmlsec05 deprecated
 
-        #if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
         default:
-            DBG_ASSERT( false, 
"SvtSecurityOptions_Impl::SetProperty()\nUnknown property!\n" );
-        #endif
-    }
+            assert(false && "SvtSecurityOptions_Impl::SetProperty()\nUnknown 
property!\n");
+#endif
+        }
 }
 
 void SvtSecurityOptions_Impl::LoadAuthors()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to