diff options
Diffstat (limited to 'extensions/source/scanner')
-rw-r--r-- | extensions/source/scanner/grid.cxx | 4 | ||||
-rw-r--r-- | extensions/source/scanner/grid.hxx | 4 | ||||
-rw-r--r-- | extensions/source/scanner/sane.cxx | 196 | ||||
-rw-r--r-- | extensions/source/scanner/sane.hxx | 34 | ||||
-rw-r--r-- | extensions/source/scanner/sanedlg.cxx | 162 | ||||
-rw-r--r-- | extensions/source/scanner/sanedlg.hxx | 12 | ||||
-rw-r--r-- | extensions/source/scanner/scanner.hxx | 2 | ||||
-rw-r--r-- | extensions/source/scanner/scanunx.cxx | 14 | ||||
-rw-r--r-- | extensions/source/scanner/scanwin.cxx | 2 | ||||
-rw-r--r-- | extensions/source/scanner/twain.cxx | 10 | ||||
-rw-r--r-- | extensions/source/scanner/twain.hxx | 12 |
11 files changed, 226 insertions, 226 deletions
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx index ac3e322bc258..6079d153cffc 100644 --- a/extensions/source/scanner/grid.cxx +++ b/extensions/source/scanner/grid.cxx @@ -50,7 +50,7 @@ ResId SaneResId( sal_uInt32 ); // --------------------------------------------------------------------- -GridWindow::GridWindow(double* pXValues, double* pYValues, int nValues, Window* pParent, BOOL bCutValues ) +GridWindow::GridWindow(double* pXValues, double* pYValues, int nValues, Window* pParent, sal_Bool bCutValues ) : ModalDialog( pParent, SaneResId( GRID_DIALOG ) ), m_aGridArea( 50, 15, 100, 100 ), m_pXValues( pXValues ), @@ -66,7 +66,7 @@ GridWindow::GridWindow(double* pXValues, double* pYValues, int nValues, Window* m_aResetTypeBox( this, SaneResId( GRID_DIALOG_TYPE_BOX ) ), m_aResetButton( this, SaneResId( GRID_DIALOG_RESET_BTN ) ) { - USHORT nPos = m_aResetTypeBox.InsertEntry( String( SaneResId( RESET_TYPE_LINEAR_ASCENDING ) ) ); + sal_uInt16 nPos = m_aResetTypeBox.InsertEntry( String( SaneResId( RESET_TYPE_LINEAR_ASCENDING ) ) ); m_aResetTypeBox.SetEntryData( nPos, (void *)RESET_TYPE_LINEAR_ASCENDING ); nPos = m_aResetTypeBox.InsertEntry( String( SaneResId( RESET_TYPE_LINEAR_DESCENDING ) ) ); diff --git a/extensions/source/scanner/grid.hxx b/extensions/source/scanner/grid.hxx index 42791f355493..c5d4a14ed4e9 100644 --- a/extensions/source/scanner/grid.hxx +++ b/extensions/source/scanner/grid.hxx @@ -87,7 +87,7 @@ class GridWindow : public ModalDialog sal_uInt16 m_BmOffX; sal_uInt16 m_BmOffY; - BOOL m_bCutValues; + sal_Bool m_bCutValues; // stuff for handles std::vector< impHandle > m_aHandles; @@ -127,7 +127,7 @@ class GridWindow : public ModalDialog virtual void MouseButtonUp( const MouseEvent& ); public: GridWindow( double* pXValues, double* pYValues, int nValues, - Window* pParent, BOOL bCutValues = TRUE ); + Window* pParent, sal_Bool bCutValues = sal_True ); ~GridWindow(); void setBoundings( double fMinX, double fMinY, double fMaxX, double fMaxY ); diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index 43c50e6f8451..0ca6884e8202 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -117,7 +117,7 @@ SANE_Status (*Sane::p_set_io_mode)( SANE_Handle, SANE_Bool ) = 0; SANE_Status (*Sane::p_get_select_fd)( SANE_Handle, SANE_Int* ) = 0; SANE_String_Const (*Sane::p_strstatus)( SANE_Status ) = 0; -static BOOL bSaneSymbolLoadFailed = FALSE; +static sal_Bool bSaneSymbolLoadFailed = sal_False; inline oslGenericFunction Sane::LoadSymbol( const char* pSymbolname ) { @@ -126,7 +126,7 @@ inline oslGenericFunction Sane::LoadSymbol( const char* pSymbolname ) { fprintf( stderr, "Could not load symbol %s\n", pSymbolname ); - bSaneSymbolLoadFailed = TRUE; + bSaneSymbolLoadFailed = sal_True; } return pFunction; } @@ -203,7 +203,7 @@ void Sane::Init() if( pSaneLib ) { - bSaneSymbolLoadFailed = FALSE; + bSaneSymbolLoadFailed = sal_False; p_init = (SANE_Status(*)(SANE_Int*, SANE_Auth_Callback )) LoadSymbol( "sane_init" ); p_exit = (void(*)()) @@ -297,17 +297,17 @@ void Sane::ReloadOptions() mppOptions[ i ] = (SANE_Option_Descriptor*) p_get_option_descriptor( maHandle, i ); - CheckConsistency( NULL, TRUE ); + CheckConsistency( NULL, sal_True ); maReloadOptionsLink.Call( this ); } -BOOL Sane::Open( const char* name ) +sal_Bool Sane::Open( const char* name ) { int i; SANE_Status nStatus = p_open( (SANE_String_Const)name, &maHandle ); - FAIL_STATE( nStatus, "sane_open", FALSE ); + FAIL_STATE( nStatus, "sane_open", sal_False ); ReloadOptions(); @@ -324,17 +324,17 @@ BOOL Sane::Open( const char* name ) } } - return TRUE; + return sal_True; } -BOOL Sane::Open( int n ) +sal_Bool Sane::Open( int n ) { if( n >= 0 && n < nDevices ) { mnDevice = n; return Open( (char*)ppDevices[n]->name ); } - return FALSE; + return sal_False; } void Sane::Close() @@ -361,48 +361,48 @@ int Sane::GetOptionByName( const char* rName ) return -1; } -BOOL Sane::GetOptionValue( int n, BOOL& rRet ) +sal_Bool Sane::GetOptionValue( int n, sal_Bool& rRet ) { if( ! maHandle || mppOptions[n]->type != SANE_TYPE_BOOL ) - return FALSE; + return sal_False; SANE_Word nRet; SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, &nRet ); if( nStatus != SANE_STATUS_GOOD ) - return FALSE; + return sal_False; rRet = nRet; - return TRUE; + return sal_True; } -BOOL Sane::GetOptionValue( int n, ByteString& rRet ) +sal_Bool Sane::GetOptionValue( int n, ByteString& rRet ) { - BOOL bSuccess = FALSE; + sal_Bool bSuccess = sal_False; if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING ) - return FALSE; + return sal_False; char* pRet = new char[mppOptions[n]->size+1]; SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pRet ); if( nStatus == SANE_STATUS_GOOD ) { - bSuccess = TRUE; + bSuccess = sal_True; rRet = pRet; } delete [] pRet; return bSuccess; } -BOOL Sane::GetOptionValue( int n, double& rRet, int nElement ) +sal_Bool Sane::GetOptionValue( int n, double& rRet, int nElement ) { - BOOL bSuccess = FALSE; + sal_Bool bSuccess = sal_False; if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && mppOptions[n]->type != SANE_TYPE_FIXED ) ) - return FALSE; + return sal_False; SANE_Word* pRet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pRet ); if( nStatus == SANE_STATUS_GOOD ) { - bSuccess = TRUE; + bSuccess = sal_True; if( mppOptions[n]->type == SANE_TYPE_INT ) rRet = (double)pRet[ nElement ]; else @@ -412,18 +412,18 @@ BOOL Sane::GetOptionValue( int n, double& rRet, int nElement ) return bSuccess; } -BOOL Sane::GetOptionValue( int n, double* pSet ) +sal_Bool Sane::GetOptionValue( int n, double* pSet ) { if( ! maHandle || ! ( mppOptions[n]->type == SANE_TYPE_FIXED || mppOptions[n]->type == SANE_TYPE_INT ) ) - return FALSE; + return sal_False; SANE_Word* pFixedSet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pFixedSet ); if( nStatus != SANE_STATUS_GOOD ) { delete [] pFixedSet; - return FALSE; + return sal_False; } for( size_t i = 0; i <mppOptions[n]->size/sizeof(SANE_Word); i++ ) { @@ -433,38 +433,38 @@ BOOL Sane::GetOptionValue( int n, double* pSet ) pSet[i] = (double) pFixedSet[i]; } delete [] pFixedSet; - return TRUE; + return sal_True; } -BOOL Sane::SetOptionValue( int n, BOOL bSet ) +sal_Bool Sane::SetOptionValue( int n, sal_Bool bSet ) { if( ! maHandle || mppOptions[n]->type != SANE_TYPE_BOOL ) - return FALSE; + return sal_False; SANE_Word nRet = bSet ? SANE_TRUE : SANE_FALSE; SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, &nRet ); if( nStatus != SANE_STATUS_GOOD ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL Sane::SetOptionValue( int n, const String& rSet ) +sal_Bool Sane::SetOptionValue( int n, const String& rSet ) { if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING ) - return FALSE; + return sal_False; ByteString aSet( rSet, gsl_getSystemTextEncoding() ); SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, (void*)aSet.GetBuffer() ); if( nStatus != SANE_STATUS_GOOD ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL Sane::SetOptionValue( int n, double fSet, int nElement ) +sal_Bool Sane::SetOptionValue( int n, double fSet, int nElement ) { - BOOL bSuccess = FALSE; + sal_Bool bSuccess = sal_False; if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && mppOptions[n]->type != SANE_TYPE_FIXED ) ) - return FALSE; + return sal_False; SANE_Status nStatus; if( mppOptions[n]->size/sizeof(SANE_Word) > 1 ) @@ -487,16 +487,16 @@ BOOL Sane::SetOptionValue( int n, double fSet, int nElement ) nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, &nSetTo ); if( nStatus == SANE_STATUS_GOOD ) - bSuccess = TRUE; + bSuccess = sal_True; } return bSuccess; } -BOOL Sane::SetOptionValue( int n, double* pSet ) +sal_Bool Sane::SetOptionValue( int n, double* pSet ) { if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && mppOptions[n]->type != SANE_TYPE_FIXED ) ) - return FALSE; + return sal_False; SANE_Word* pFixedSet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; for( size_t i = 0; i < mppOptions[n]->size/sizeof(SANE_Word); i++ ) { @@ -508,8 +508,8 @@ BOOL Sane::SetOptionValue( int n, double* pSet ) SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, pFixedSet ); delete [] pFixedSet; if( nStatus != SANE_STATUS_GOOD ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } enum FrameStyleType { @@ -518,25 +518,25 @@ enum FrameStyleType { #define BYTE_BUFFER_SIZE 32768 -static inline UINT8 _ReadValue( FILE* fp, int depth ) +static inline sal_uInt8 _ReadValue( FILE* fp, int depth ) { if( depth == 16 ) { - UINT16 nWord; + sal_uInt16 nWord; // data always come in native byte order ! // 16 bits is not really supported by backends as of now // e.g. UMAX Astra 1200S delivers 16 bit but in BIGENDIAN // against SANE documentation (xscanimage gets the same result // as we do fread( &nWord, 1, 2, fp ); - return (UINT8)( nWord / 256 ); + return (sal_uInt8)( nWord / 256 ); } - UINT8 nByte; + sal_uInt8 nByte; fread( &nByte, 1, 1, fp ); return nByte; } -BOOL Sane::CheckConsistency( const char* pMes, BOOL bInit ) +sal_Bool Sane::CheckConsistency( const char* pMes, sal_Bool bInit ) { static SANE_Option_Descriptor** pDescArray = NULL; static SANE_Option_Descriptor* pZero = NULL; @@ -546,15 +546,15 @@ BOOL Sane::CheckConsistency( const char* pMes, BOOL bInit ) pDescArray = (SANE_Option_Descriptor**)mppOptions; if( mppOptions ) pZero = (SANE_Option_Descriptor*)mppOptions[0]; - return TRUE; + return sal_True; } - BOOL bConsistent = TRUE; + sal_Bool bConsistent = sal_True; if( pDescArray != mppOptions ) - bConsistent = FALSE; + bConsistent = sal_False; if( pZero != mppOptions[0] ) - bConsistent = FALSE; + bConsistent = sal_False; if( ! bConsistent ) dbg_msg( "Sane is not consistent. (%s)\n", pMes ); @@ -562,16 +562,16 @@ BOOL Sane::CheckConsistency( const char* pMes, BOOL bInit ) return bConsistent; } -BOOL Sane::Start( BitmapTransporter& rBitmap ) +sal_Bool Sane::Start( BitmapTransporter& rBitmap ) { int nStream = 0, nLine = 0, i = 0; SANE_Parameters aParams; FrameStyleType eType = FrameStyle_Gray; - BOOL bSuccess = TRUE; - BOOL bWidthSet = FALSE; + sal_Bool bSuccess = sal_True; + sal_Bool bWidthSet = sal_False; if( ! maHandle ) - return FALSE; + return sal_False; int nWidthMM = 0; int nHeightMM = 0; @@ -602,7 +602,7 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) if( ( nOption = GetOptionByName( "resolution" ) ) != -1 ) GetOptionValue( nOption, fResl ); - BYTE* pBuffer = NULL; + sal_uInt8* pBuffer = NULL; SANE_Status nStatus = SANE_STATUS_GOOD; @@ -618,19 +618,19 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) aConverter << (sal_uInt32) 60; // write BITMAPINFOHEADER - aConverter << (UINT32)40; - aConverter << (UINT32)0; // fill in width later - aConverter << (UINT32)0; // fill in height later - aConverter << (UINT16)1; + aConverter << (sal_uInt32)40; + aConverter << (sal_uInt32)0; // fill in width later + aConverter << (sal_uInt32)0; // fill in height later + aConverter << (sal_uInt16)1; // create header for 24 bits // correct later if necessary - aConverter << (UINT16)24; - aConverter << (UINT32)0; - aConverter << (UINT32)0; - aConverter << (UINT32)0; - aConverter << (UINT32)0; - aConverter << (UINT32)0; - aConverter << (UINT32)0; + aConverter << (sal_uInt16)24; + aConverter << (sal_uInt32)0; + aConverter << (sal_uInt32)0; + aConverter << (sal_uInt32)0; + aConverter << (sal_uInt32)0; + aConverter << (sal_uInt32)0; + aConverter << (sal_uInt32)0; for( nStream=0; nStream < 3 && bSuccess ; nStream++ ) { @@ -644,7 +644,7 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) CheckConsistency( "sane_get_parameters" ); if (nStatus != SANE_STATUS_GOOD || aParams.bytes_per_line == 0) { - bSuccess = FALSE; + bSuccess = sal_False; break; } #if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL @@ -662,7 +662,7 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) #endif if( ! pBuffer ) { - pBuffer = new BYTE[ BYTE_BUFFER_SIZE < 4*aParams.bytes_per_line ? 4*aParams.bytes_per_line : BYTE_BUFFER_SIZE ]; + pBuffer = new sal_uInt8[ BYTE_BUFFER_SIZE < 4*aParams.bytes_per_line ? 4*aParams.bytes_per_line : BYTE_BUFFER_SIZE ]; } if( aParams.last_frame ) @@ -687,14 +687,14 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) fprintf( stderr, "Warning: unknown frame style !!!\n" ); } - BOOL bSynchronousRead = TRUE; + sal_Bool bSynchronousRead = sal_True; // should be fail safe, but ... ?? nStatus = p_set_io_mode( maHandle, SANE_FALSE ); CheckConsistency( "sane_set_io_mode" ); if( nStatus != SANE_STATUS_GOOD ) { - bSynchronousRead = FALSE; + bSynchronousRead = sal_False; nStatus = p_set_io_mode( maHandle, SANE_TRUE ); CheckConsistency( "sane_set_io_mode" ); #if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL @@ -713,12 +713,12 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) DUMP_STATE( nStatus, "sane_get_select_fd" ); CheckConsistency( "sane_get_select_fd" ); if( nStatus != SANE_STATUS_GOOD ) - bSynchronousRead = TRUE; + bSynchronousRead = sal_True; } FILE* pFrame = tmpfile(); if( ! pFrame ) { - bSuccess = FALSE; + bSuccess = sal_False; break; } do { @@ -748,14 +748,14 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) if( nStatus != SANE_STATUS_EOF ) { fclose( pFrame ); - bSuccess = FALSE; + bSuccess = sal_False; break; } int nFrameLength = ftell( pFrame ); fseek( pFrame, 0, SEEK_SET ); - UINT32 nWidth = (UINT32) aParams.pixels_per_line; - UINT32 nHeight = (UINT32) (nFrameLength / aParams.bytes_per_line); + sal_uInt32 nWidth = (sal_uInt32) aParams.pixels_per_line; + sal_uInt32 nHeight = (sal_uInt32) (nFrameLength / aParams.bytes_per_line); if( ! bWidthSet ) { if( ! fResl ) @@ -769,12 +769,12 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) #endif aConverter.Seek( 18 ); - aConverter << (UINT32)nWidth; - aConverter << (UINT32)nHeight; + aConverter << (sal_uInt32)nWidth; + aConverter << (sal_uInt32)nHeight; aConverter.Seek( 38 ); - aConverter << (UINT32)(1000*nWidth/nWidthMM); - aConverter << (UINT32)(1000*nHeight/nHeightMM); - bWidthSet = TRUE; + aConverter << (sal_uInt32)(1000*nWidth/nWidthMM); + aConverter << (sal_uInt32)(1000*nHeight/nHeightMM); + bWidthSet = sal_True; } aConverter.Seek(60); @@ -783,13 +783,13 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) aConverter.Seek( 10 ); aConverter << (sal_uInt32)64; aConverter.Seek( 28 ); - aConverter << (UINT16) 1; + aConverter << (sal_uInt16) 1; aConverter.Seek( 54 ); // write color table - aConverter << (UINT16)0xffff; - aConverter << (UINT8)0xff; - aConverter << (UINT8)0; - aConverter << (UINT32)0; + aConverter << (sal_uInt16)0xffff; + aConverter << (sal_uInt8)0xff; + aConverter << (sal_uInt8)0; + aConverter << (sal_uInt32)0; aConverter.Seek( 64 ); } else if( eType == FrameStyle_Gray ) @@ -797,15 +797,15 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) aConverter.Seek( 10 ); aConverter << (sal_uInt32)1084; aConverter.Seek( 28 ); - aConverter << (UINT16) 8; + aConverter << (sal_uInt16) 8; aConverter.Seek( 54 ); // write color table for( nLine = 0; nLine < 256; nLine++ ) { - aConverter << (UINT8)nLine; - aConverter << (UINT8)nLine; - aConverter << (UINT8)nLine; - aConverter << (UINT8)0; + aConverter << (sal_uInt8)nLine; + aConverter << (sal_uInt8)nLine; + aConverter << (sal_uInt8)nLine; + aConverter << (sal_uInt8)0; } aConverter.Seek( 1084 ); } @@ -825,7 +825,7 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) { for( i = 0; i < (aParams.pixels_per_line); i++ ) { - UINT8 nGray = _ReadValue( pFrame, aParams.depth ); + sal_uInt8 nGray = _ReadValue( pFrame, aParams.depth ); aConverter << nGray; } } @@ -833,7 +833,7 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) { for( i = 0; i < (aParams.pixels_per_line); i++ ) { - UINT8 nRed, nGreen, nBlue; + sal_uInt8 nRed, nGreen, nBlue; nRed = _ReadValue( pFrame, aParams.depth ); nGreen = _ReadValue( pFrame, aParams.depth ); nBlue = _ReadValue( pFrame, aParams.depth ); @@ -846,7 +846,7 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) { for( i = 0; i < (aParams.pixels_per_line); i++ ) { - UINT8 nValue = _ReadValue( pFrame, aParams.depth ); + sal_uInt8 nValue = _ReadValue( pFrame, aParams.depth ); switch( aParams.format ) { case SANE_FRAME_RED: @@ -877,7 +877,7 @@ BOOL Sane::Start( BitmapTransporter& rBitmap ) break; } else - bSuccess = FALSE; + bSuccess = sal_False; } // get stream length aConverter.Seek( STREAM_SEEK_TO_END ); @@ -917,7 +917,7 @@ int Sane::GetRange( int n, double*& rpDouble ) rpDouble = 0; int nItems, i; - BOOL bIsFixed = mppOptions[n]->type == SANE_TYPE_FIXED ? TRUE : FALSE; + sal_Bool bIsFixed = mppOptions[n]->type == SANE_TYPE_FIXED ? sal_True : sal_False; dbg_msg( "Sane::GetRange of option %s ", mppOptions[n]->name ); if(mppOptions[n]->constraint_type == SANE_CONSTRAINT_RANGE ) @@ -995,10 +995,10 @@ String Sane::GetOptionUnitName( int n ) return aText; } -BOOL Sane::ActivateButtonOption( int n ) +sal_Bool Sane::ActivateButtonOption( int n ) { SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, NULL ); if( nStatus != SANE_STATUS_GOOD ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } diff --git a/extensions/source/scanner/sane.hxx b/extensions/source/scanner/sane.hxx index 44ce0d295f42..2b6683477b56 100644 --- a/extensions/source/scanner/sane.hxx +++ b/extensions/source/scanner/sane.hxx @@ -114,16 +114,16 @@ private: SANE_Status ControlOption( int, SANE_Action, void* ); - BOOL CheckConsistency( const char*, BOOL bInit = FALSE ); + sal_Bool CheckConsistency( const char*, sal_Bool bInit = sal_False ); public: Sane(); ~Sane(); - static BOOL IsSane() - { return pSaneLib ? TRUE : FALSE; } - BOOL IsOpen() - { return maHandle ? TRUE : FALSE; } + static sal_Bool IsSane() + { return pSaneLib ? sal_True : sal_False; } + sal_Bool IsOpen() + { return maHandle ? sal_True : sal_False; } static int CountDevices() { return nDevices; } static String GetName( int n ) @@ -154,28 +154,28 @@ public: inline int GetOptionElements( int n ); int GetOptionByName( const char* ); - BOOL GetOptionValue( int, BOOL& ); - BOOL GetOptionValue( int, ByteString& ); - BOOL GetOptionValue( int, double&, int nElement = 0 ); - BOOL GetOptionValue( int, double* ); + sal_Bool GetOptionValue( int, sal_Bool& ); + sal_Bool GetOptionValue( int, ByteString& ); + sal_Bool GetOptionValue( int, double&, int nElement = 0 ); + sal_Bool GetOptionValue( int, double* ); - BOOL SetOptionValue( int, BOOL ); - BOOL SetOptionValue( int, const String& ); - BOOL SetOptionValue( int, double, int nElement = 0 ); - BOOL SetOptionValue( int, double* ); + sal_Bool SetOptionValue( int, sal_Bool ); + sal_Bool SetOptionValue( int, const String& ); + sal_Bool SetOptionValue( int, double, int nElement = 0 ); + sal_Bool SetOptionValue( int, double* ); - BOOL ActivateButtonOption( int ); + sal_Bool ActivateButtonOption( int ); int CountOptions() { return mnOptions; } int GetDeviceNumber() { return mnDevice; } - BOOL Open( const char* ); - BOOL Open( int ); + sal_Bool Open( const char* ); + sal_Bool Open( int ); void Close(); void ReloadDevices(); void ReloadOptions(); - BOOL Start( BitmapTransporter& ); + sal_Bool Start( BitmapTransporter& ); inline Link SetReloadOptionsHdl( const Link& rLink ); }; diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 7b4b258ea43f..fc8119c07b4c 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -50,8 +50,8 @@ ResId SaneResId( sal_uInt32 nID ) SaneDlg::SaneDlg( Window* pParent, Sane& rSane ) : ModalDialog( pParent, SaneResId( RID_SANE_DIALOG ) ), mrSane( rSane ), - mbIsDragging( FALSE ), - mbDragDrawn( FALSE ), + mbIsDragging( sal_False ), + mbDragDrawn( sal_False ), maMapMode( MAP_APPFONT ), maOKButton( this, SaneResId( RID_SCAN_OK ) ), maCancelButton( this, SaneResId( RID_SCAN_CANCEL ) ), @@ -141,7 +141,7 @@ short SaneDlg::Execute() ErrorBox aErrorBox( NULL, WB_OK | WB_DEF_OK, String( SaneResId( RID_SANE_NOSANELIB_TXT ) ) ); aErrorBox.Execute(); - return FALSE; + return sal_False; } LoadState(); return ModalDialog::Execute(); @@ -173,7 +173,7 @@ void SaneDlg::InitFields() int nOption, i, nValue; double fValue; - BOOL bSuccess = FALSE; + sal_Bool bSuccess = sal_False; const char *ppSpecialOptions[] = { "resolution", "tl-x", @@ -183,7 +183,7 @@ void SaneDlg::InitFields() "preview" }; - mbDragEnable = TRUE; + mbDragEnable = sal_True; maReslBox.Clear(); maMinTopLeft = Point( 0, 0 ); maMaxBottomRight = Point( PREVIEW_WIDTH, PREVIEW_HEIGHT ); @@ -200,7 +200,7 @@ void SaneDlg::InitFields() bSuccess = mrSane.GetOptionValue( nOption, fRes ); if( bSuccess ) { - maReslBox.Enable( TRUE ); + maReslBox.Enable( sal_True ); maReslBox.SetValue( (long)fRes ); double *pDouble = NULL; @@ -241,11 +241,11 @@ void SaneDlg::InitFields() delete [] pDouble; } else - maReslBox.Enable( FALSE ); + maReslBox.Enable( sal_False ); } } else - maReslBox.Enable( FALSE ); + maReslBox.Enable( sal_False ); // set scan area for( i = 0; i < 4; i++ ) @@ -271,7 +271,7 @@ void SaneDlg::InitFields() pField = &maBottomField; } nOption = pOptionName ? mrSane.GetOptionByName( pOptionName ) : -1; - bSuccess = FALSE; + bSuccess = sal_False; if( nOption != -1 ) { bSuccess = mrSane.GetOptionValue( nOption, fValue, 0 ); @@ -323,11 +323,11 @@ void SaneDlg::InitFields() case 3: maMaxBottomRight.Y() = (int)fValue;break; } } - pField->Enable( TRUE ); + pField->Enable( sal_True ); } else { - mbDragEnable = FALSE; + mbDragEnable = sal_False; pField->SetMin( 0 ); switch( i ) { case 0: @@ -355,7 +355,7 @@ void SaneDlg::InitFields() pField->SetValue( PREVIEW_HEIGHT ); break; } - pField->Enable( FALSE ); + pField->Enable( sal_False ); } } maTopLeft = GetPixelPos( maTopLeft ); @@ -367,23 +367,23 @@ void SaneDlg::InitFields() // fill OptionBox maOptionBox.Clear(); SvLBoxEntry* pParentEntry = 0; - BOOL bGroupRejected = FALSE; + sal_Bool bGroupRejected = sal_False; for( i = 1; i < mrSane.CountOptions(); i++ ) { String aOption=mrSane.GetOptionName( i ); - BOOL bInsertAdvanced = + sal_Bool bInsertAdvanced = mrSane.GetOptionCap( i ) & SANE_CAP_ADVANCED && - ! maAdvancedBox.IsChecked() ? FALSE : TRUE; + ! maAdvancedBox.IsChecked() ? sal_False : sal_True; if( mrSane.GetOptionType( i ) == SANE_TYPE_GROUP ) { if( bInsertAdvanced ) { aOption = mrSane.GetOptionTitle( i ); pParentEntry = maOptionBox.InsertEntry( aOption ); - bGroupRejected = FALSE; + bGroupRejected = sal_False; } else - bGroupRejected = TRUE; + bGroupRejected = sal_True; } else if( aOption.Len() && ! ( mrSane.GetOptionCap( i ) & @@ -393,12 +393,12 @@ void SaneDlg::InitFields() ) ) && bInsertAdvanced && ! bGroupRejected ) { - BOOL bIsSpecial = FALSE; + sal_Bool bIsSpecial = sal_False; for( size_t n = 0; !bIsSpecial && n < sizeof(ppSpecialOptions)/sizeof(ppSpecialOptions[0]); n++ ) { if( aOption.EqualsAscii( ppSpecialOptions[n] ) ) - bIsSpecial=TRUE; + bIsSpecial=sal_True; } if( ! bIsSpecial ) { @@ -432,7 +432,7 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton ) { mrSane.SetOptionValue( mnCurrentOption, maBoolCheckBox.IsChecked() ? - (BOOL)TRUE : (BOOL)FALSE ); + (sal_Bool)sal_True : (sal_Bool)sal_False ); } else if( pButton == &maButtonOption ) { @@ -479,7 +479,7 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton ) double fRes = (double)maReslBox.GetValue(); SetAdjustedNumericalValue( "resolution", fRes ); mrSane.SetReloadOptionsHdl( maOldLink ); - UpdateScanArea( TRUE ); + UpdateScanArea( sal_True ); SaveState(); EndDialog( mrSane.IsOpen() ? 1 : 0 ); } @@ -567,8 +567,8 @@ IMPL_LINK( SaneDlg, OptionsBoxSelectHdl, SvTreeListBox*, pBox ) maVectorBox.SetMin( 1 ); maVectorBox.SetMax( mrSane.GetOptionElements( mnCurrentOption ) ); - maVectorBox.Show( TRUE ); - maVectorTxt.Show( TRUE ); + maVectorBox.Show( sal_True ); + maVectorTxt.Show( sal_True ); } else { @@ -623,7 +623,7 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit ) if( fRes > pDouble[ 1 ] ) fRes = pDouble[ 1 ]; } - maReslBox.SetValue( (ULONG)fRes ); + maReslBox.SetValue( (sal_uLong)fRes ); } } else if( pEdit == &maNumericEdit ) @@ -706,7 +706,7 @@ void SaneDlg::AcquirePreview() if( ! mrSane.IsOpen() ) return; - UpdateScanArea( TRUE ); + UpdateScanArea( sal_True ); // set small resolution for preview double fResl = (double)maReslBox.GetValue(); SetAdjustedNumericalValue( "resolution", 30.0 ); @@ -720,7 +720,7 @@ void SaneDlg::AcquirePreview() return; } else - mrSane.SetOptionValue( nOption, (BOOL)TRUE ); + mrSane.SetOptionValue( nOption, (sal_Bool)sal_True ); BitmapTransporter aTransporter; if( ! mrSane.Start( aTransporter ) ) @@ -736,11 +736,11 @@ void SaneDlg::AcquirePreview() fprintf( stderr, "Previewbitmapstream contains %d bytes\n", (int)aTransporter.getStream().Tell() ); #endif aTransporter.getStream().Seek( STREAM_SEEK_TO_BEGIN ); - maPreviewBitmap.Read( aTransporter.getStream(), TRUE ); + maPreviewBitmap.Read( aTransporter.getStream(), sal_True ); } SetAdjustedNumericalValue( "resolution", fResl ); - maReslBox.SetValue( (ULONG)fResl ); + maReslBox.SetValue( (sal_uLong)fResl ); if( mbDragEnable ) maPreviewRect = Rectangle( maTopLeft, @@ -781,7 +781,7 @@ void SaneDlg::Paint( const Rectangle& rRect ) DrawBitmap( maPreviewRect.TopLeft(), maPreviewRect.GetSize(), maPreviewBitmap ); - mbDragDrawn = FALSE; + mbDragDrawn = sal_False; DrawDrag(); ModalDialog::Paint( rRect ); @@ -789,43 +789,43 @@ void SaneDlg::Paint( const Rectangle& rRect ) void SaneDlg::DisableOption() { - maBoolCheckBox.Show( FALSE ); - maStringEdit.Show( FALSE ); - maNumericEdit.Show( FALSE ); - maQuantumRangeBox.Show( FALSE ); - maStringRangeBox.Show( FALSE ); - maButtonOption.Show( FALSE ); - maVectorBox.Show( FALSE ); - maVectorTxt.Show( FALSE ); - maOptionDescTxt.Show( FALSE ); + maBoolCheckBox.Show( sal_False ); + maStringEdit.Show( sal_False ); + maNumericEdit.Show( sal_False ); + maQuantumRangeBox.Show( sal_False ); + maStringRangeBox.Show( sal_False ); + maButtonOption.Show( sal_False ); + maVectorBox.Show( sal_False ); + maVectorTxt.Show( sal_False ); + maOptionDescTxt.Show( sal_False ); } void SaneDlg::EstablishBoolOption() { - BOOL bSuccess, bValue; + sal_Bool bSuccess, bValue; bSuccess = mrSane.GetOptionValue( mnCurrentOption, bValue ); if( bSuccess ) { maOptionDescTxt.SetText( mrSane.GetOptionName( mnCurrentOption ) ); - maOptionDescTxt.Show( TRUE ); + maOptionDescTxt.Show( sal_True ); maBoolCheckBox.Check( bValue ); - maBoolCheckBox.Show( TRUE ); + maBoolCheckBox.Show( sal_True ); } } void SaneDlg::EstablishStringOption() { - BOOL bSuccess; + sal_Bool bSuccess; ByteString aValue; bSuccess = mrSane.GetOptionValue( mnCurrentOption, aValue ); if( bSuccess ) { maOptionDescTxt.SetText( mrSane.GetOptionName( mnCurrentOption ) ); - maOptionDescTxt.Show( TRUE ); + maOptionDescTxt.Show( sal_True ); maStringEdit.SetText( String( aValue, osl_getThreadTextEncoding() ) ); - maStringEdit.Show( TRUE ); + maStringEdit.Show( sal_True ); } } @@ -838,9 +838,9 @@ void SaneDlg::EstablishStringRange() ByteString aValue; mrSane.GetOptionValue( mnCurrentOption, aValue ); maStringRangeBox.SelectEntry( String( aValue, osl_getThreadTextEncoding() ) ); - maStringRangeBox.Show( TRUE ); + maStringRangeBox.Show( sal_True ); maOptionDescTxt.SetText( mrSane.GetOptionName( mnCurrentOption ) ); - maOptionDescTxt.Show( TRUE ); + maOptionDescTxt.Show( sal_True ); } void SaneDlg::EstablishQuantumRange() @@ -876,18 +876,18 @@ void SaneDlg::EstablishQuantumRange() sprintf( pBuf, "%g", fValue ); maQuantumRangeBox.SelectEntry( String( pBuf, osl_getThreadTextEncoding() ) ); } - maQuantumRangeBox.Show( TRUE ); + maQuantumRangeBox.Show( sal_True ); String aText( mrSane.GetOptionName( mnCurrentOption ) ); aText += ' '; aText += mrSane.GetOptionUnitName( mnCurrentOption ); maOptionDescTxt.SetText( aText ); - maOptionDescTxt.Show( TRUE ); + maOptionDescTxt.Show( sal_True ); } } void SaneDlg::EstablishNumericOption() { - BOOL bSuccess; + sal_Bool bSuccess; double fValue; bSuccess = mrSane.GetOptionValue( mnCurrentOption, fValue ); @@ -904,17 +904,17 @@ void SaneDlg::EstablishNumericOption() aText += String( pBuf, osl_getThreadTextEncoding() ); } maOptionDescTxt.SetText( aText ); - maOptionDescTxt.Show( TRUE ); + maOptionDescTxt.Show( sal_True ); sprintf( pBuf, "%g", fValue ); maNumericEdit.SetText( String( pBuf, osl_getThreadTextEncoding() ) ); - maNumericEdit.Show( TRUE ); + maNumericEdit.Show( sal_True ); } void SaneDlg::EstablishButtonOption() { maOptionDescTxt.SetText( mrSane.GetOptionName( mnCurrentOption ) ); - maOptionDescTxt.Show( TRUE ); - maButtonOption.Show( TRUE ); + maOptionDescTxt.Show( sal_True ); + maButtonOption.Show( sal_True ); } #define RECT_SIZE_PIX 7 @@ -959,7 +959,7 @@ void SaneDlg::MouseMove( const MouseEvent& rMEvt ) maBottomRight.Y() = nSwap; } DrawDrag(); - UpdateScanArea( FALSE ); + UpdateScanArea( sal_False ); } ModalDialog::MouseMove( rMEvt ); } @@ -980,21 +980,21 @@ void SaneDlg::MouseButtonDown( const MouseEvent& rMEvt ) { meDragDirection = TopLeft; aMousePixel = maTopLeft; - mbIsDragging = TRUE; + mbIsDragging = sal_True; } else if( aMousePixel.X() >= nMiddleX && aMousePixel.X() < nMiddleX + RECT_SIZE_PIX ) { meDragDirection = Top; aMousePixel.Y() = maTopLeft.Y(); - mbIsDragging = TRUE; + mbIsDragging = sal_True; } else if( aMousePixel.X() > maBottomRight.X() - RECT_SIZE_PIX && aMousePixel.X() <= maBottomRight.X() ) { meDragDirection = TopRight; aMousePixel = Point( maBottomRight.X(), maTopLeft.Y() ); - mbIsDragging = TRUE; + mbIsDragging = sal_True; } } else if( aMousePixel.Y() >= nMiddleY && @@ -1005,14 +1005,14 @@ void SaneDlg::MouseButtonDown( const MouseEvent& rMEvt ) { meDragDirection = Left; aMousePixel.X() = maTopLeft.X(); - mbIsDragging = TRUE; + mbIsDragging = sal_True; } else if( aMousePixel.X() > maBottomRight.X() - RECT_SIZE_PIX && aMousePixel.X() <= maBottomRight.X() ) { meDragDirection = Right; aMousePixel.X() = maBottomRight.X(); - mbIsDragging = TRUE; + mbIsDragging = sal_True; } } else if( aMousePixel.Y() <= maBottomRight.Y() && @@ -1023,21 +1023,21 @@ void SaneDlg::MouseButtonDown( const MouseEvent& rMEvt ) { meDragDirection = BottomLeft; aMousePixel = Point( maTopLeft.X(), maBottomRight.Y() ); - mbIsDragging = TRUE; + mbIsDragging = sal_True; } else if( aMousePixel.X() >= nMiddleX && aMousePixel.X() < nMiddleX + RECT_SIZE_PIX ) { meDragDirection = Bottom; aMousePixel.Y() = maBottomRight.Y(); - mbIsDragging = TRUE; + mbIsDragging = sal_True; } else if( aMousePixel.X() > maBottomRight.X() - RECT_SIZE_PIX && aMousePixel.X() <= maBottomRight.X() ) { meDragDirection = BottomRight; aMousePixel = maBottomRight; - mbIsDragging = TRUE; + mbIsDragging = sal_True; } } } @@ -1053,9 +1053,9 @@ void SaneDlg::MouseButtonUp( const MouseEvent& rMEvt ) { if( mbIsDragging ) { - UpdateScanArea( TRUE ); + UpdateScanArea( sal_True ); } - mbIsDragging = FALSE; + mbIsDragging = sal_False; ModalDialog::MouseButtonUp( rMEvt ); } @@ -1102,7 +1102,7 @@ void SaneDlg::DrawDrag() aLastBR = maBottomRight; DrawRectangles( maTopLeft, maBottomRight ); - mbDragDrawn = TRUE; + mbDragDrawn = sal_True; SetRasterOp( eROP ); SetMapMode( maMapMode ); } @@ -1141,7 +1141,7 @@ Point SaneDlg::GetLogicPos( const Point& rIn ) return aConvert; } -void SaneDlg::UpdateScanArea( BOOL bSend ) +void SaneDlg::UpdateScanArea( sal_Bool bSend ) { if( ! mbDragEnable ) return; @@ -1166,26 +1166,26 @@ void SaneDlg::UpdateScanArea( BOOL bSend ) } } -BOOL SaneDlg::LoadState() +sal_Bool SaneDlg::LoadState() { #ifdef USE_SAVE_STATE int i; if( ! Sane::IsSane() ) - return FALSE; + return sal_False; const char* pEnv = getenv("HOME"); String aFileName( pEnv ? pEnv : "", osl_getThreadTextEncoding() ); aFileName += String( RTL_CONSTASCII_USTRINGPARAM( "/.so_sane_state" ) ); Config aConfig( aFileName ); if( ! aConfig.HasGroup( "SANE" ) ) - return FALSE; + return sal_False; aConfig.SetGroup( "SANE" ); ByteString aString = aConfig.ReadKey( "SO_LastSaneDevice" ); for( i = 0; i < Sane::CountDevices() && ! aString.Equals( ByteString( Sane::GetName( i ), osl_getThreadTextEncoding() ) ); i++ ) ; if( i == Sane::CountDevices() ) - return FALSE; + return sal_False; mrSane.Close(); mrSane.Open( aString.GetBuffer() ); @@ -1206,7 +1206,7 @@ BOOL SaneDlg::LoadState() if( aValue.CompareTo( "BOOL=", 5 ) == COMPARE_EQUAL ) { aValue.Erase( 0, 5 ); - BOOL aBOOL = (BOOL)aValue.ToInt32(); + sal_Bool aBOOL = (sal_Bool)aValue.ToInt32(); mrSane.SetOptionValue( nOption, aBOOL ); } else if( aValue.CompareTo( "STRING=", 7 ) == COMPARE_EQUAL ) @@ -1233,9 +1233,9 @@ BOOL SaneDlg::LoadState() DisableOption(); InitFields(); - return TRUE; + return sal_True; #else - return FALSE; + return sal_False; #endif } @@ -1263,11 +1263,11 @@ void SaneDlg::SaveState() { case SANE_TYPE_BOOL: { - BOOL bValue; + sal_Bool bValue; if( mrSane.GetOptionValue( i, bValue ) ) { ByteString aString( "BOOL=" ); - aString += (ULONG)bValue; + aString += (sal_uLong)bValue; aConfig.WriteKey( aOption, aString ); } } @@ -1327,7 +1327,7 @@ void SaneDlg::SaveState() { case SANE_TYPE_BOOL: { - BOOL bValue; + sal_Bool bValue; if( mrSane.GetOptionValue( nOption, bValue ) ) { ByteString aString( "BOOL=" ); @@ -1377,22 +1377,22 @@ void SaneDlg::SaveState() #endif } -BOOL SaneDlg::SetAdjustedNumericalValue( +sal_Bool SaneDlg::SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement ) { int nOption; if( ! Sane::IsSane() || ! mrSane.IsOpen() || ( nOption = mrSane.GetOptionByName( pOption ) ) == -1 ) - return FALSE; + return sal_False; if( nElement < 0 || nElement >= mrSane.GetOptionElements( nOption ) ) - return FALSE; + return sal_False; double* pValues = NULL; int nValues; if( ( nValues = mrSane.GetRange( nOption, pValues ) ) < 0 ) - return FALSE; + return sal_False; #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "SaneDlg::SetAdjustedNumericalValue( \"%s\", %lg ) ", @@ -1427,5 +1427,5 @@ BOOL SaneDlg::SetAdjustedNumericalValue( #endif - return TRUE; + return sal_True; } diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx index 2ea35ca33c83..5fc112732ef8 100644 --- a/extensions/source/scanner/sanedlg.hxx +++ b/extensions/source/scanner/sanedlg.hxx @@ -52,10 +52,10 @@ private: Rectangle maPreviewRect; Point maTopLeft, maBottomRight; Point maMinTopLeft, maMaxBottomRight; - BOOL mbDragEnable; - BOOL mbIsDragging; + sal_Bool mbDragEnable; + sal_Bool mbIsDragging; int mnDragMode; - BOOL mbDragDrawn; + sal_Bool mbDragDrawn; DragDirection meDragDirection; MapMode maMapMode; @@ -115,7 +115,7 @@ private: DECL_LINK( OptionsBoxSelectHdl, SvTreeListBox* ); void SaveState(); - BOOL LoadState(); + sal_Bool LoadState(); void InitDevices(); void InitFields(); @@ -132,10 +132,10 @@ private: void DrawDrag(); Point GetPixelPos( const Point& ); Point GetLogicPos( const Point& ); - void UpdateScanArea( BOOL ); + void UpdateScanArea( sal_Bool ); // helper - BOOL SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 ); + sal_Bool SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 ); virtual void Paint( const Rectangle& ); virtual void MouseMove( const MouseEvent& rMEvt ); diff --git a/extensions/source/scanner/scanner.hxx b/extensions/source/scanner/scanner.hxx index 3453598974a7..374c2adc3a25 100644 --- a/extensions/source/scanner/scanner.hxx +++ b/extensions/source/scanner/scanner.hxx @@ -88,7 +88,7 @@ public: // XScannerManager virtual SEQ( ScannerContext ) SAL_CALL getAvailableScanners() throw(); - virtual BOOL SAL_CALL configureScanner( ScannerContext& scanner_context ) throw( ScannerException ); + virtual sal_Bool SAL_CALL configureScanner( ScannerContext& scanner_context ) throw( ScannerException ); virtual void SAL_CALL startScan( const ScannerContext& scanner_context, const REF( com::sun::star::lang::XEventListener )& rxListener ) throw( ScannerException ); virtual ScanError SAL_CALL getError( const ScannerContext& scanner_context ) throw( ScannerException ); virtual REF( AWT::XBitmap ) SAL_CALL getBitmap( const ScannerContext& scanner_context ) throw( ScannerException ); diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index 0a477a9dae7d..5307ac148487 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -203,7 +203,7 @@ void ScannerThread::run() { int nOption = m_pHolder->m_aSane.GetOptionByName( "preview" ); if( nOption != -1 ) - m_pHolder->m_aSane.SetOptionValue( nOption, (BOOL)FALSE ); + m_pHolder->m_aSane.SetOptionValue( nOption, (sal_Bool)sal_False ); m_pHolder->m_nError = m_pHolder->m_aSane.Start( *pTransporter ) ? @@ -277,7 +277,7 @@ SEQ( ScannerContext ) ScannerManager::getAvailableScanners() throw() // ----------------------------------------------------------------------------- -BOOL ScannerManager::configureScanner( ScannerContext& scanner_context ) throw( ScannerException ) +sal_Bool ScannerManager::configureScanner( ScannerContext& scanner_context ) throw( ScannerException ) { vos::OGuard aGuard( theSaneProtector::get() ); sanevec &rSanes = theSanes::get().m_aSanes; @@ -286,7 +286,7 @@ BOOL ScannerManager::configureScanner( ScannerContext& scanner_context ) throw( fprintf( stderr, "ScannerManager::configureScanner\n" ); #endif - if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= rSanes.size() ) + if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) throw ScannerException( ::rtl::OUString::createFromAscii( "Scanner does not exist" ), REF( XScannerManager )( this ), @@ -303,7 +303,7 @@ BOOL ScannerManager::configureScanner( ScannerContext& scanner_context ) throw( pHolder->m_bBusy = true; SaneDlg aDlg( NULL, pHolder->m_aSane ); - BOOL bRet = (BOOL)aDlg.Execute(); + sal_Bool bRet = (sal_Bool)aDlg.Execute(); pHolder->m_bBusy = false; return bRet; @@ -321,7 +321,7 @@ void ScannerManager::startScan( const ScannerContext& scanner_context, fprintf( stderr, "ScannerManager::startScan\n" ); #endif - if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= rSanes.size() ) + if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) throw ScannerException( ::rtl::OUString::createFromAscii( "Scanner does not exist" ), REF( XScannerManager )( this ), @@ -347,7 +347,7 @@ ScanError ScannerManager::getError( const ScannerContext& scanner_context ) thro vos::OGuard aGuard( theSaneProtector::get() ); sanevec &rSanes = theSanes::get().m_aSanes; - if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= rSanes.size() ) + if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) throw ScannerException( ::rtl::OUString::createFromAscii( "Scanner does not exist" ), REF( XScannerManager )( this ), @@ -366,7 +366,7 @@ REF( AWT::XBitmap ) ScannerManager::getBitmap( const ScannerContext& scanner_con vos::OGuard aGuard( theSaneProtector::get() ); sanevec &rSanes = theSanes::get().m_aSanes; - if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= rSanes.size() ) + if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) throw ScannerException( ::rtl::OUString::createFromAscii( "Scanner does not exist" ), REF( XScannerManager )( this ), diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index f245cc95d1f6..e910da58cc8a 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -1001,7 +1001,7 @@ SEQ( ScannerContext ) SAL_CALL ScannerManager::getAvailableScanners() throw() // ----------------------------------------------------------------------------- -BOOL SAL_CALL ScannerManager::configureScanner( ScannerContext& rContext ) +sal_Bool SAL_CALL ScannerManager::configureScanner( ScannerContext& rContext ) throw( ScannerException ) { vos::OGuard aGuard( maProtector ); diff --git a/extensions/source/scanner/twain.cxx b/extensions/source/scanner/twain.cxx index d0fcaf411d6a..bd17f1e56117 100644 --- a/extensions/source/scanner/twain.cxx +++ b/extensions/source/scanner/twain.cxx @@ -176,7 +176,7 @@ void ImpTwain::Destroy() // ----------------------------------------------------------------------------- -BOOL ImpTwain::SelectSource() +sal_Bool ImpTwain::SelectSource() { TW_UINT16 nRet = TWRC_FAILURE; @@ -201,9 +201,9 @@ BOOL ImpTwain::SelectSource() // ----------------------------------------------------------------------------- -BOOL ImpTwain::InitXfer() +sal_Bool ImpTwain::InitXfer() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !!aBitmap ) aBitmap = Bitmap(); @@ -435,7 +435,7 @@ void ImpTwain::ImplFallback( ULONG nEvent ) IMPL_LINK( ImpTwain, ImplFallbackHdl, void*, pData ) { const ULONG nEvent = (ULONG) pData; - BOOL bFallback = TRUE; + sal_Bool bFallback = sal_True; switch( nCurState ) { @@ -490,7 +490,7 @@ IMPL_LINK( ImpTwain, ImplFallbackHdl, void*, pData ) if( nEvent != TWAIN_EVENT_NONE ) aNotifyLink.Call( (void*) nEvent ); - bFallback = FALSE; + bFallback = sal_False; } break; } diff --git a/extensions/source/scanner/twain.hxx b/extensions/source/scanner/twain.hxx index 6f4605f5f796..bb9fa44b6cf6 100644 --- a/extensions/source/scanner/twain.hxx +++ b/extensions/source/scanner/twain.hxx @@ -58,21 +58,21 @@ class ImpTwain Bitmap aBitmap; DSMENTRYPROC pDSM; vos:: OModule * pMod; - ULONG nCurState; + sal_uLong nCurState; void ImplCreate(); void ImplOpenSourceManager(); void ImplOpenSource(); - BOOL ImplEnableSource(); + sal_Bool ImplEnableSource(); void ImplXfer(); - void ImplFallback( ULONG nEvent ); + void ImplFallback( sal_uLong nEvent ); DECL_LINK( ImplFallbackHdl, void* ); DECL_LINK( ImplDestroyHdl, void* ); public: - BOOL ImplHandleMsg( void* pMsg ); + sal_Bool ImplHandleMsg( void* pMsg ); #ifdef OS2 HAB hAB; @@ -90,8 +90,8 @@ public: void Destroy(); - BOOL SelectSource(); - BOOL InitXfer(); + sal_Bool SelectSource(); + sal_Bool InitXfer(); Bitmap GetXferBitmap(); }; |