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

Rohan Kumar rohankanojia420 at gmail.com
Tue Apr 12 11:52:26 UTC 2016


 extensions/source/scanner/sane.cxx    |   15 +++++++--------
 extensions/source/scanner/sanedlg.cxx |   13 +++----------
 extensions/source/scanner/scanunx.cxx |   27 ++++++---------------------
 3 files changed, 16 insertions(+), 39 deletions(-)

New commits:
commit 35d7ca80930997febb31eb7cdd95eeb684514bec
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date:   Wed Mar 9 17:29:55 2016 +0530

    tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals
    
    I removed OSL_DEBUG_LEVEL > 1 conditionals by SAL_INFO(..)s
    or OSL_DEBUG_LEVEL > 0 and made sure that it doesn't break the
    build
    
    Change-Id: I3eccdd769ff32e57e12209706e5fbbdd9638de54
    Reviewed-on: https://gerrit.libreoffice.org/23068
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 5e94f8a..5f218735 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -33,7 +33,7 @@
 #include <sal/macros.h>
 #include <memory>
 
-#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
+#if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
 #include <stdarg.h>
 #define dump_state( a, b, c, d ) fprintf( stderr, a, b, c, d );
 #else
@@ -41,7 +41,7 @@
 #endif
 inline void dbg_msg( const char* pString, ... )
 {
-#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
+#if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
     va_list ap;
     va_start( ap, pString );
     vfprintf( stderr, pString, ap );
@@ -125,7 +125,7 @@ SANE_Status Sane::ControlOption( int nOption, SANE_Action nAction,
     SANE_Status nStatus = p_control_option( maHandle, (SANE_Int)nOption,
                                 nAction, pData, &nInfo );
     DUMP_STATE( nStatus, "sane_control_option" );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
     if( nStatus != SANE_STATUS_GOOD )
     {
         const char* pAction = "Unknown";
@@ -232,7 +232,7 @@ void Sane::Init()
             for( nDevices = 0 ; ppDevices[ nDevices ]; nDevices++ ) ;
         }
     }
-#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
+#if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
     else
         fprintf( stderr, "libsane%s could not be opened: %s\n", SAL_DLLEXTENSION,
                  dlerror() );
@@ -618,7 +618,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
                 bSuccess = false;
                 break;
             }
-#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
+#if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
             const char* ppFormats[] = { "SANE_FRAME_GRAY", "SANE_FRAME_RGB",
                                   "SANE_FRAME_RED", "SANE_FRAME_GREEN",
                                   "SANE_FRAME_BLUE", "Unknown !!!" };
@@ -735,9 +735,8 @@ bool Sane::Start( BitmapTransporter& rBitmap )
                     nWidthMM = (int)(((double)nWidth / fResl) * 25.4);
                 if( ! nHeightMM )
                     nHeightMM = (int)(((double)nHeight / fResl) * 25.4);
-#if OSL_DEBUG_LEVEL > 1
-                fprintf( stderr, "set dimensions to (%d, %d) Pixel, (%d, %d) mm, resolution is %lg\n", (int)nWidth, (int)nHeight, (int)nWidthMM, (int)nHeightMM, fResl );
-#endif
+                SAL_INFO("extensions.scanner", "set dimensions to(" << nWidth << ", " << nHeight << ") Pixel, (" << nWidthMM << ", " << nHeightMM <<
+                    ") mm, resolution is " << fResl);
 
                 aConverter.Seek( 18 );
                 aConverter.WriteUInt32( nWidth );
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 95505d1..34ed684 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -905,10 +905,8 @@ void SaneDlg::AcquirePreview()
     }
     else
     {
-#if OSL_DEBUG_LEVEL > 1
         xTransporter->getStream().Seek( STREAM_SEEK_TO_END );
-        fprintf( stderr, "Previewbitmapstream contains %d bytes\n", (int)xTransporter->getStream().Tell() );
-#endif
+        SAL_INFO("extensions.scanner", "Previewbitmapstream contains " << xTransporter->getStream().Tell() << "bytes");
         xTransporter->getStream().Seek( STREAM_SEEK_TO_BEGIN );
         mpPreview->SetBitmap(xTransporter->getStream());
     }
@@ -1492,10 +1490,7 @@ bool SaneDlg::SetAdjustedNumericalValue(
         return false;
     }
 
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "SaneDlg::SetAdjustedNumericalValue( \"%s\", %lg ) ",
-             pOption, fValue );
-#endif
+    SAL_INFO("extensions.scanner", "SaneDlg::SetAdjustedNumericalValue(\"" << pOption << "\", " << fValue << ") ");
 
     if( nValues )
     {
@@ -1520,9 +1515,7 @@ bool SaneDlg::SetAdjustedNumericalValue(
     }
     delete [] pValues;
     mrSane.SetOptionValue( nOption, fValue, nElement );
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "yields %lg\n", fValue );
-#endif
+    SAL_INFO("extensions.scanner", "yields " << fValue);
 
 
     return true;
diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx
index 3307599..b92fb55 100644
--- a/extensions/source/scanner/scanunx.cxx
+++ b/extensions/source/scanner/scanunx.cxx
@@ -23,23 +23,16 @@
 #include <cppuhelper/queryinterface.hxx>
 #include <memory>
 
-#if OSL_DEBUG_LEVEL > 1
-#include <stdio.h>
-#endif
 
 BitmapTransporter::BitmapTransporter()
 {
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "BitmapTransporter\n" );
-#endif
+    SAL_INFO("extensions.scanner", "BitmapTransporter");
 }
 
 
 BitmapTransporter::~BitmapTransporter()
 {
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "~BitmapTransporter\n" );
-#endif
+    SAL_INFO("extensions.scanner", "~BitmapTransporter");
 }
 
 
@@ -152,17 +145,13 @@ ScannerThread::ScannerThread(
                              ScannerManager* pManager )
         : m_pHolder( pHolder ), m_xListener( listener ), m_pManager( pManager )
 {
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "ScannerThread\n" );
-#endif
+    SAL_INFO("extensions.scanner", "ScannerThread");
 }
 
 
 ScannerThread::~ScannerThread()
 {
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "~ScannerThread\n" );
-#endif
+    SAL_INFO("extensions.scanner", "~ScannerThread");
 }
 
 
@@ -259,9 +248,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex
         osl::MutexGuard aGuard( theSaneProtector::get() );
         sanevec &rSanes = theSanes::get().m_aSanes;
 
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "ScannerManager::configureScanner\n" );
-#endif
+        SAL_INFO("extensions.scanner", "ScannerManager::configureScanner");
 
         if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() )
             throw ScannerException(
@@ -297,9 +284,7 @@ void ScannerManager::startScan( const ScannerContext& scanner_context,
     osl::MutexGuard aGuard( theSaneProtector::get() );
     sanevec &rSanes = theSanes::get().m_aSanes;
 
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "ScannerManager::startScan\n" );
-#endif
+    SAL_INFO("extensions.scanner", "ScannerManager::startScan");
 
     if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() )
         throw ScannerException(


More information about the Libreoffice-commits mailing list