[Libreoffice-commits] core.git: stoc/source stoc/test

Rohan Kumar rohankanojia420 at gmail.com
Tue Apr 12 11:53:50 UTC 2016


 stoc/source/corereflection/crefl.cxx                |    7 ----
 stoc/source/invocation_adapterfactory/iafactory.cxx |    4 +-
 stoc/source/javavm/javavm.cxx                       |   28 ++----------------
 stoc/source/servicemanager/servicemanager.cxx       |   31 +++-----------------
 stoc/test/testconv.cxx                              |    4 +-
 5 files changed, 14 insertions(+), 60 deletions(-)

New commits:
commit 31bddb874d2be54b81cdd7ea142b58db18e11a5b
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date:   Tue Mar 8 23:41:03 2016 +0530

    tdf#91794 removed OSL_DEBUG_LEVEL > 1 conditionals
    
    I removed all the OSL_DEBUG_LEVEL > 1 conditionals by SAL_INFOs
    or OSL_DEBUG_LEVEL > 0
    
    Change-Id: I261644a179e763612204bbb0e54a869fa1a62298
    Reviewed-on: https://gerrit.libreoffice.org/23035
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index 3304233..d0e9e8c 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -210,12 +210,7 @@ inline Reference< XIdlClass > IdlReflectionServiceImpl::constructClass(
         return new IdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr );
 
     default:
-#if OSL_DEBUG_LEVEL > 1
-        OSL_TRACE( "### corereflection type unsupported: " );
-        OString aName( OUStringToOString( pTypeDescr->pTypeName, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_TRACE( "%s", aName.getStr() );
-        OSL_TRACE( "\n" );
-#endif
+        SAL_INFO("stoc", " corereflection type unsupported: " << pTypeDescr->pTypeName);
         return Reference< XIdlClass >();
     }
 }
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 4ed0b8f..e40e8b7 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -756,8 +756,8 @@ FactoryImpl::~FactoryImpl()
 
     (*m_pConverter->release)( m_pConverter );
 
-#if OSL_DEBUG_LEVEL > 1
-    OSL_ENSURE( m_receiver2adapters.empty(), "### still adapters out there!?" );
+#if OSL_DEBUG_LEVEL > 0
+    assert(m_receiver2adapters.empty() && " still adapters out there!?");
 #endif
 }
 
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 290198c..c81fe0c 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -500,24 +500,14 @@ void initVMConfiguration(
         getINetPropsFromConfig(&jvm, xSMgr, xCtx);
     }
     catch(const css::uno::Exception & exception) {
-#if OSL_DEBUG_LEVEL > 1
-        OString message = OUStringToOString(exception.Message, RTL_TEXTENCODING_ASCII_US);
-        OSL_TRACE("javavm.cxx: can not get INetProps cause of >%s<", message.getStr());
-#else
-        (void) exception; // unused
-#endif
+        SAL_INFO("stoc", " can not get INETProps because of >" << exception.Message << "<");
     }
 
     try {
         getDefaultLocaleFromConfig(&jvm, xSMgr,xCtx);
     }
     catch(const css::uno::Exception & exception) {
-#if OSL_DEBUG_LEVEL > 1
-        OString message = OUStringToOString(exception.Message, RTL_TEXTENCODING_ASCII_US);
-        OSL_TRACE("javavm.cxx: can not get locale cause of >%s<", message.getStr());
-#else
-        (void) exception; // unused
-#endif
+        SAL_INFO("stoc", "can not get locale because of >" << exception.Message << "<");
     }
 
     try
@@ -525,12 +515,7 @@ void initVMConfiguration(
         getJavaPropsFromSafetySettings(&jvm, xSMgr, xCtx);
     }
     catch(const css::uno::Exception & exception) {
-#if OSL_DEBUG_LEVEL > 1
-        OString message = OUStringToOString(exception.Message, RTL_TEXTENCODING_ASCII_US);
-        OSL_TRACE("javavm.cxx: couldn't get safety settings because of >%s<", message.getStr());
-#else
-        (void) exception; // unused
-#endif
+        SAL_INFO("stoc", "couldn't get safety settings because of >" << exception.Message << "<");
     }
 
     *pjvm= jvm;
@@ -1366,12 +1351,7 @@ void JavaVirtualMachine::registerConfigChangesListener()
         }
     }catch(const css::uno::Exception & e)
     {
-#if OSL_DEBUG_LEVEL > 1
-        OString message = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
-        OSL_TRACE("javavm.cxx: could not set up listener for Configuration because of >%s<", message.getStr());
-#else
-        (void) e; // unused
-#endif
+        SAL_INFO("stoc", "could not set up listener for Configuration because of >" << e.Message << "<");
     }
 }
 
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 861e73f..55c2c9b1 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -698,12 +698,7 @@ void OServiceManager::disposing()
         }
         catch (const RuntimeException & exc)
         {
-#if OSL_DEBUG_LEVEL > 1
-            OString str( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
-            OSL_TRACE( "### RuntimeException occurred upon disposing factory: %s", str.getStr() );
-#else
-            (void) exc; // unused
-#endif
+            SAL_INFO("stoc", "RuntimeException occurred upon disposing factory: " << exc.Message);
         }
     }
 
@@ -896,10 +891,7 @@ Reference< XInterface > OServiceManager::createInstanceWithContext(
                     Reference< XSingleServiceFactory > xFac2( xFactory, UNO_QUERY );
                     if (xFac2.is())
                     {
-#if OSL_DEBUG_LEVEL > 1
-                        OString aStr( OUStringToOString( rServiceSpecifier, RTL_TEXTENCODING_ASCII_US ) );
-                        OSL_TRACE( "### ignoring given context raising service %s !!!", aStr.getStr() );
-#endif
+                        SAL_INFO("stoc", " ignoring given context raising service " << rServiceSpecifier << "!!!");
                         return xFac2->createInstance();
                     }
                 }
@@ -907,12 +899,7 @@ Reference< XInterface > OServiceManager::createInstanceWithContext(
         }
         catch (const lang::DisposedException & exc)
         {
-#if OSL_DEBUG_LEVEL > 1
-            OString str( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
-            OSL_TRACE( "### DisposedException occurred: %s", str.getStr() );
-#else
-            (void) exc; // unused
-#endif
+            SAL_INFO("stoc", " DisposedException occurred: " << exc.Message);
         }
     }
 
@@ -959,10 +946,7 @@ Reference< XInterface > OServiceManager::createInstanceWithArgumentsAndContext(
                     Reference< XSingleServiceFactory > xFac2( xFactory, UNO_QUERY );
                     if (xFac2.is())
                     {
-#if OSL_DEBUG_LEVEL > 1
-                        OString aStr( OUStringToOString( rServiceSpecifier, RTL_TEXTENCODING_ASCII_US ) );
-                        OSL_TRACE( "### ignoring given context raising service %s !!!", aStr.getStr() );
-#endif
+                        SAL_INFO("stoc", " ignoring given context raising service " << rServiceSpecifier << "!!!");
                         return xFac2->createInstanceWithArguments( rArguments );
                     }
                 }
@@ -970,12 +954,7 @@ Reference< XInterface > OServiceManager::createInstanceWithArgumentsAndContext(
         }
         catch (const lang::DisposedException & exc)
         {
-#if OSL_DEBUG_LEVEL > 1
-            OString str( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
-            OSL_TRACE( "### DisposedException occurred: %s", str.getStr() );
-#else
-            (void) exc; // unused
-#endif
+            SAL_INFO("stoc", " DisposedException occurred: " << exc.Message);
         }
     }
 
diff --git a/stoc/test/testconv.cxx b/stoc/test/testconv.cxx
index d78e77b..afe682f 100644
--- a/stoc/test/testconv.cxx
+++ b/stoc/test/testconv.cxx
@@ -187,7 +187,7 @@ static sal_Bool convertTo( const Type & rDestType, const Any & rVal, sal_Bool bE
         printf( aExcMsg.getStr() );
         printf( "]\n" );
         aRet = s_xConverter->convertTo( rVal, rDestType );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
         // for debugging, to trace again
         try
         {
@@ -206,7 +206,7 @@ static sal_Bool convertTo( const Type & rDestType, const Any & rVal, sal_Bool bE
         printf( " to " );
         printValue( aRet );
         printf( " was successful, but was not expected to be!\n" );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
         // for debugging, to trace again
         aRet = s_xConverter->convertTo( rVal, rDestType );
 #endif


More information about the Libreoffice-commits mailing list