diff options
Diffstat (limited to 'basic/source/app')
26 files changed, 653 insertions, 653 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index fd613a81673f..cd3e1dd0061f 100644 --- a/basic/source/app/app.cxx +++ b/basic/source/app/app.cxx @@ -94,52 +94,52 @@ IMPL_GEN_RES_STR; #ifdef DBG_UTIL // filter Messages generated due to missing configuration Bug:#83887# -void TestToolDebugMessageFilter( const sal_Char *pString, BOOL bIsOsl ) +void TestToolDebugMessageFilter( const sal_Char *pString, sal_Bool bIsOsl ) { - static BOOL static_bInsideFilter = FALSE; + static sal_Bool static_bInsideFilter = sal_False; // Ignore messages during filtering to avoid endless recursions if ( static_bInsideFilter ) return; - static_bInsideFilter = TRUE; + static_bInsideFilter = sal_True; ByteString aMessage( pString ); - BOOL bIgnore = FALSE; + sal_Bool bIgnore = sal_False; if ( bIsOsl ) { // OSL if ( aMessage.Search( CByteString("Cannot open Configuration: Connector: unknown delegatee com.sun.star.connection.Connector.portal") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; } else { // DBG #if ! (OSL_DEBUG_LEVEL > 1) if ( aMessage.Search( CByteString("SelectAppIconPixmap") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; #endif if ( aMessage.Search( CByteString("PropertySetRegistry::") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("property value missing") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("getDateFormatsImpl") ) != STRING_NOTFOUND && aMessage.Search( CByteString("no date formats") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("ucb::configureUcb(): Bad arguments") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("CreateInstance with arguments exception") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("AcquireTree failed") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; } if ( bIgnore ) { - static_bInsideFilter = FALSE; + static_bInsideFilter = sal_False; return; } @@ -164,22 +164,22 @@ void TestToolDebugMessageFilter( const sal_Char *pString, BOOL bIsOsl ) /* DBG_INSTOUTERROR( DBG_OUT_MSGBOX ) DBG_ERROR( pString ); DBG_INSTOUTERROR( DBG_OUT_TESTTOOL )*/ - static_bInsideFilter = FALSE; + static_bInsideFilter = sal_False; } void SAL_CALL DBG_TestToolDebugMessageFilter( const sal_Char *pString ) { - TestToolDebugMessageFilter( pString, FALSE ); + TestToolDebugMessageFilter( pString, sal_False ); } extern "C" void SAL_CALL osl_TestToolDebugMessageFilter( const sal_Char *pString ) { if ( !getenv( "DISABLE_SAL_DBGBOX" ) ) - TestToolDebugMessageFilter( pString, TRUE ); + TestToolDebugMessageFilter( pString, sal_True ); } #endif // #94145# Due to a tab in TT_SIGNATURE_FOR_UNICODE_TEXTFILES which is changed to blanks by some editors // this routine became necessary -BOOL IsTTSignatureForUnicodeTextfile( String aLine ) +sal_Bool IsTTSignatureForUnicodeTextfile( String aLine ) { aLine.SearchAndReplace( '\t', ' ' ); String ThreeBlanks = CUniString(" "); @@ -304,7 +304,7 @@ void BasicApp::Main( ) if ( aDefIniPath.Exists() ) { aDefIniPath.CopyTo( aIniPath, FSYS_ACTION_COPYFILE ); - FileStat::SetReadOnlyFlag( aIniPath, FALSE ); + FileStat::SetReadOnlyFlag( aIniPath, sal_False ); } } } @@ -331,7 +331,7 @@ void BasicApp::Main( ) } // ResMgr::CreateResMgr( CREATEVERSIONRESMGR( stt ), ) -//const char* ResMgr::GetLang( LanguageType& nType, USHORT nPrio ) +//const char* ResMgr::GetLang( LanguageType& nType, sal_uInt16 nPrio ) // ResMgr::CreateResMgr( CREATEVERSIONRESMGR( stt ) // ResMgr *pRes = new ResMgr( "testtool.res" ); @@ -406,7 +406,7 @@ void BasicApp::SetFocus() IMPL_LINK( BasicApp, LateInit, void *, pDummy ) { (void) pDummy; /* avoid warning about unused parameter */ - USHORT i; + sal_uInt16 i; for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) { if ( Application::GetCommandLineParam( i ).Copy(0,4).CompareIgnoreCaseToAscii("-run") == COMPARE_EQUAL @@ -414,7 +414,7 @@ IMPL_LINK( BasicApp, LateInit, void *, pDummy ) || Application::GetCommandLineParam( i ).Copy(0,4).CompareIgnoreCaseToAscii("/run") == COMPARE_EQUAL #endif ) - pFrame->SetAutoRun( TRUE ); + pFrame->SetAutoRun( sal_True ); else if ( Application::GetCommandLineParam( i ).Copy(0,7).CompareIgnoreCaseToAscii("-result") == COMPARE_EQUAL #ifndef UNX || Application::GetCommandLineParam( i ).Copy(0,7).CompareIgnoreCaseToAscii("/result") == COMPARE_EQUAL @@ -425,7 +425,7 @@ IMPL_LINK( BasicApp, LateInit, void *, pDummy ) { if ( ByteString( Application::GetCommandLineParam( i+1 ), osl_getThreadTextEncoding() ).IsNumericAscii() ) { - MsgEdit::SetMaxLogLen( sal::static_int_cast< USHORT >( Application::GetCommandLineParam( i+1 ).ToInt32() ) ); + MsgEdit::SetMaxLogLen( sal::static_int_cast< sal_uInt16 >( Application::GetCommandLineParam( i+1 ).ToInt32() ) ); } i++; } @@ -497,7 +497,7 @@ FloatingExecutionStatus::FloatingExecutionStatus( Window * pParent ) void FloatingExecutionStatus::SetStatus( String aW ) { - Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); ToTop( TOTOP_NOGRABFOCUS ); aAusblend.Start(); aStatus.SetText( aW ); @@ -505,7 +505,7 @@ void FloatingExecutionStatus::SetStatus( String aW ) void FloatingExecutionStatus::SetAdditionalInfo( String aF ) { - Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); ToTop( TOTOP_NOGRABFOCUS ); aAusblend.Start(); aAdditionalInfo.SetText( aF ); @@ -524,11 +524,11 @@ TYPEINIT1(TTExecutionStatusHint, SfxSimpleHint); BasicFrame::BasicFrame() : WorkWindow( NULL, WinBits( WB_APP | WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ) -, bIsAutoRun( FALSE ) +, bIsAutoRun( sal_False ) , pDisplayHidDlg( NULL ) , pEditVar ( 0 ) -, bAutoReload( FALSE ) -, bAutoSave( TRUE ) +, bAutoReload( sal_False ) +, bAutoSave( sal_True ) , pBasic( NULL ) , pExecutionStatus( NULL ) , pStatus( NULL ) @@ -538,10 +538,10 @@ BasicFrame::BasicFrame() : WorkWindow( NULL, { Application::SetDefDialogParent( this ); - AlwaysEnableInput( TRUE ); + AlwaysEnableInput( sal_True ); pBasic = TTBasic::CreateMyBasic(); // depending on what was linked to the executable - bInBreak = FALSE; - bDisas = FALSE; + bInBreak = sal_False; + bDisas = sal_False; nFlags = 0; // Icon aAppIcon; @@ -653,11 +653,11 @@ BasicFrame::BasicFrame() : WorkWindow( NULL, } const ByteString ProfilePrefix("_profile_"); -const USHORT ProfilePrefixLen = ProfilePrefix.Len(); +const sal_uInt16 ProfilePrefixLen = ProfilePrefix.Len(); void BasicFrame::LoadIniFile() { - USHORT i; + sal_uInt16 i; Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); for ( i = 0 ; i < aConf.GetGroupCount() ; i++ ) @@ -777,12 +777,12 @@ IMPL_LINK( BasicFrame, CheckAllFiles, Timer*, pTimer ) return 0; } -BOOL BasicFrame::IsAutoRun() +sal_Bool BasicFrame::IsAutoRun() { return bIsAutoRun; } -void BasicFrame::SetAutoRun( BOOL bAuto ) +void BasicFrame::SetAutoRun( sal_Bool bAuto ) { bIsAutoRun = bAuto; } @@ -849,7 +849,7 @@ void BasicFrame::Resize() // Resize possibly maximized window - ULONG i; + sal_uIntPtr i; for( i = pList->Count(); i > 0 ; i-- ) { if ( pList->GetObject( i-1 )->GetWinState() == TT_WIN_STATE_MAX ) @@ -877,7 +877,7 @@ IMPL_LINK( BasicFrame, CloseButtonClick, void*, EMPTYARG ) {}; if ( p ) p->GrabFocus(); - return Command( RID_FILECLOSE, FALSE ); + return Command( RID_FILECLOSE, sal_False ); } IMPL_LINK( BasicFrame, FloatButtonClick, void*, EMPTYARG ) @@ -906,7 +906,7 @@ void BasicFrame::WinShow_Hide() return; AppWin* p; - BOOL bWasFullscreen = FALSE; + sal_Bool bWasFullscreen = sal_False; for ( p = pList->Last() ; p ; p = pList->Prev() ) { if ( p->pDataEdit ) @@ -916,7 +916,7 @@ void BasicFrame::WinShow_Hide() ) p->Hide( SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); else - p->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + p->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } bWasFullscreen |= p->GetWinState() == TT_WIN_STATE_MAX; } @@ -926,10 +926,10 @@ void BasicFrame::WinMax_Restore() { // The application buttons AppWin* p; - BOOL bHasFullscreenWin = FALSE; + sal_Bool bHasFullscreenWin = sal_False; for( p = pList->First(); p && !bHasFullscreenWin ; p = pList->Next() ) bHasFullscreenWin |= ( p->GetWinState() == TT_WIN_STATE_MAX ); - GetMenuBar()->ShowButtons( bHasFullscreenWin, FALSE, FALSE ); + GetMenuBar()->ShowButtons( bHasFullscreenWin, sal_False, sal_False ); WinShow_Hide(); } @@ -948,9 +948,9 @@ void BasicFrame::RemoveWindow( AppWin *pWin ) Menu* pMenu = GetMenuBar(); if( pList->Count() == 0 ) { - pMenu->EnableItem( RID_APPEDIT, FALSE ); - pMenu->EnableItem( RID_APPRUN, FALSE ); - pMenu->EnableItem( RID_APPWINDOW, FALSE ); + pMenu->EnableItem( RID_APPEDIT, sal_False ); + pMenu->EnableItem( RID_APPRUN, sal_False ); + pMenu->EnableItem( RID_APPWINDOW, sal_False ); } PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); @@ -974,20 +974,20 @@ void BasicFrame::AddWindow( AppWin *pWin ) // Enable main menu MenuBar* pMenu = GetMenuBar(); if( pList->Count() > 0 ) { - pMenu->EnableItem( RID_APPEDIT, TRUE ); - pMenu->EnableItem( RID_APPRUN, TRUE ); - pMenu->EnableItem( RID_APPWINDOW, TRUE ); + pMenu->EnableItem( RID_APPEDIT, sal_True ); + pMenu->EnableItem( RID_APPRUN, sal_True ); + pMenu->EnableItem( RID_APPWINDOW, sal_True ); } PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); - USHORT nLastID = pWinMenu->GetItemId( pWinMenu->GetItemCount() - 1 ); + sal_uInt16 nLastID = pWinMenu->GetItemId( pWinMenu->GetItemCount() - 1 ); // Separator necessary if ( nLastID < RID_WIN_FILE1 && pWinMenu->GetItemType( pWinMenu->GetItemCount() - 1 ) != MENUITEM_SEPARATOR ) pWinMenu->InsertSeparator(); // Find free ID - USHORT nFreeID = RID_WIN_FILE1; + sal_uInt16 nFreeID = RID_WIN_FILE1; while ( pWinMenu->GetItemPos( nFreeID ) != MENU_ITEM_NOTFOUND && nFreeID < RID_WIN_FILEn ) nFreeID++; @@ -1013,7 +1013,7 @@ void BasicFrame::FocusWindow( AppWin *pWin ) pWork = pWin; pList->Remove( pWin ); pList->Insert( pWin, LIST_APPEND ); - pWin->Minimize( FALSE ); + pWin->Minimize( sal_False ); aAppFile = pWin->GetText(); UpdateTitle(); @@ -1022,14 +1022,14 @@ void BasicFrame::FocusWindow( AppWin *pWin ) pStatus->LoadTaskToolBox(); } -BOOL BasicFrame::Close() +sal_Bool BasicFrame::Close() { if( bInBreak || Basic().IsRunning() ) if( RET_NO == QueryBox( this, SttResId( IDS_RUNNING ) ).Execute() ) - return FALSE; + return sal_False; StarBASIC::Stop(); - bInBreak = FALSE; + bInBreak = sal_False; if( CloseAll() ) { aLineNum.Stop(); @@ -1043,30 +1043,30 @@ BOOL BasicFrame::Close() Application::SetDefDialogParent( NULL ); WorkWindow::Close(); - return TRUE; - } else return FALSE; + return sal_True; + } else return sal_False; } -BOOL BasicFrame::CloseAll() +sal_Bool BasicFrame::CloseAll() { while ( pList->Count() ) if ( !pList->Last()->Close() ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL BasicFrame::CompileAll() +sal_Bool BasicFrame::CompileAll() { AppWin* p; for( p = pList->First(); p; p = pList->Next() ) - if( p->ISA(AppBasEd) && !((AppBasEd*)p)->Compile() ) return FALSE; - return TRUE; + if( p->ISA(AppBasEd) && !((AppBasEd*)p)->Compile() ) return sal_False; + return sal_True; } // Setup menu #define MENU2FILENAME( Name ) Name.Copy( Name.SearchAscii(" ") +1).EraseAllChars( '~' ) #define LRUNr( nNr ) CByteString("LRU").Append( ByteString::CreateFromInt32( nNr ) ) -String FILENAME2MENU( USHORT nNr, String aName ) +String FILENAME2MENU( sal_uInt16 nNr, String aName ) { String aRet; if ( nNr <= 9 ) @@ -1085,9 +1085,9 @@ void BasicFrame::AddToLRU(String const& aFile) PopupMenu *pPopup = GetMenuBar()->GetPopupMenu(RID_APPFILE); aConfig.SetGroup("LRU"); - USHORT nMaxLRU = (USHORT)aConfig.ReadKey("MaxLRU","4").ToInt32(); + sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").ToInt32(); DirEntry aFileEntry( aFile ); - USHORT i,nLastMove = nMaxLRU; + sal_uInt16 i,nLastMove = nMaxLRU; for ( i = 1 ; i<nMaxLRU && nLastMove == nMaxLRU ; i++ ) { @@ -1119,15 +1119,15 @@ void BasicFrame::LoadLRU() { Config aConfig(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); PopupMenu *pPopup = GetMenuBar()->GetPopupMenu(RID_APPFILE); - BOOL bAddSep = TRUE; + sal_Bool bAddSep = sal_True; aConfig.SetGroup("LRU"); - USHORT nMaxLRU = (USHORT)aConfig.ReadKey("MaxLRU","4").ToInt32(); + sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").ToInt32(); if ( pPopup ) bAddSep = pPopup->GetItemPos( IDM_FILE_LRU1 ) == MENU_ITEM_NOTFOUND; - USHORT i; + sal_uInt16 i; for ( i = 1; i <= nMaxLRU && pPopup != NULL; i++) { String aFile = UniString( aConfig.ReadKey(LRUNr(i)), RTL_TEXTENCODING_UTF8 ); @@ -1137,7 +1137,7 @@ void BasicFrame::LoadLRU() if (bAddSep) { pPopup->InsertSeparator(); - bAddSep = FALSE; + bAddSep = sal_False; } if ( pPopup->GetItemPos( IDM_FILE_LRU1 + i-1 ) == MENU_ITEM_NOTFOUND ) @@ -1156,10 +1156,10 @@ void BasicFrame::LoadLRU() IMPL_LINK( BasicFrame, InitMenu, Menu *, pMenu ) { - BOOL bNormal = BOOL( !bInBreak ); + sal_Bool bNormal = sal_Bool( !bInBreak ); pMenu->EnableItem( RID_RUNCOMPILE, bNormal ); - BOOL bHasEdit = BOOL( /*bNormal &&*/ pWork != NULL ); + sal_Bool bHasEdit = sal_Bool( /*bNormal &&*/ pWork != NULL ); // pMenu->EnableItem( RID_FILENEW, bNormal ); // always possible // pMenu->EnableItem( RID_FILEOPEN, bNormal ); @@ -1171,16 +1171,16 @@ IMPL_LINK( BasicFrame, InitMenu, Menu *, pMenu ) pMenu->EnableItem( RID_FILELOADLIB, bNormal ); pMenu->EnableItem( RID_FILESAVELIB, bHasEdit ); - BOOL bHasErr = BOOL( bNormal && pBasic->GetErrors() != 0 ); - BOOL bNext = bHasErr & bNormal; - BOOL bPrev = bHasErr & bNormal; + sal_Bool bHasErr = sal_Bool( bNormal && pBasic->GetErrors() != 0 ); + sal_Bool bNext = bHasErr & bNormal; + sal_Bool bPrev = bHasErr & bNormal; if( bHasErr ) { - ULONG n = pBasic->aErrors.GetCurPos(); + sal_uIntPtr n = pBasic->aErrors.GetCurPos(); if( n == 0 ) - bPrev = FALSE; - if( USHORT(n+1) == pBasic->GetErrors() ) - bNext = FALSE; + bPrev = sal_False; + if( sal_uInt16(n+1) == pBasic->GetErrors() ) + bNext = sal_False; } pMenu->EnableItem( RID_RUNNEXTERR, bNext ); pMenu->EnableItem( RID_RUNPREVERR, bPrev ); @@ -1188,7 +1188,7 @@ IMPL_LINK( BasicFrame, InitMenu, Menu *, pMenu ) if( pWork ) pWork->InitMenu( pMenu ); - return TRUE; + return sal_True; } IMPL_LINK_INLINE_START( BasicFrame, DeInitMenu, Menu *, pMenu ) @@ -1208,7 +1208,7 @@ IMPL_LINK_INLINE_START( BasicFrame, DeInitMenu, Menu *, pMenu ) pMenu->EnableItem( RID_RUNPREVERR ); if( pWork ) pWork->DeInitMenu( pMenu ); */ - SetAutoRun( FALSE ); + SetAutoRun( sal_False ); String aString; pStatus->Message( aString ); return 0L; @@ -1225,15 +1225,15 @@ IMPL_LINK_INLINE_END( BasicFrame, HighlightMenu, Menu *, pMenu ) IMPL_LINK_INLINE_START( BasicFrame, MenuCommand, Menu *, pMenu ) { - USHORT nId = pMenu->GetCurItemId(); - BOOL bChecked = pMenu->IsItemChecked( nId ); + sal_uInt16 nId = pMenu->GetCurItemId(); + sal_Bool bChecked = pMenu->IsItemChecked( nId ); return Command( nId, bChecked ); } IMPL_LINK_INLINE_END( BasicFrame, MenuCommand, Menu *, pMenu ) IMPL_LINK_INLINE_START( BasicFrame, Accel, Accelerator*, pAcc ) { - SetAutoRun( FALSE ); + SetAutoRun( sal_False ); return Command( pAcc->GetCurItemId() ); } IMPL_LINK_INLINE_END( BasicFrame, Accel, Accelerator*, pAcc ) @@ -1298,14 +1298,14 @@ AppBasEd* BasicFrame::CreateModuleWin( SbModule* pMod ) return p; } -BOOL BasicFrame::LoadFile( String aFilename ) +sal_Bool BasicFrame::LoadFile( String aFilename ) { - BOOL bIsResult = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("RES") == COMPARE_EQUAL; - BOOL bIsBasic = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("BAS") == COMPARE_EQUAL; + sal_Bool bIsResult = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("RES") == COMPARE_EQUAL; + sal_Bool bIsBasic = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("BAS") == COMPARE_EQUAL; bIsBasic |= DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("INC") == COMPARE_EQUAL; AppWin* p; - BOOL bSuccess = TRUE; + sal_Bool bSuccess = sal_True; if ( bIsResult ) { p = new AppError( this, aFilename ); @@ -1332,7 +1332,7 @@ BOOL BasicFrame::LoadFile( String aFilename ) } // Execute command -long BasicFrame::Command( short nID, BOOL bChecked ) +long BasicFrame::Command( short nID, sal_Bool bChecked ) { BasicError* pErr; @@ -1346,7 +1346,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) case RID_FILEOPEN: { String s; - if( QueryFileName( s, FT_BASIC_SOURCE | FT_RESULT_FILE, FALSE ) ) { + if( QueryFileName( s, FT_BASIC_SOURCE | FT_RESULT_FILE, sal_False ) ) { AddToLRU( s ); LoadFile( s ); // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); @@ -1387,7 +1387,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) { SbModule *pModule = ((AppBasEd*)pWork)->GetModule(); #if OSL_DEBUG_LEVEL > 1 - USHORT x; + sal_uInt16 x; x = pWork->GetLineNr(); x = ((AppBasEd*)pWork)->GetModule()->GetBPCount(); if ( !x ) @@ -1395,7 +1395,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) x = pModule->GetBPCount(); #endif - for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + for ( sal_uInt16 nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) { SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); @@ -1417,7 +1417,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) else { AppWin *w = NULL; - for ( w = pList->Last() ; w ? !w->ISA(AppBasEd) : FALSE ; w = pList->Prev() ) ; + for ( w = pList->Last() ; w ? !w->ISA(AppBasEd) : sal_False ; w = pList->Prev() ) ; if ( w ) { p = ((AppBasEd*)w); @@ -1430,7 +1430,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) if( bInBreak ) // Reset the flag - bInBreak = FALSE; + bInBreak = sal_False; else { if( IsAutoSave() && !SaveAll() ) break; @@ -1439,12 +1439,12 @@ long BasicFrame::Command( short nID, BOOL bChecked ) pStatus->Message( aString ); if( p ) { - BasicDLL::SetDebugMode( TRUE ); + BasicDLL::SetDebugMode( sal_True ); Basic().ClearGlobalVars(); p->Run(); - BasicDLL::SetDebugMode( FALSE ); + BasicDLL::SetDebugMode( sal_False ); // If cancelled during Interactive=FALSE -// BasicDLL::EnableBreak( TRUE ); +// BasicDLL::EnableBreak( sal_True ); } }} } @@ -1459,7 +1459,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) } break; case RID_RUNDISAS: - bDisas = BOOL( !bChecked ); + bDisas = sal_Bool( !bChecked ); break; case RID_RUNBREAK: if ( Basic().IsRunning() && !bInBreak ) @@ -1470,7 +1470,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) break; case RID_RUNSTOP: Basic().Stop(); - bInBreak = FALSE; + bInBreak = sal_False; break; case RID_RUNNEXTERR: pErr = pBasic->aErrors.Next(); @@ -1494,7 +1494,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) case RID_WINTILE: { WindowArrange aArange; - for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < pList->Count() ; i++ ) { aArange.AddWindow( pList->GetObject( i ) ); pList->GetObject( i )->Restore(); @@ -1518,7 +1518,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) case RID_WINTILEHORZ: { WindowArrange aArange; - for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < pList->Count() ; i++ ) { aArange.AddWindow( pList->GetObject( i ) ); pList->GetObject( i )->Restore(); @@ -1546,7 +1546,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) //#define WINDOWARRANGE_CASCADE 4 { WindowArrange aArange; - for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < pList->Count() ; i++ ) { aArange.AddWindow( pList->GetObject( i ) ); pList->GetObject( i )->Restore(); @@ -1569,7 +1569,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) break; case RID_WINCASCADE: { - for ( USHORT i = 0 ; i < pList->Count() ; i++ ) + for ( sal_uInt16 i = 0 ; i < pList->Count() ; i++ ) { pList->GetObject( i )->Cascade( i ); } @@ -1631,22 +1631,22 @@ long BasicFrame::Command( short nID, BOOL bChecked ) // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPEDIT )); // So da Delete richtig ist } } - return TRUE; + return sal_True; } -BOOL BasicFrame::SaveAll() +sal_Bool BasicFrame::SaveAll() { AppWin* p, *q = pWork; for( p = pList->First(); p; p = pList->Next() ) { - USHORT nRes = p->QuerySave( QUERY_DISK_CHANGED ); + sal_uInt16 nRes = p->QuerySave( QUERY_DISK_CHANGED ); if( (( nRes == SAVE_RES_ERROR ) && QueryBox(this,SttResId(IDS_ASKSAVEERROR)).Execute() == RET_NO ) || ( nRes == SAVE_RES_CANCEL ) ) - return FALSE; + return sal_False; } if ( q ) q->ToTop(); - return TRUE; + return sal_True; } IMPL_LINK( BasicFrame, ModuleWinExists, String*, pFilename ) @@ -1687,7 +1687,7 @@ AppWin* BasicFrame::FindWin( const String& rName ) return NULL; } -AppWin* BasicFrame::FindWin( USHORT nWinId ) +AppWin* BasicFrame::FindWin( sal_uInt16 nWinId ) { AppWin* p; for( p = pList->First(); p; p = pList->Next() ) @@ -1714,10 +1714,10 @@ IMPL_LINK( BasicFrame, WriteString, String*, pString ) if ( pList->Last() ) { pList->Last()->pDataEdit->ReplaceSelected( *pString ); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } class NewFileDialog : public FileDialog @@ -1740,7 +1740,7 @@ void NewFileDialog::FilterSelect() return; // User decides after he has changed the path String aCurFilter = GetCurFilter(); - USHORT nFilterNr = 0; + sal_uInt16 nFilterNr = 0; while ( nFilterNr < GetFilterCount() && aCurFilter != GetFilterName( nFilterNr ) ) { nFilterNr++; @@ -1759,7 +1759,7 @@ void NewFileDialog::FilterSelect() short NewFileDialog::Execute() { - BOOL bRet = (BOOL)FileDialog::Execute(); + sal_Bool bRet = (sal_Bool)FileDialog::Execute(); if ( bRet ) { Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); @@ -1772,8 +1772,8 @@ short NewFileDialog::Execute() return bRet; } -BOOL BasicFrame::QueryFileName - (String& rName, FileType nFileType, BOOL bSave ) +sal_Bool BasicFrame::QueryFileName + (String& rName, FileType nFileType, sal_Bool bSave ) { NewFileDialog aDlg( this, bSave ? WinBits( WB_SAVEAS ) : WinBits( WB_OPEN ) ); @@ -1826,21 +1826,21 @@ BOOL BasicFrame::QueryFileName if ( rExtension == aDlg.GetFilterName( i ) ) rExtension = aDlg.GetFilterType( i ); */ - return TRUE; - } else return FALSE; + return sal_True; + } else return sal_False; } -USHORT BasicFrame::BreakHandler() +sal_uInt16 BasicFrame::BreakHandler() { - bInBreak = TRUE; + bInBreak = sal_True; // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); // MenuBar aBar( ResId( RID_APPMENUBAR ) ); -// aBar.EnableItem( RID_APPEDIT, FALSE ); +// aBar.EnableItem( RID_APPEDIT, sal_False ); SetAppMode( String( SttResId ( IDS_APPMODE_BREAK ) ) ); while( bInBreak ) GetpApp()->Yield(); SetAppMode( String( SttResId ( IDS_APPMODE_RUN ) ) ); -// aBar.EnableItem( RID_APPEDIT, TRUE ); +// aBar.EnableItem( RID_APPEDIT, sal_True ); // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); return nFlags; } @@ -1848,7 +1848,7 @@ USHORT BasicFrame::BreakHandler() void BasicFrame::LoadLibrary() { String s; - if( QueryFileName( s, FT_BASIC_LIBRARY, FALSE ) ) + if( QueryFileName( s, FT_BASIC_LIBRARY, sal_False ) ) { CloseAll(); SvFileStream aStrm( s, STREAM_STD_READ ); @@ -1858,7 +1858,7 @@ void BasicFrame::LoadLibrary() pBasic = pNew; // Show all contents if existing SbxArray* pMods = pBasic->GetModules(); - for( USHORT i = 0; i < pMods->Count(); i++ ) + for( sal_uInt16 i = 0; i < pMods->Count(); i++ ) { SbModule* pMod = (SbModule*) pMods->Get( i ); AppWin* p = new AppBasEd( this, pMod ); @@ -1876,7 +1876,7 @@ void BasicFrame::LoadLibrary() void BasicFrame::SaveLibrary() { String s; - if( QueryFileName( s, FT_BASIC_LIBRARY, TRUE ) ) + if( QueryFileName( s, FT_BASIC_LIBRARY, sal_True ) ) { SvFileStream aStrm( s, STREAM_STD_WRITE ); if( !Basic().Store( aStrm ) ) @@ -1890,8 +1890,8 @@ String BasicFrame::GenRealString( const String &aResString ) String aType,aValue,aResult(aResString); String aString; xub_StrLen nInsertPos = 0; - BOOL bFound; - bFound = FALSE; + sal_Bool bFound; + bFound = sal_False; while ( (nStart = aResult.Search(StartKenn,nStartPos)) != STRING_NOTFOUND && (nGleich = aResult.SearchAscii("=",nStart+StartKenn.Len())) != STRING_NOTFOUND && @@ -1911,7 +1911,7 @@ String BasicFrame::GenRealString( const String &aResString ) aString.Erase(); } // if ( Resource::GetResManager()->IsAvailable( ResId( aValue ) ) ) - aString = String( SttResId( (USHORT)(aValue.ToInt32()) ) ); + aString = String( SttResId( (sal_uInt16)(aValue.ToInt32()) ) ); // else { // DBG_ERROR( "Could not load resource!" ); @@ -1920,12 +1920,12 @@ String BasicFrame::GenRealString( const String &aResString ) nInsertPos = nStart; nStartPos = nStart; aResult.Erase( nStart, nEnd-nStart+1 ); - bFound = TRUE; + bFound = sal_True; } else if ( aType.Search(BaseArgKenn) == 0 ) // Starts with BaseArgKenn { // TODO: What the hell is that for?? - USHORT nArgNr = USHORT( aType.Copy( BaseArgKenn.Len() ).ToInt32() ); + sal_uInt16 nArgNr = sal_uInt16( aType.Copy( BaseArgKenn.Len() ).ToInt32() ); DBG_ASSERT( aString.Search( CUniString("($Arg").Append( String::CreateFromInt32(nArgNr) ).AppendAscii(")") ) != STRING_NOTFOUND, "Extra Argument given in String"); aString.SearchAndReplace( CUniString("($Arg").Append( String::CreateFromInt32(nArgNr) ).AppendAscii(")"), aValue ); nStartPos = nStart; diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx index cd76b6481def..5a501ec5efcf 100644 --- a/basic/source/app/app.hxx +++ b/basic/source/app/app.hxx @@ -67,7 +67,7 @@ public: void LoadIniFile(); void SetFocus(); - void Wait( BOOL ); + void Wait( sal_Bool ); DECL_LINK( LateInit, void * ); #ifdef DBG_UTIL @@ -76,7 +76,7 @@ public: }; -typedef USHORT FileType; +typedef sal_uInt16 FileType; #define FT_NO_FILE (FileType)0x00 // An error has occurred ... #define FT_BASIC_SOURCE (FileType)0x01 @@ -95,16 +95,16 @@ class BasicFrame : public WorkWindow, public SfxBroadcaster, public SfxListener using SystemWindow::Notify; using Window::Command; -virtual BOOL Close(); - BOOL CloseAll(); // Close all windows - BOOL CompileAll(); // Compile all texts +virtual sal_Bool Close(); + sal_Bool CloseAll(); // Close all windows + sal_Bool CompileAll(); // Compile all texts AutoTimer aLineNum; // Show the line numbers virtual void Resize(); virtual void Move(); virtual void GetFocus(); void LoadLibrary(); void SaveLibrary(); - BOOL bIsAutoRun; + sal_Bool bIsAutoRun; DisplayHidDlg* pDisplayHidDlg; // BreakPoint *pRunToCursorBP; @@ -114,8 +114,8 @@ virtual void GetFocus(); Timer aCheckFiles; // Checks the files for changes - BOOL bAutoReload; - BOOL bAutoSave; + sal_Bool bAutoReload; + sal_Bool bAutoSave; DECL_LINK( CheckAllFiles, Timer* ); MyBasicRef pBasic; // BASIC-Engine @@ -131,16 +131,16 @@ virtual void GetFocus(); FloatingExecutionStatus *pExecutionStatus; public: - BOOL IsAutoRun(); - void SetAutoRun( BOOL bAuto ); - BOOL bInBreak; // TRUE if in Break-Handler + sal_Bool IsAutoRun(); + void SetAutoRun( sal_Bool bAuto ); + sal_Bool bInBreak; // sal_True if in Break-Handler StatusLine* pStatus; // Status line EditList* pList; // List of edit windows AppWin* pWork; // Current edit window BasicPrinter* pPrn; // Printer - BOOL bDisas; // TRUE: disassemble - USHORT nFlags; // Debugging-Flags - USHORT nMaximizedWindows; // Number of maximized windows + sal_Bool bDisas; // sal_True: disassemble + sal_uInt16 nFlags; // Debugging-Flags + sal_uInt16 nMaximizedWindows; // Number of maximized windows void FocusWindow( AppWin *pWin ); void WinMax_Restore(); void WinShow_Hide(); @@ -162,25 +162,25 @@ public: MsgEdit* GetMsgTree( String aLogFileName ); DECL_LINK( Log, TTLogMsg * ); DECL_LINK( WinInfo, WinInfoRec * ); - BOOL LoadFile( String aFilename ); - long Command( short,BOOL=FALSE ); // Command handler + sal_Bool LoadFile( String aFilename ); + long Command( short,sal_Bool=sal_False ); // Command handler virtual void Command( const CommandEvent& rCEvt ); // Command handler - BOOL SaveAll(); // Save all windows - BOOL QueryFileName( String& rName, FileType nFileType, BOOL bSave ); // Query for filename + sal_Bool SaveAll(); // Save all windows + sal_Bool QueryFileName( String& rName, FileType nFileType, sal_Bool bSave ); // Query for filename DECL_LINK( ModuleWinExists, String* ); DECL_LINK( WriteString, String* ); AppBasEd* CreateModuleWin( SbModule* pMod ); AppBasEd* FindModuleWin( const String& ); AppError* FindErrorWin( const String& ); AppWin* FindWin( const String& ); - AppWin* FindWin( USHORT nWinId ); + AppWin* FindWin( sal_uInt16 nWinId ); AppWin* IsWinValid( AppWin* pMaybeWin ); - USHORT BreakHandler(); // Break-Handler-Callback + sal_uInt16 BreakHandler(); // Break-Handler-Callback void SetEditVar( SbxVariable *pVar ){ pEditVar = pVar;} SbxVariable* GetEditVar(){ return pEditVar;} - BOOL IsAutoReload() { return bAutoReload; } - BOOL IsAutoSave() { return bAutoSave; } + sal_Bool IsAutoReload() { return bAutoReload; } + sal_Bool IsAutoSave() { return bAutoSave; } void LoadIniFile(); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); diff --git a/basic/source/app/appbased.cxx b/basic/source/app/appbased.cxx index 847a2fde02ec..fd7637fe26bf 100644 --- a/basic/source/app/appbased.cxx +++ b/basic/source/app/appbased.cxx @@ -60,11 +60,11 @@ AppBasEd::AppBasEd( BasicFrame* pParent, SbModule* p ) pBreakpoints->Show(); - ((TextEdit*)pDataEdit)->GetTextEditImp().pTextView->SetAutoIndentMode( TRUE ); + ((TextEdit*)pDataEdit)->GetTextEditImp().pTextView->SetAutoIndentMode( sal_True ); ((TextEdit*)pDataEdit)->GetTextEditImp().pTextEngine->SetMaxTextLen( STRING_MAXLEN ); // ((TextEdit*)pDataEdit)->GetTextEditImp().pTextEngine->SetWordDelimiters( CUniString(" ,.;:(){}[]\"'+-*/<>^\\") ); - ((TextEdit*)pDataEdit)->GetTextEditImp().SyntaxHighlight( TRUE ); - ((TextEdit*)pDataEdit)->SaveAsUTF8( TRUE ); + ((TextEdit*)pDataEdit)->GetTextEditImp().SyntaxHighlight( sal_True ); + ((TextEdit*)pDataEdit)->SaveAsUTF8( sal_True ); String aEmpty; @@ -110,7 +110,7 @@ void AppBasEd::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* p = PTR_CAST(SfxSimpleHint,&rHint); if( p ) { - ULONG nHintId = p->GetId(); + sal_uIntPtr nHintId = p->GetId(); if( nHintId == SBX_HINT_LANGUAGE_EXTENSION_LOADED ) { ((TextEdit*)pDataEdit)->GetTextEditImp().InvalidateSyntaxHighlight(); @@ -126,8 +126,8 @@ FileType AppBasEd::GetFileType() IMPL_LINK_INLINE_START( AppBasEd, EditChange, void *, p ) { (void) p; /* avoid warning about unused parameter */ - bCompiled = FALSE; - return TRUE; + bCompiled = sal_False; + return sal_True; } IMPL_LINK_INLINE_END( AppBasEd, EditChange, void *, p ) @@ -135,16 +135,16 @@ IMPL_LINK_INLINE_END( AppBasEd, EditChange, void *, p ) long AppBasEd::InitMenu( Menu* pMenu ) { AppEdit::InitMenu (pMenu ); - BOOL bRunning = pFrame->Basic().IsRunning(); + sal_Bool bRunning = pFrame->Basic().IsRunning(); pMenu->EnableItem( RID_RUNCOMPILE, !bCompiled && !bRunning ); - return TRUE; + return sal_True; } long AppBasEd::DeInitMenu( Menu* pMenu ) { AppEdit::DeInitMenu (pMenu ); pMenu->EnableItem( RID_RUNCOMPILE ); - return TRUE; + return sal_True; } // Menu Handler @@ -186,13 +186,13 @@ void AppBasEd::PostLoad() pMod->SetName( GetText() ); pMod->Clear(); pMod->SetSource( pDataEdit->GetText() ); - bCompiled = FALSE; // because the code might have changed in the meantime + bCompiled = sal_False; // because the code might have changed in the meantime AppEdit::PostLoad(); pBreakpoints->LoadBreakpoints( GetText() ); } -USHORT AppBasEd::ImplSave() +sal_uInt16 AppBasEd::ImplSave() { pBreakpoints->SaveBreakpoints( GetText() ); return AppEdit::ImplSave(); @@ -208,7 +208,7 @@ void AppBasEd::Reload() // Reload source code file after change void AppBasEd::LoadSource() { - BOOL bErr; + sal_Bool bErr; // if( pDataEdit->GetText().Len() != 0 ) return; String aName = pMod->GetName(); @@ -218,7 +218,7 @@ void AppBasEd::LoadSource() ErrorBox( this, SttResId( IDS_READERROR ) ).Execute(); else UpdateFileInfo( HAS_BEEN_LOADED ); - bCompiled = FALSE; // because the code might have changed in the meantime + bCompiled = sal_False; // because the code might have changed in the meantime } // Save as (new name) @@ -229,15 +229,15 @@ void AppBasEd::PostSaveAs() } // Compile -BOOL AppBasEd::Compile() +sal_Bool AppBasEd::Compile() { if( !pDataEdit->HasText() || bCompiled ) - return TRUE; + return sal_True; pMod->SetSource( pDataEdit->GetText() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if( pFrame->Basic().Compile( pMod ) ) { - bRes = TRUE; + bRes = sal_True; if( pFrame->bDisas ) Disassemble(); TextSelection aSel( pDataEdit->GetSelection() ); @@ -267,7 +267,7 @@ void AppBasEd::Run() { pFrame->Basic().Reset(); SbxArray* pAllModules = pFrame->Basic().GetModules(); - for (USHORT i = 0; i < pAllModules->Count(); i++) + for (sal_uInt16 i = 0; i < pAllModules->Count(); i++) { if ( (pAllModules->Get(i)->GetName()).Copy(0,2).CompareToAscii( "--" ) == COMPARE_EQUAL ) { diff --git a/basic/source/app/appbased.hxx b/basic/source/app/appbased.hxx index 339f0c1a3d18..ccda8ce68c69 100644 --- a/basic/source/app/appbased.hxx +++ b/basic/source/app/appbased.hxx @@ -43,12 +43,12 @@ class AppBasEd : public AppEdit { // Editor-Window: using DockingWindow::Notify; SbModuleRef pMod; // compile module - BOOL bCompiled; // TRUE if compiled + sal_Bool bCompiled; // sal_True if compiled protected: DECL_LINK( EditChange, void * ); #define BREAKPOINTSWIDTH 15 BreakpointWindow *pBreakpoints; - virtual USHORT ImplSave(); // Save file + virtual sal_uInt16 ImplSave(); // Save file public: TYPEINFO(); @@ -64,7 +64,7 @@ public: virtual void PostSaveAs(); // Postprocess of module... void Reload(); void LoadSource(); // Load source for object - BOOL Compile(); // Compile text + sal_Bool Compile(); // Compile text void Run(); // Run image void Disassemble(); // Disassemble image const String& GetModName() const { return pMod->GetName(); } diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx index d5769f3acb31..9aa06ffad38e 100644 --- a/basic/source/app/appedit.cxx +++ b/basic/source/app/appedit.cxx @@ -83,8 +83,8 @@ AppEdit::~AppEdit() void AppEdit::LoadIniFile() { TextView *pTextView = ((TextEdit*)pDataEdit)->aEdit.pTextView; - BOOL bWasModified = pTextView->GetTextEngine()->IsModified(); - pTextView->GetTextEngine()->SetModified( FALSE ); + sal_Bool bWasModified = pTextView->GetTextEngine()->IsModified(); + pTextView->GetTextEngine()->SetModified( sal_False ); FontList aFontList( pFrame ); // Just some Window is needed Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); @@ -93,8 +93,8 @@ void AppEdit::LoadIniFile() String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 ); String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 ); Font aFont = aFontList.Get( aFontName, aFontStyle ); -// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT ); - ULONG nFontSize = aFontSize.ToInt32(); +// sal_uIntPtr nFontSize = aFontSize.GetValue( FUNIT_POINT ); + sal_uIntPtr nFontSize = aFontSize.ToInt32(); // aFont.SetSize( Size( nFontSize, nFontSize ) ); aFont.SetHeight( nFontSize ); @@ -103,7 +103,7 @@ void AppEdit::LoadIniFile() Font aFont2( OutputDevice::GetDefaultFont( DEFAULTFONT_FIXED, Application::GetSettings().GetUILanguage(), 0, pFrame )); } #endif - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); // aFont.SetAlign( ALIGN_BOTTOM ); // aFont.SetHeight( aFont.GetHeight()+2 ); pDataEdit->SetFont( aFont ); @@ -184,7 +184,7 @@ void AppEdit::SetScrollBarRanges() -USHORT AppEdit::GetLineNr() +sal_uInt16 AppEdit::GetLineNr() { return pDataEdit->GetLineNr(); } @@ -201,14 +201,14 @@ long AppEdit::InitMenu( Menu* pMenu ) if( pDataEdit ) { - USHORT UndoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetUndoActionCount(); - USHORT RedoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetRedoActionCount(); + size_t UndoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetUndoActionCount(); + size_t RedoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetRedoActionCount(); pMenu->EnableItem( RID_EDITUNDO, UndoCount > 0 ); pMenu->EnableItem( RID_EDITREDO, RedoCount > 0 ); } - return TRUE; + return sal_True; } long AppEdit::DeInitMenu( Menu* pMenu ) @@ -218,7 +218,7 @@ long AppEdit::DeInitMenu( Menu* pMenu ) pMenu->EnableItem( RID_EDITUNDO ); pMenu->EnableItem( RID_EDITREDO ); - return TRUE; + return sal_True; } void AppEdit::Resize() @@ -233,7 +233,7 @@ void AppEdit::Resize() if ( pHScroll ) { rHSize = pHScroll->GetSizePixel(); - ULONG nHieght = rHSize.Height(); + sal_uIntPtr nHieght = rHSize.Height(); rNewSize.Height() -= nHieght; rHStart.Y() = rNewSize.Height(); } @@ -241,7 +241,7 @@ void AppEdit::Resize() if ( pVScroll ) { rVSize = pVScroll->GetSizePixel(); - ULONG nWidth = rVSize.Width(); + sal_uIntPtr nWidth = rVSize.Width(); rNewSize.Width() -= nWidth; rVStart.X() = rNewSize.Width(); } @@ -293,7 +293,7 @@ void AppEdit::PostSaveAs() { } -void AppEdit::Highlight( USHORT nLine, USHORT nCol1, USHORT nCol2 ) +void AppEdit::Highlight( sal_uInt16 nLine, sal_uInt16 nCol1, sal_uInt16 nCol2 ) { ((TextEdit*)pDataEdit)->Highlight( nLine, nCol1, nCol2 ); ToTop(); diff --git a/basic/source/app/appedit.hxx b/basic/source/app/appedit.hxx index 4a003bd0482d..b2c71c09c454 100644 --- a/basic/source/app/appedit.hxx +++ b/basic/source/app/appedit.hxx @@ -44,7 +44,7 @@ public: ScrollBar *pVScroll; ScrollBar *pHScroll; void SetScrollBarRanges(); - ULONG nCurTextWidth; + sal_uIntPtr nCurTextWidth; private: void InitScrollBars(); protected: @@ -53,7 +53,7 @@ public: TYPEINFO(); AppEdit( BasicFrame* ); ~AppEdit(); - USHORT GetLineNr(); // Current line number + sal_uInt16 GetLineNr(); // Current line number FileType GetFileType(); // Returns the file type virtual long InitMenu( Menu* ); // Inits the menu virtual long DeInitMenu( Menu* ); // Reset to enable all Shortcuts @@ -62,8 +62,8 @@ public: void PostLoad(); void PostSaveAs(); void Mark( short, short, short ); // Select text - void Highlight( USHORT nLine, USHORT nCol1, USHORT nCol2 ); - virtual BOOL ReloadAllowed(){ return !StarBASIC::IsRunning(); } + void Highlight( sal_uInt16 nLine, sal_uInt16 nCol1, sal_uInt16 nCol2 ); + virtual sal_Bool ReloadAllowed(){ return !StarBASIC::IsRunning(); } virtual void LoadIniFile(); // (re)load ini file after change }; diff --git a/basic/source/app/apperror.cxx b/basic/source/app/apperror.cxx index 001c77a38146..03c8aebd0bbe 100644 --- a/basic/source/app/apperror.cxx +++ b/basic/source/app/apperror.cxx @@ -65,10 +65,10 @@ long AppError::InitMenu( Menu* pMenu ) { AppWin::InitMenu (pMenu ); - pMenu->EnableItem( RID_EDITUNDO, FALSE ); - pMenu->EnableItem( RID_EDITREDO, FALSE ); + pMenu->EnableItem( RID_EDITUNDO, sal_False ); + pMenu->EnableItem( RID_EDITREDO, sal_False ); - return TRUE; + return sal_True; } long AppError::DeInitMenu( Menu* pMenu ) @@ -78,10 +78,10 @@ long AppError::DeInitMenu( Menu* pMenu ) pMenu->EnableItem( RID_EDITUNDO ); pMenu->EnableItem( RID_EDITREDO ); - return TRUE; + return sal_True; } -USHORT AppError::GetLineNr(){ return pDataEdit->GetLineNr(); } +sal_uInt16 AppError::GetLineNr(){ return pDataEdit->GetLineNr(); } FileType AppError::GetFileType() { @@ -103,12 +103,12 @@ void AppError::LoadIniFile() String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 ); String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 ); Font aFont = aFontList.Get( aFontName, aFontStyle ); -// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT ); - ULONG nFontSize = aFontSize.ToInt32(); +// sal_uIntPtr nFontSize = aFontSize.GetValue( FUNIT_POINT ); + sal_uIntPtr nFontSize = aFontSize.ToInt32(); // aFont.SetSize( Size( nFontSize, nFontSize ) ); aFont.SetHeight( nFontSize ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); // aFont.SetAlign( ALIGN_BOTTOM ); // aFont.SetHeight( aFont.GetHeight()+2 ); pDataEdit->SetFont( aFont ); diff --git a/basic/source/app/apperror.hxx b/basic/source/app/apperror.hxx index c5be8836efd9..3a7028aeae4b 100644 --- a/basic/source/app/apperror.hxx +++ b/basic/source/app/apperror.hxx @@ -39,10 +39,10 @@ public: // long Command( short nID ); virtual long InitMenu( Menu* ); virtual long DeInitMenu( Menu* ); - USHORT GetLineNr(); + sal_uInt16 GetLineNr(); FileType GetFileType(); MsgEdit* GetMsgTree() { return ((MsgEdit*)pDataEdit); } - virtual BOOL ReloadAllowed(){ return !StarBASIC::IsRunning(); } + virtual sal_Bool ReloadAllowed(){ return !StarBASIC::IsRunning(); } virtual void LoadIniFile(); // (re)load ini file after change DirEntry aBaseDir; }; diff --git a/basic/source/app/appwin.cxx b/basic/source/app/appwin.cxx index b0a6c07ec956..4d0a5f95fca4 100644 --- a/basic/source/app/appwin.cxx +++ b/basic/source/app/appwin.cxx @@ -52,10 +52,10 @@ TYPEINIT0(AppWin); AppWin::AppWin( BasicFrame* pParent ) : DockingWindow( pParent, WB_SIZEMOVE | WB_CLOSEABLE | WB_PINABLE ) , nSkipReload(0) -, bHasFile( FALSE ) -, bReloadAborted( FALSE ) +, bHasFile( sal_False ) +, bReloadAborted( sal_False ) , pFrame( pParent ) -, bFind( TRUE ) +, bFind( sal_True ) , pDataEdit(NULL) { // Load the Untitled string if not yet loaded @@ -64,7 +64,7 @@ AppWin::AppWin( BasicFrame* pParent ) nCount++; // Get maximized state from current window - USHORT nInitialWinState; + sal_uInt16 nInitialWinState; if ( pFrame->pWork ) { nInitialWinState = pFrame->pWork->GetWinState(); @@ -98,7 +98,7 @@ void AppWin::SetText( const XubString& rStr ) pFrame->WindowRenamed( this ); } -void AppWin::TitleButtonClick( USHORT nButton ) +void AppWin::TitleButtonClick( sal_uInt16 nButton ) { if ( TITLE_BUTTON_DOCKING == nButton ) if ( TT_WIN_STATE_MAX != nWinState ) @@ -106,7 +106,7 @@ void AppWin::TitleButtonClick( USHORT nButton ) else Restore(); else // if ( TITLE_BUTTON_HIDE == nButton ) - Minimize( TRUE ); + Minimize( sal_True ); } void AppWin::Maximize() @@ -116,7 +116,7 @@ void AppWin::Maximize() nNormalPos = GetPosPixel(); nNormalSize = GetSizePixel(); - SetFloatingMode( FALSE ); + SetFloatingMode( sal_False ); pFrame->nMaximizedWindows++; nWinState = TT_WIN_STATE_MAX; @@ -138,7 +138,7 @@ void AppWin::Maximize() void AppWin::Restore() { - SetFloatingMode( TRUE ); + SetFloatingMode( sal_True ); SetPosSizePixel( nNormalPos, nNormalSize ); if ( TT_WIN_STATE_MAX == nWinState ) @@ -148,7 +148,7 @@ void AppWin::Restore() pFrame->WinMax_Restore(); } -void AppWin::Minimize( BOOL bMinimize ) +void AppWin::Minimize( sal_Bool bMinimize ) { if ( bMinimize ) nWinState |= TT_WIN_STATE_HIDE; @@ -157,7 +157,7 @@ void AppWin::Minimize( BOOL bMinimize ) pFrame->WinMax_Restore(); } -void AppWin::Cascade( USHORT nNr ) +void AppWin::Cascade( sal_uInt16 nNr ) { Restore(); @@ -229,7 +229,7 @@ long AppWin::PreNotify( NotifyEvent& rNEvt ) if ( rNEvt.GetType() == EVENT_GETFOCUS ) if ( pFrame->pList->Last() != this ) Activate(); - return FALSE; // Der event soll weiter verarbeitet werden + return sal_False; // Der event soll weiter verarbeitet werden } void AppWin::Activate() @@ -242,14 +242,14 @@ long AppWin::InitMenu( Menu* pMenu ) { ::rtl::OUString aTemp; - BOOL bMarked; + sal_Bool bMarked; if( pDataEdit ) { TextSelection r = pDataEdit->GetSelection(); bMarked = r.HasRange(); } else - bMarked = FALSE; + bMarked = sal_False; pMenu->EnableItem( RID_EDITREPEAT, (aFind.Len() != 0 ) ); pMenu->EnableItem( RID_EDITCUT, bMarked ); pMenu->EnableItem( RID_EDITCOPY, bMarked ); @@ -257,20 +257,20 @@ long AppWin::InitMenu( Menu* pMenu ) pMenu->EnableItem( RID_EDITDEL, bMarked ); // pMenu->EnableItem( RID_HELPTOPIC, bMarked ); - BOOL bHasText; + sal_Bool bHasText; if( pDataEdit ) bHasText = pDataEdit->HasText(); else - bHasText = FALSE; - BOOL bRunning = pFrame->Basic().IsRunning(); - BOOL bCanExecute = BOOL( (!bRunning && bHasText) || pFrame->bInBreak ); + bHasText = sal_False; + sal_Bool bRunning = pFrame->Basic().IsRunning(); + sal_Bool bCanExecute = sal_Bool( (!bRunning && bHasText) || pFrame->bInBreak ); pMenu->EnableItem( RID_RUNSTART, bCanExecute ); pMenu->EnableItem( RID_RUNBREAK, bRunning && !pFrame->bInBreak); pMenu->EnableItem( RID_RUNSTOP, bRunning ); pMenu->EnableItem( RID_RUNTOCURSOR, bCanExecute ); pMenu->EnableItem( RID_RUNSTEPINTO, bCanExecute ); pMenu->EnableItem( RID_RUNSTEPOVER, bCanExecute ); - return TRUE; + return sal_True; } long AppWin::DeInitMenu( Menu* pMenu ) @@ -287,7 +287,7 @@ long AppWin::DeInitMenu( Menu* pMenu ) pMenu->EnableItem( RID_RUNTOCURSOR ); pMenu->EnableItem( RID_RUNSTEPINTO ); pMenu->EnableItem( RID_RUNSTEPOVER ); - return TRUE; + return sal_True; } // Menu Handler @@ -295,7 +295,7 @@ long AppWin::DeInitMenu( Menu* pMenu ) void AppWin::Command( const CommandEvent& rCEvt ) { TextSelection r = pDataEdit->GetSelection(); - BOOL bHasMark = r.HasRange(); + sal_Bool bHasMark = r.HasRange(); switch( rCEvt.GetCommand() ) { case RID_FILESAVE: QuerySave( QUERY_DISK_CHANGED | SAVE_NOT_DIRTY ); break; @@ -337,7 +337,7 @@ void AppWin::Command( const CommandEvent& rCEvt ) pDataEdit->BuildKontextMenu( pKontext ); if ( pKontext ) { - USHORT nRes = pKontext->Execute( this, GetPointerPosPixel() ); + sal_uInt16 nRes = pKontext->Execute( this, GetPointerPosPixel() ); if ( nRes ) pFrame->Command( nRes ); delete pKontext; @@ -348,12 +348,12 @@ void AppWin::Command( const CommandEvent& rCEvt ) } -BOOL AppWin::IsSkipReload() +sal_Bool AppWin::IsSkipReload() { return nSkipReload != 0; } -void AppWin::SkipReload( BOOL bSkip ) +void AppWin::SkipReload( sal_Bool bSkip ) { DBG_ASSERT( bSkip || nSkipReload, "SkipReload aufgehoben ohne es zu aktivieren"); if ( bSkip ) @@ -362,17 +362,17 @@ void AppWin::SkipReload( BOOL bSkip ) nSkipReload--; } -BOOL AppWin::DiskFileChanged( USHORT nWhat ) +sal_Bool AppWin::DiskFileChanged( sal_uInt16 nWhat ) { if ( !bHasFile ) - return FALSE; + return sal_False; switch ( nWhat ) { case SINCE_LAST_LOAD: { if ( bReloadAborted ) - return TRUE; + return sal_True; else return DiskFileChanged( SINCE_LAST_ASK_RELOAD ); } @@ -393,16 +393,16 @@ BOOL AppWin::DiskFileChanged( USHORT nWhat ) default: DBG_ERROR("Not Implemented in AppWin::DiskFileChanged"); } - return TRUE; + return sal_True; } -void AppWin::UpdateFileInfo( USHORT nWhat ) +void AppWin::UpdateFileInfo( sal_uInt16 nWhat ) { switch ( nWhat ) { case HAS_BEEN_LOADED: { - bReloadAborted = FALSE; + bReloadAborted = sal_False; UpdateFileInfo( ASKED_RELOAD ); } @@ -447,7 +447,7 @@ void AppWin::CheckReload() } else { - bReloadAborted = TRUE; + bReloadAborted = sal_True; } } } @@ -458,14 +458,14 @@ void AppWin::Reload() TextSelection aSelMemo = pDataEdit->GetSelection(); Load( GetText() ); pDataEdit->SetSelection( aSelMemo ); - SkipReload( FALSE ); + SkipReload( sal_False ); } // Load file -BOOL AppWin::Load( const String& aName ) +sal_Bool AppWin::Load( const String& aName ) { SkipReload(); - BOOL bErr; + sal_Bool bErr; // if( !QuerySave() ) // return; @@ -494,17 +494,17 @@ BOOL AppWin::Load( const String& aName ) SetText( aModName ); UpdateFileInfo( HAS_BEEN_LOADED ); PostLoad(); - bHasFile = TRUE; + bHasFile = sal_True; } - SkipReload( FALSE ); + SkipReload( sal_False ); return !bErr; } // Save file -USHORT AppWin::ImplSave() +sal_uInt16 AppWin::ImplSave() { SkipReload(); - USHORT nResult = SAVE_RES_NOT_SAVED; + sal_uInt16 nResult = SAVE_RES_NOT_SAVED; String s1 = *pNoName; String s2 = GetText().Copy( 0, s1.Len() ); if( s1 == s2 ) @@ -514,7 +514,7 @@ USHORT AppWin::ImplSave() if ( pDataEdit->Save( aName ) ) { nResult = SAVE_RES_SAVED; - bHasFile = TRUE; + bHasFile = sal_True; } else { @@ -523,38 +523,38 @@ USHORT AppWin::ImplSave() } UpdateFileInfo( HAS_BEEN_LOADED ); } - SkipReload( FALSE ); + SkipReload( sal_False ); return nResult; } // Save to new file name -USHORT AppWin::SaveAs() +sal_uInt16 AppWin::SaveAs() { SkipReload(); String s1 = *pNoName; String s2 = GetText().Copy( 0, s1.Len() ); if( s1 == s2 ) s2.Erase(); else s2 = GetText(); - if( pFrame->QueryFileName( s2, GetFileType(), TRUE ) ) + if( pFrame->QueryFileName( s2, GetFileType(), sal_True ) ) { SetText( s2 ); PostSaveAs(); - SkipReload( FALSE ); + SkipReload( sal_False ); return ImplSave(); } else { - SkipReload( FALSE ); + SkipReload( sal_False ); return SAVE_RES_CANCEL; } } // Should we save the file? -USHORT AppWin::QuerySave( QueryBits nBits ) +sal_uInt16 AppWin::QuerySave( QueryBits nBits ) { - BOOL bQueryDirty = ( nBits & QUERY_DIRTY ) != 0; - BOOL bQueryDiskChanged = ( nBits & QUERY_DISK_CHANGED ) != 0; - BOOL bSaveNotDirty = ( nBits & SAVE_NOT_DIRTY ) != 0; + sal_Bool bQueryDirty = ( nBits & QUERY_DIRTY ) != 0; + sal_Bool bQueryDiskChanged = ( nBits & QUERY_DISK_CHANGED ) != 0; + sal_Bool bSaveNotDirty = ( nBits & SAVE_NOT_DIRTY ) != 0; SkipReload(); short nResult; @@ -563,8 +563,8 @@ USHORT AppWin::QuerySave( QueryBits nBits ) else nResult = RET_NO; - BOOL bAlwaysEnableInput = pFrame->IsAlwaysEnableInput(); - pFrame->AlwaysEnableInput( FALSE ); + sal_Bool bAlwaysEnableInput = pFrame->IsAlwaysEnableInput(); + pFrame->AlwaysEnableInput( sal_False ); if( ( ( IsModified() || bSaveNotDirty ) && bQueryDirty ) || ( DiskFileChanged( SINCE_LAST_LOAD ) && bQueryDiskChanged ) ) { ToTop(); @@ -578,7 +578,7 @@ USHORT AppWin::QuerySave( QueryBits nBits ) } pFrame->AlwaysEnableInput( bAlwaysEnableInput ); - USHORT nReturn; + sal_uInt16 nReturn; switch( nResult ) { case RET_YES: @@ -594,11 +594,11 @@ USHORT AppWin::QuerySave( QueryBits nBits ) DBG_ERROR("switch default where no default should be: Internal error"); nReturn = SAVE_RES_CANCEL; } - SkipReload( FALSE ); + SkipReload( sal_False ); return nReturn; } -BOOL AppWin::Close() +sal_Bool AppWin::Close() { switch ( QuerySave( QUERY_DIRTY ) ) { @@ -607,21 +607,21 @@ BOOL AppWin::Close() { DockingWindow::Close(); delete this; - return TRUE; + return sal_True; } // uncomment to avoid compiler warning // break; case SAVE_RES_ERROR: - return FALSE; + return sal_False; // uncomment to avoid compiler warning // break; case SAVE_RES_CANCEL: - return FALSE; + return sal_False; // uncomment to avoid compiler warning // break; default: DBG_ERROR("Not Implemented in AppWin::Close"); - return FALSE; + return sal_False; } } @@ -631,7 +631,7 @@ void AppWin::Find() SttResId aResId( IDD_FIND_DIALOG ); FindDialog aDlg( this, aResId, aFind ); if( aDlg.Execute() ) { - bFind = TRUE; + bFind = sal_True; Repeat(); } } @@ -643,7 +643,7 @@ void AppWin::Replace() ReplaceDialog* pDlg = new ReplaceDialog (this, aResId, aFind, aReplace ); if( pDlg->Execute() ) { - bFind = FALSE; + bFind = sal_False; Repeat(); } } @@ -651,7 +651,7 @@ void AppWin::Replace() // Repeat search/replace operation void AppWin::Repeat() { - if( (aFind.Len() != 0 ) && ( pDataEdit->Find( aFind ) || (ErrorBox(this,SttResId(IDS_PATTERNNOTFOUND)).Execute() && FALSE) ) && !bFind ) + if( (aFind.Len() != 0 ) && ( pDataEdit->Find( aFind ) || (ErrorBox(this,SttResId(IDS_PATTERNNOTFOUND)).Execute() && sal_False) ) && !bFind ) pDataEdit->ReplaceSelected( aReplace ); } diff --git a/basic/source/app/appwin.hxx b/basic/source/app/appwin.hxx index 0e864e69eef9..928380d50df8 100644 --- a/basic/source/app/appwin.hxx +++ b/basic/source/app/appwin.hxx @@ -35,15 +35,15 @@ #include "app.hxx" #include "dataedit.hxx" -typedef USHORT QueryBits; +typedef sal_uInt16 QueryBits; #define QUERY_NONE ( QueryBits ( 0x00 ) ) #define QUERY_DIRTY ( QueryBits ( 0x01 ) ) #define QUERY_DISK_CHANGED ( QueryBits ( 0x02 ) ) #define QUERY_ALL ( QUERY_DIRTY | QUERY_DISK_CHANGED ) #define SAVE_NOT_DIRTY ( QueryBits ( 0x04 ) ) -#define SAVE_RES_SAVED TRUE -#define SAVE_RES_NOT_SAVED FALSE +#define SAVE_RES_SAVED sal_True +#define SAVE_RES_NOT_SAVED sal_False #define SAVE_RES_ERROR 3 #define SAVE_RES_CANCEL 4 @@ -69,68 +69,68 @@ protected: static short nCount; // number of edit windows static String *pNoName; // "Untitled" FileStat aLastAccess; // Last access time of loaded file - USHORT nSkipReload; // Sometimes there must not be a reload - BOOL bHasFile; // Otherwise reload does not make sense - BOOL bReloadAborted; // Is set if reload was cancelled so that we can ask again wehn closing + sal_uInt16 nSkipReload; // Sometimes there must not be a reload + sal_Bool bHasFile; // Otherwise reload does not make sense + sal_Bool bReloadAborted; // Is set if reload was cancelled so that we can ask again wehn closing short nId; // ID-Nummer( "Unnamed n" ) BasicFrame* pFrame; // Parent-Window // Icon* pIcon; // Document icon String aFind; // Search string String aReplace; // Replace string - BOOL bFind; // TRUE if search not replace + sal_Bool bFind; // sal_True if search not replace void RequestHelp( const HelpEvent& ); // Help handler void GetFocus(); // activate - virtual USHORT ImplSave(); // Save file - USHORT nWinState; // Maximized, Iconized or Normal + virtual sal_uInt16 ImplSave(); // Save file + sal_uInt16 nWinState; // Maximized, Iconized or Normal Point nNormalPos; // Position if normal Size nNormalSize; // Size if Normal virtual long PreNotify( NotifyEvent& rNEvt ); - USHORT nWinId; + sal_uInt16 nWinId; public: TYPEINFO(); AppWin( BasicFrame* ); ~AppWin(); DataEdit* pDataEdit; // Data area - virtual USHORT GetLineNr()=0; // Current line number + virtual sal_uInt16 GetLineNr()=0; // Current line number virtual long InitMenu( Menu* ); // Init of the menu virtual long DeInitMenu( Menu* ); // reset to enable all shortcuts virtual void Command( const CommandEvent& rCEvt ); // Command handler virtual void Resize(); virtual void Help(); - virtual BOOL Load( const String& ); // Load file + virtual sal_Bool Load( const String& ); // Load file virtual void PostLoad(){} // Set source at module - virtual USHORT SaveAs(); // Save file as + virtual sal_uInt16 SaveAs(); // Save file as virtual void PostSaveAs(){} virtual void Find(); // find text virtual void Replace(); // replace text virtual void Repeat(); // repeat find/replace - virtual BOOL Close(); // close window + virtual sal_Bool Close(); // close window virtual void Activate(); // window was activated virtual FileType GetFileType()=0; // returns the filetype - virtual BOOL ReloadAllowed(){ return TRUE; } + virtual sal_Bool ReloadAllowed(){ return sal_True; } virtual void Reload(); // Reload after change on disk virtual void LoadIniFile(){;} // (re)load ini file after change void CheckReload(); // Checks and asks if reload should performed - BOOL DiskFileChanged( USHORT nWhat ); // Checks file for changes - void UpdateFileInfo( USHORT nWhat ); // Remembers last file state - BOOL IsSkipReload(); // Should we test reload? - void SkipReload( BOOL bSkip = TRUE ); - USHORT GetWinState(){ return nWinState; } + sal_Bool DiskFileChanged( sal_uInt16 nWhat ); // Checks file for changes + void UpdateFileInfo( sal_uInt16 nWhat ); // Remembers last file state + sal_Bool IsSkipReload(); // Should we test reload? + void SkipReload( sal_Bool bSkip = sal_True ); + sal_uInt16 GetWinState(){ return nWinState; } void Maximize(); void Restore(); - void Minimize( BOOL bMinimize ); - void Cascade( USHORT nNr ); + void Minimize( sal_Bool bMinimize ); + void Cascade( sal_uInt16 nNr ); - USHORT QuerySave( QueryBits nBits = QUERY_ALL ); - BOOL IsModified() { return pDataEdit->IsModified(); } + sal_uInt16 QuerySave( QueryBits nBits = QUERY_ALL ); + sal_Bool IsModified() { return pDataEdit->IsModified(); } BasicFrame* GetBasicFrame() { return pFrame; } - virtual void TitleButtonClick( USHORT nButton ); + virtual void TitleButtonClick( sal_uInt16 nButton ); virtual void SetText( const XubString& rStr ); - USHORT GetWinId() { return nWinId; } - void SetWinId( USHORT nWId ) { nWinId = nWId; } + sal_uInt16 GetWinId() { return nWinId; } + void SetWinId( sal_uInt16 nWId ) { nWinId = nWId; } }; DECLARE_LIST( EditList, AppWin* ) diff --git a/basic/source/app/basicrt.cxx b/basic/source/app/basicrt.cxx index e6c9f550ad5b..2df8df0d53fe 100644 --- a/basic/source/app/basicrt.cxx +++ b/basic/source/app/basicrt.cxx @@ -63,7 +63,7 @@ xub_StrLen BasicRuntime::GetCol2() return pRun->nCol2; } -BOOL BasicRuntime::IsRun() +sal_Bool BasicRuntime::IsRun() { return pRun->IsRun(); } @@ -117,17 +117,17 @@ bool BasicRuntimeAccess::HasRuntime() return pINST && pINST->pRun != NULL; } -USHORT BasicRuntimeAccess::GetStackEntryCount() +sal_uInt16 BasicRuntimeAccess::GetStackEntryCount() { return GetSbData()->pErrStack->Count(); } -BasicErrorStackEntry BasicRuntimeAccess::GetStackEntry( USHORT nIndex ) +BasicErrorStackEntry BasicRuntimeAccess::GetStackEntry( sal_uInt16 nIndex ) { return BasicErrorStackEntry( GetSbData()->pErrStack->GetObject( nIndex ) ); } -BOOL BasicRuntimeAccess::HasStack() +sal_Bool BasicRuntimeAccess::HasStack() { return GetSbData()->pErrStack != NULL; } @@ -138,7 +138,7 @@ void BasicRuntimeAccess::DeleteStack() GetSbData()->pErrStack = NULL; } -BOOL BasicRuntimeAccess::IsRunInit() +sal_Bool BasicRuntimeAccess::IsRunInit() { return GetSbData()->bRunInit; } diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx index 7bafc87e548a..e7687222d5da 100644 --- a/basic/source/app/brkpnts.cxx +++ b/basic/source/app/brkpnts.cxx @@ -48,9 +48,9 @@ struct Breakpoint { - USHORT nLine; + sal_uInt16 nLine; - Breakpoint( USHORT nL ) { nLine = nL; } + Breakpoint( sal_uInt16 nL ) { nLine = nL; } }; @@ -62,7 +62,7 @@ BreakpointWindow::BreakpointWindow( Window *pParent ) , nCurYOffset( 0 ) , nMarkerPos( MARKER_NOMARKER ) , pModule( NULL ) -, bErrorMarker( FALSE ) +, bErrorMarker( sal_False ) { if ( !pImages ) pImages = new ImageList( SttResId( RID_IMGLST_LAYOUT ) ); @@ -90,7 +90,7 @@ void BreakpointWindow::Reset() void BreakpointWindow::SetModule( SbModule *pMod ) { pModule = pMod; - USHORT i; + sal_uInt16 i; for ( i=0 ; i < pModule->GetBPCount() ; i++ ) { InsertBreakpoint( pModule->GetBP( i ) ); @@ -106,13 +106,13 @@ void BreakpointWindow::SetBPsInModule() Breakpoint* pBrk = First(); while ( pBrk ) { - pModule->SetBP( (USHORT)pBrk->nLine ); + pModule->SetBP( (sal_uInt16)pBrk->nLine ); #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( (USHORT)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif pBrk = Next(); } - for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + for ( sal_uInt16 nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) { SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); @@ -121,7 +121,7 @@ void BreakpointWindow::SetBPsInModule() } -void BreakpointWindow::InsertBreakpoint( USHORT nLine ) +void BreakpointWindow::InsertBreakpoint( sal_uInt16 nLine ) { Breakpoint* pNewBrk = new Breakpoint( nLine ); Breakpoint* pBrk = First(); @@ -152,7 +152,7 @@ void BreakpointWindow::InsertBreakpoint( USHORT nLine ) #endif if ( StarBASIC::IsRunning() ) { - for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + for ( sal_uInt16 nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) { SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); @@ -166,7 +166,7 @@ void BreakpointWindow::InsertBreakpoint( USHORT nLine ) } -Breakpoint* BreakpointWindow::FindBreakpoint( ULONG nLine ) +Breakpoint* BreakpointWindow::FindBreakpoint( sal_uIntPtr nLine ) { Breakpoint* pBrk = First(); while ( pBrk ) @@ -181,20 +181,20 @@ Breakpoint* BreakpointWindow::FindBreakpoint( ULONG nLine ) } -void BreakpointWindow::AdjustBreakpoints( ULONG nLine, BOOL bInserted ) +void BreakpointWindow::AdjustBreakpoints( sal_uIntPtr nLine, sal_Bool bInserted ) { if ( nLine == 0 ) //TODO: nLine == TEXT_PARA_ALL+1 return; Breakpoint* pBrk = First(); while ( pBrk ) { - BOOL bDelBrk = FALSE; + sal_Bool bDelBrk = sal_False; if ( pBrk->nLine == nLine ) { if ( bInserted ) pBrk->nLine++; else - bDelBrk = TRUE; + bDelBrk = sal_True; } else if ( pBrk->nLine > nLine ) { @@ -206,7 +206,7 @@ void BreakpointWindow::AdjustBreakpoints( ULONG nLine, BOOL bInserted ) if ( bDelBrk ) { - ULONG n = GetCurPos(); + sal_uIntPtr n = GetCurPos(); delete Remove( pBrk ); pBrk = Seek( n ); } @@ -232,7 +232,7 @@ void BreakpointWindow::LoadBreakpoints( String aFilename ) for ( i = 0 ; i < aBreakpoints.GetTokenCount( ';' ) ; i++ ) { - InsertBreakpoint( (USHORT)aBreakpoints.GetToken( i, ';' ).ToInt32() ); + InsertBreakpoint( (sal_uInt16)aBreakpoints.GetToken( i, ';' ).ToInt32() ); } } @@ -280,12 +280,12 @@ void BreakpointWindow::Paint( const Rectangle& ) #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif - ULONG nLine = pBrk->nLine-1; - ULONG nY = nLine*nLineHeight - nCurYOffset; + sal_uIntPtr nLine = pBrk->nLine-1; + sal_uIntPtr nY = nLine*nLineHeight - nCurYOffset; DrawImage( Point( 0, nY ) + aBmpOff, aBrk ); pBrk = Next(); } - ShowMarker( TRUE ); + ShowMarker( sal_True ); } @@ -297,7 +297,7 @@ Breakpoint* BreakpointWindow::FindBreakpoint( const Point& rMousePos ) Breakpoint* pBrk = First(); while ( pBrk ) { - ULONG nLine = pBrk->nLine-1; + sal_uIntPtr nLine = pBrk->nLine-1; long nY = nLine*nLineHeight; if ( ( nYPos > nY ) && ( nYPos < ( nY + nLineHeight ) ) ) return pBrk; @@ -307,7 +307,7 @@ Breakpoint* BreakpointWindow::FindBreakpoint( const Point& rMousePos ) } -void BreakpointWindow::ToggleBreakpoint( USHORT nLine ) +void BreakpointWindow::ToggleBreakpoint( sal_uInt16 nLine ) { Breakpoint* pBrk = FindBreakpoint( nLine ); if ( pBrk ) // remove @@ -323,7 +323,7 @@ void BreakpointWindow::ToggleBreakpoint( USHORT nLine ) Invalidate(); } -void BreakpointWindow::ShowMarker( BOOL bShow ) +void BreakpointWindow::ShowMarker( sal_Bool bShow ) { if ( nMarkerPos == MARKER_NOMARKER ) return; @@ -343,7 +343,7 @@ void BreakpointWindow::ShowMarker( BOOL bShow ) aMarkerOff.X() = ( aOutSz.Width() - aMarkerSz.Width() ) / 2; aMarkerOff.Y() = ( nLineHeight - aMarkerSz.Height() ) / 2; - ULONG nY = nMarkerPos*nLineHeight - nCurYOffset; + sal_uIntPtr nY = nMarkerPos*nLineHeight - nCurYOffset; Point aPos( 0, nY ); aPos += aMarkerOff; if ( bShow ) @@ -361,23 +361,23 @@ void BreakpointWindow::MouseButtonDown( const MouseEvent& rMEvt ) long nLineHeight = GetTextHeight(); long nYPos = aMousePos.Y() + nCurYOffset; long nLine = nYPos / nLineHeight + 1; - ToggleBreakpoint( sal::static_int_cast< USHORT >(nLine) ); + ToggleBreakpoint( sal::static_int_cast< sal_uInt16 >(nLine) ); Invalidate(); } } -void BreakpointWindow::SetMarkerPos( USHORT nLine, BOOL bError ) +void BreakpointWindow::SetMarkerPos( sal_uInt16 nLine, sal_Bool bError ) { - ShowMarker( FALSE ); // Remove old one + ShowMarker( sal_False ); // Remove old one nMarkerPos = nLine; bErrorMarker = bError; - ShowMarker( TRUE ); // Draw new one + ShowMarker( sal_True ); // Draw new one Update(); } -void BreakpointWindow::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags ) +void BreakpointWindow::Scroll( long nHorzScroll, long nVertScroll, sal_uInt16 nFlags ) { (void) nFlags; /* avoid warning about unused parameter */ nCurYOffset -= nVertScroll; diff --git a/basic/source/app/brkpnts.hxx b/basic/source/app/brkpnts.hxx index 05a03666a71b..64d5c0a9d0d7 100644 --- a/basic/source/app/brkpnts.hxx +++ b/basic/source/app/brkpnts.hxx @@ -50,27 +50,27 @@ public: void SetModule( SbModule *pMod ); void SetBPsInModule(); - void InsertBreakpoint( USHORT nLine ); - void ToggleBreakpoint( USHORT nLine ); - void AdjustBreakpoints( ULONG nLine, BOOL bInserted ); + void InsertBreakpoint( sal_uInt16 nLine ); + void ToggleBreakpoint( sal_uInt16 nLine ); + void AdjustBreakpoints( sal_uIntPtr nLine, sal_Bool bInserted ); void LoadBreakpoints( String aFilename ); void SaveBreakpoints( String aFilename ); protected: - Breakpoint* FindBreakpoint( ULONG nLine ); + Breakpoint* FindBreakpoint( sal_uIntPtr nLine ); private: long nCurYOffset; - USHORT nMarkerPos; + sal_uInt16 nMarkerPos; SbModule* pModule; - BOOL bErrorMarker; + sal_Bool bErrorMarker; static ImageList *pImages; protected: virtual void Paint( const Rectangle& ); Breakpoint* FindBreakpoint( const Point& rMousePos ); - void ShowMarker( BOOL bShow ); + void ShowMarker( sal_Bool bShow ); virtual void MouseButtonDown( const MouseEvent& rMEvt ); public: @@ -78,10 +78,10 @@ public: // void SetModulWindow( ModulWindow* pWin ) // { pModulWindow = pWin; } - void SetMarkerPos( USHORT nLine, BOOL bErrorMarker = FALSE ); + void SetMarkerPos( sal_uInt16 nLine, sal_Bool bErrorMarker = sal_False ); virtual void Scroll( long nHorzScroll, long nVertScroll, - USHORT nFlags = 0 ); + sal_uInt16 nFlags = 0 ); long& GetCurYOffset() { return nCurYOffset; } }; diff --git a/basic/source/app/dataedit.hxx b/basic/source/app/dataedit.hxx index cbb114108c56..29148bc79919 100644 --- a/basic/source/app/dataedit.hxx +++ b/basic/source/app/dataedit.hxx @@ -41,9 +41,9 @@ class Font; #define DATA_FUNC_DEF( MemberName, MemberType ) \ public: \ MemberType MemberName; \ - BOOL Find( const String& rStr ); \ - BOOL Load( const String& rStr ); \ - BOOL Save( const String& rStr ); \ + sal_Bool Find( const String& rStr ); \ + sal_Bool Load( const String& rStr ); \ + sal_Bool Save( const String& rStr ); \ \ void GrabFocus(){ MemberName.GrabFocus(); } \ void Show(){ MemberName.Show(); } \ @@ -62,13 +62,13 @@ public: void Redo(); \ String GetText() const; \ void SetText( const String& rStr ); \ - BOOL HasText() const; \ + sal_Bool HasText() const; \ String GetSelected(); \ TextSelection GetSelection() const; \ void SetSelection( const TextSelection& rSelection ); \ - USHORT GetLineNr() const; \ + sal_uInt16 GetLineNr() const; \ void ReplaceSelected( const String& rStr ); \ - BOOL IsModified(); \ + sal_Bool IsModified(); \ void SetModifyHdl( Link l ); @@ -85,19 +85,19 @@ public: virtual void Undo()=0; virtual void Redo()=0; - virtual BOOL Find( const String& )=0; // Find and select text - virtual BOOL Load( const String& )=0; // Load text from file - virtual BOOL Save( const String& )=0; // Save text to file + virtual sal_Bool Find( const String& )=0; // Find and select text + virtual sal_Bool Load( const String& )=0; // Load text from file + virtual sal_Bool Save( const String& )=0; // Save text to file virtual String GetSelected()=0; virtual void GrabFocus()=0; virtual TextSelection GetSelection() const=0; virtual void SetSelection( const TextSelection& rSelection )=0; - virtual USHORT GetLineNr() const=0; + virtual sal_uInt16 GetLineNr() const=0; virtual String GetText() const=0; virtual void SetText( const String& rStr )=0; - virtual BOOL HasText() const=0; // to avoid GetText.Len() + virtual sal_Bool HasText() const=0; // to avoid GetText.Len() virtual void ReplaceSelected( const String& rStr )=0; - virtual BOOL IsModified()=0; + virtual sal_Bool IsModified()=0; virtual void SetModifyHdl( Link )=0; virtual void Show()=0; virtual void SetPosPixel( const Point& rNewPos )=0; diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx index c5abb472a0e4..85f09b6b6cd0 100644 --- a/basic/source/app/dialogs.cxx +++ b/basic/source/app/dialogs.cxx @@ -108,9 +108,9 @@ IMPL_LINK_INLINE_START( FindDialog, ButtonClick, Button *, pB ) { if( pB == &aOk ) { *pFind = aFind.GetText(); - EndDialog( TRUE ); - } else EndDialog( FALSE ); - return TRUE; + EndDialog( sal_True ); + } else EndDialog( sal_False ); + return sal_True; } IMPL_LINK_INLINE_END( FindDialog, ButtonClick, Button *, pB ) @@ -138,9 +138,9 @@ IMPL_LINK( ReplaceDialog, ButtonClick, Button *, pB ) if( pB == &aOk ) { *pFind = aFind.GetText(); *pReplace = aReplace.GetText(); - EndDialog( TRUE ); - } else EndDialog( FALSE ); - return TRUE; + EndDialog( sal_True ); + } else EndDialog( sal_False ); + return sal_True; } //////////////////////////////////////////////////////////////////// @@ -163,7 +163,7 @@ void ConfEdit::Init( Config &aConf ) aEdit.SetText( aTemp ); } -ConfEdit::ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf ) +ConfEdit::ConfEdit( Window* pParent, sal_uInt16 nResText, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, Config &aConf ) : PushButton( pParent, SttResId(nResButton) ) , aText( pParent, SttResId(nResText) ) , aEdit( pParent, SttResId(nResEdit) ) @@ -172,7 +172,7 @@ ConfEdit::ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nR Init( aConf ); } -ConfEdit::ConfEdit( Window* pParent, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf ) +ConfEdit::ConfEdit( Window* pParent, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, Config &aConf ) : PushButton( pParent, SttResId(nResButton) ) , aText( pParent ) , aEdit( pParent, SttResId(nResEdit) ) @@ -210,7 +210,7 @@ void ConfEdit::Click() } } -OptConfEdit::OptConfEdit( Window* pParent, USHORT nResCheck, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf ) +OptConfEdit::OptConfEdit( Window* pParent, sal_uInt16 nResCheck, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf ) : ConfEdit( pParent, nResEdit, nResButton, aKN, aConf ) , aCheck( pParent, SttResId( nResCheck ) ) , rBase( rBaseEdit ) @@ -260,7 +260,7 @@ OptionsDialog::OptionsDialog( Window* pParent, const ResId& aResId ) , aCancel( this ) , aConfig( Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ) ) { - aConfig.EnablePersistence( FALSE ); + aConfig.EnablePersistence( sal_False ); FreeResource(); aTabCtrl.SetActivatePageHdl( LINK( this, OptionsDialog, ActivatePageHdl ) ); aTabCtrl.SetCurPageId( RID_TP_PRO ); @@ -274,25 +274,25 @@ OptionsDialog::OptionsDialog( Window* pParent, const ResId& aResId ) OptionsDialog::~OptionsDialog() { - for ( USHORT i = 0; i < aTabCtrl.GetPageCount(); i++ ) + for ( sal_uInt16 i = 0; i < aTabCtrl.GetPageCount(); i++ ) delete aTabCtrl.GetTabPage( aTabCtrl.GetPageId( i ) ); }; -BOOL OptionsDialog::Close() +sal_Bool OptionsDialog::Close() { if ( TabDialog::Close() ) { delete this; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } IMPL_LINK( OptionsDialog, ActivatePageHdl, TabControl *, pTabCtrl ) { - USHORT nId = pTabCtrl->GetCurPageId(); + sal_uInt16 nId = pTabCtrl->GetCurPageId(); // If TabPage was not yet created, do it if ( !pTabCtrl->GetTabPage( nId ) ) { @@ -362,7 +362,7 @@ IMPL_LINK( OptionsDialog, OKClick, Button *, pButton ) } const ByteString ProfilePrefix("_profile_"); -const USHORT ProfilePrefixLen = ProfilePrefix.Len(); +const sal_uInt16 ProfilePrefixLen = ProfilePrefix.Len(); ProfileOptions::ProfileOptions( Window* pParent, Config &rConfig ) : TabPage( pParent, SttResId( RID_TP_PROFILE ) ) @@ -384,7 +384,7 @@ ProfileOptions::ProfileOptions( Window* pParent, Config &rConfig ) { FreeResource(); - aCbProfile.EnableAutocomplete( TRUE ); + aCbProfile.EnableAutocomplete( sal_True ); aCbProfile.SetSelectHdl( LINK( this, ProfileOptions, Select ) ); @@ -399,7 +399,7 @@ ProfileOptions::ProfileOptions( Window* pParent, Config &rConfig ) void ProfileOptions::LoadData() { // collect all profiles (all groups starting with the ProfilePrefix) - for ( USHORT i = 0 ; i < rConf.GetGroupCount() ; i++ ) + for ( sal_uInt16 i = 0 ; i < rConf.GetGroupCount() ; i++ ) { ByteString aProfile = rConf.GetGroupName( i ); if ( aProfile.Match( ProfilePrefix ) ) @@ -520,7 +520,7 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) { FreeResource(); - aNFCRPort.SetUseThousandSep( FALSE ); + aNFCRPort.SetUseThousandSep( sal_False ); ByteString aTemp; @@ -530,7 +530,7 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) if ( aTemp.EqualsIgnoreCaseAscii( "true" ) || aTemp.Equals( "1" ) ) aCBUseProxy.Check(); else - aCBUseProxy.Check( FALSE ); + aCBUseProxy.Check( sal_False ); aCBUseProxy.SetToggleHdl( LINK( this, CrashreportOptions, CheckProxy ) ); LINK( this, CrashreportOptions, CheckProxy ).Call( NULL ); // call once to initialize @@ -545,7 +545,7 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) if ( aTemp.EqualsIgnoreCaseAscii( "true" ) || aTemp.Equals( "1" ) ) aCBAllowContact.Check(); else - aCBAllowContact.Check( FALSE ); + aCBAllowContact.Check( sal_False ); aCBAllowContact.SetToggleHdl( LINK( this, CrashreportOptions, CheckResponse ) ); LINK( this, CrashreportOptions, CheckResponse ).Call( NULL ); // call once to initialize @@ -611,9 +611,9 @@ MiscOptions::MiscOptions( Window* pParent, Config &aConfig ) { FreeResource(); - aNFTTPort.SetUseThousandSep( FALSE ); - aNFUNOPort.SetUseThousandSep( FALSE ); - aTFMaxLRU.SetUseThousandSep( FALSE ); + aNFTTPort.SetUseThousandSep( sal_False ); + aNFUNOPort.SetUseThousandSep( sal_False ); + aTFMaxLRU.SetUseThousandSep( sal_False ); ByteString aTemp; @@ -661,8 +661,8 @@ void MiscOptions::Save( Config &aConfig ) aConfig.SetGroup("LRU"); ByteString aTemp = aConfig.ReadKey( "MaxLRU", "4" ); - USHORT nOldMaxLRU = (USHORT)aTemp.ToInt32(); - USHORT n; + sal_uInt16 nOldMaxLRU = (sal_uInt16)aTemp.ToInt32(); + sal_uInt16 n; for ( n = nOldMaxLRU ; n > aTFMaxLRU.GetValue() ; n-- ) aConfig.DeleteKey( ByteString("LRU").Append( ByteString::CreateFromInt32( n ) ) ); aConfig.WriteKey( "MaxLRU", ByteString::CreateFromInt64( aTFMaxLRU.GetValue() ) ); @@ -735,8 +735,8 @@ IMPL_LINK( FontOptions, FontSizeChanged, void*, EMPTYARG ) void FontOptions::UpdatePreview() { Font aFont = aFontList.Get( aFontName.GetText(), aFontStyle.GetText() ); -// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT ); - ULONG nFontSize = static_cast<ULONG>((aFontSize.GetValue() + 5) / 10); +// sal_uIntPtr nFontSize = aFontSize.GetValue( FUNIT_POINT ); + sal_uIntPtr nFontSize = static_cast<sal_uIntPtr>((aFontSize.GetValue() + 5) / 10); aFont.SetHeight( nFontSize ); aFTPreview.SetFont( aFont ); aFTPreview.SetText( aFontName.GetText() ); @@ -770,13 +770,13 @@ GenericOptions::GenericOptions( Window* pParent, Config &aConfig ) , aPbDelValue( this, SttResId( RID_PB_DEL_VALUE ) ) , nMoveButtons( 0 ) -, bShowSelectPath( FALSE ) +, bShowSelectPath( sal_False ) { FreeResource(); LoadData(); - aCbArea.EnableAutocomplete( TRUE ); - aCbValue.EnableAutocomplete( TRUE ); + aCbArea.EnableAutocomplete( sal_True ); + aCbValue.EnableAutocomplete( sal_True ); aCbArea.SetSelectHdl( LINK( this, GenericOptions, LoadGroup ) ); @@ -802,7 +802,7 @@ GenericOptions::~GenericOptions() StringList* GenericOptions::GetAllGroups() { StringList* pGroups = new StringList(); - for ( USHORT i = 0 ; i < aConf.GetGroupCount() ; i++ ) + for ( sal_uInt16 i = 0 ; i < aConf.GetGroupCount() ; i++ ) { String *pGroup = new String( aConf.GetGroupName( i ), RTL_TEXTENCODING_UTF8 ); pGroups->Insert( pGroup ); @@ -841,16 +841,16 @@ void GenericOptions::ShowSelectPath( const String aType ) { // Show Path button nMoveButtons += nDelta; aMoveTimer.Start(); - bShowSelectPath = TRUE; - aPbSelectPath.Show( TRUE ); - aPbSelectPath.Enable( TRUE ); + bShowSelectPath = sal_True; + aPbSelectPath.Show( sal_True ); + aPbSelectPath.Enable( sal_True ); } else if ( !aType.EqualsIgnoreCaseAscii( "PATH" ) && bShowSelectPath ) { // Hide Path button nMoveButtons -= nDelta; aMoveTimer.Start(); - bShowSelectPath = FALSE; - aPbSelectPath.Enable( FALSE ); + bShowSelectPath = sal_False; + aPbSelectPath.Enable( sal_False ); } } @@ -903,7 +903,7 @@ IMPL_LINK( GenericOptions, LoadGroup, ComboBox*, EMPTYARG ) aConf.SetGroup( aLastGroupName ); aConf.WriteKey( C_KEY_AKTUELL, ByteString( aCurrentValue, RTL_TEXTENCODING_UTF8 ) ); - USHORT i; + sal_uInt16 i; for ( i=0 ; i < aCbValue.GetEntryCount() ; i++ ) { if ( i > 0 ) @@ -1021,16 +1021,16 @@ class TextAndWin : public DockingWindow Window* pFtOriginalParent; Window* pWinOriginalParent; long nSpace; // default space - BOOL bAlignTop; + sal_Bool bAlignTop; public: - TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, BOOL bAlignTopP ); + TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, sal_Bool bAlignTopP ); ~TextAndWin(); virtual void Resize(); }; -TextAndWin::TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, BOOL bAlignTopP ) +TextAndWin::TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, sal_Bool bAlignTopP ) : DockingWindow( pParent ) , pFt( pFtP ) , pWin( pWinP ) @@ -1112,8 +1112,8 @@ DisplayHidDlg::DisplayHidDlg( Window * pParent ) #endif pSplit = new SplitWindow( this ); - pControls = new TextAndWin( pSplit, &aFtControls, &aMlbControls, aMlbControls.GetPosPixel().X(), TRUE ); - pSlots = new TextAndWin( pSplit, &aFtSlots, &aMlbSlots, aMlbControls.GetPosPixel().X(), FALSE ); + pControls = new TextAndWin( pSplit, &aFtControls, &aMlbControls, aMlbControls.GetPosPixel().X(), sal_True ); + pSlots = new TextAndWin( pSplit, &aFtSlots, &aMlbSlots, aMlbControls.GetPosPixel().X(), sal_False ); pSplit->SetPosPixel( aFtControls.GetPosPixel() ); pSplit->InsertItem( 1, pControls, 70, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE ); @@ -1139,7 +1139,7 @@ DisplayHidDlg::~DisplayHidDlg() IMPL_LINK( DisplayHidDlg, CopyToClipboard, void*, EMPTYARG ) { String aSammel; - USHORT i; + sal_uInt16 i; for ( i=0 ; i < aMlbControls.GetSelectEntryCount() ; i++ ) { @@ -1161,7 +1161,7 @@ IMPL_LINK( DisplayHidDlg, SelectAll, PushButton*, pButton ) { if ( pButton->GetState() != STATE_CHECK ) { - USHORT i; + sal_uInt16 i; for ( i=0 ; i < aMlbControls.GetEntryCount() ; i++ ) aMlbControls.SelectEntryPos( i ); for ( i=0 ; i < aMlbSlots.GetEntryCount() ; i++ ) @@ -1266,7 +1266,7 @@ void DisplayHidDlg::Resize() } else { -// SetUpdateMode( FALSE ); +// SetUpdateMode( sal_False ); // Minimum size Size aSize( GetOutputSizePixel() ); @@ -1322,7 +1322,7 @@ void DisplayHidDlg::Resize() aPos.Move( pSplit->GetSizePixel().Width(), pSplit->GetSizePixel().Height() ); aOKClose.SetPosPixel( aPos ); -// SetUpdateMode( TRUE ); +// SetUpdateMode( sal_True ); // Invalidate(); } FloatingWindow::Resize(); @@ -1402,7 +1402,7 @@ VarEditDialog::VarEditDialog( Window * pParent, SbxVariable *pPVar ) IMPL_LINK( VarEditDialog, OKClick, Button *, pButton ) { (void) pButton; /* avoid warning about unused parameter */ - BOOL bWasError = SbxBase::IsError(); // Probably an error is thrown + sal_Bool bWasError = SbxBase::IsError(); // Probably an error is thrown SbxDataType eType = pVar->GetType(); @@ -1445,7 +1445,7 @@ SvNumberformat:: String aContent( aEditRID_ED_NEW_STRING.GetText() ); - BOOL bError = FALSE; + sal_Bool bError = sal_False; switch ( eType ) { case SbxBOOL: @@ -1458,10 +1458,10 @@ SvNumberformat:: // pVar->PutDate( aContent ); // break; case SbxINTEGER: - pVar->PutInteger( (INT16)aNumericFieldRID_NF_NEW_INTEGER.GetValue() ); + pVar->PutInteger( (sal_Int16)aNumericFieldRID_NF_NEW_INTEGER.GetValue() ); break; case SbxLONG: - pVar->PutLong( static_cast<INT32>(aNumericFieldRID_NF_NEW_LONG.GetValue()) ); + pVar->PutLong( static_cast<sal_Int32>(aNumericFieldRID_NF_NEW_LONG.GetValue()) ); break; case SbxDOUBLE: case SbxSINGLE: @@ -1482,7 +1482,7 @@ SvNumberformat:: // pVar->PutStringExt( aEditRID_ED_NEW_STRING.GetText() ); if ( !bWasError && SbxBase::IsError() ) { - bError = TRUE; + bError = sal_True; SbxBase::ResetError(); } diff --git a/basic/source/app/dialogs.hxx b/basic/source/app/dialogs.hxx index fbd67aa85f1b..e0a2409ad937 100644 --- a/basic/source/app/dialogs.hxx +++ b/basic/source/app/dialogs.hxx @@ -104,8 +104,8 @@ protected: void Init( Config &aConf ); public: - ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf ); - ConfEdit( Window* pParent, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf ); + ConfEdit( Window* pParent, sal_uInt16 nResText, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, Config &aConf ); + ConfEdit( Window* pParent, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, Config &aConf ); void Save( Config &aConf ); void Reload( Config &aConf ); void Click(); @@ -121,7 +121,7 @@ protected: ConfEdit& rBase; DECL_LINK( ToggleHdl, CheckBox* ); public: - OptConfEdit( Window* pParent, USHORT nResCheck, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf ); + OptConfEdit( Window* pParent, sal_uInt16 nResCheck, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf ); void Reload( Config &aConf ); DECL_LINK( BaseModifyHdl, Edit* ); }; @@ -141,7 +141,7 @@ private: public: OptionsDialog( Window* pParent, const ResId& ); ~OptionsDialog(); - virtual BOOL Close(); + virtual sal_Bool Close(); DECL_LINK( ActivatePageHdl, TabControl * ); @@ -273,7 +273,7 @@ class GenericOptions : public TabPage PushButton aPbDelValue; int nMoveButtons; - BOOL bShowSelectPath; + sal_Bool bShowSelectPath; AutoTimer aMoveTimer; DECL_LINK( MoveButtons, AutoTimer* ); @@ -321,7 +321,7 @@ protected: DockingWindow* pSlots; SplitWindow *pSplit; - ULONG nDisplayMode; + sal_uIntPtr nDisplayMode; DECL_LINK( Select, void* ); DECL_LINK( SelectAll, PushButton* ); @@ -360,7 +360,7 @@ protected: DECL_LINK( OKClick, Button * ); -// BOOL bCompare = FALSE; +// sal_Bool bCompare = sal_False; // String aCompareString; public: diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx index 51864a397435..21febe8b3393 100644 --- a/basic/source/app/msgedit.cxx +++ b/basic/source/app/msgedit.cxx @@ -57,10 +57,10 @@ Version 3 Changed Charset from CHARSET_IBMPC to RTL_TEXTENCODING_UTF8 #include "basmsg.hrc" #include "basrid.hxx" -USHORT MsgEdit::nMaxLogLen = 0; -BOOL MsgEdit::bLimitLogLen = FALSE; -BOOL MsgEdit::bPrintLogToStdout = FALSE; -BOOL MsgEdit::bPrintLogToStdoutSet = FALSE; +sal_uInt16 MsgEdit::nMaxLogLen = 0; +sal_Bool MsgEdit::bLimitLogLen = sal_False; +sal_Bool MsgEdit::bPrintLogToStdout = sal_False; +sal_Bool MsgEdit::bPrintLogToStdoutSet = sal_False; #define WARNING_PREFIX String( SttResId( S_WARNING_PREFIX ) ) #define VERSION_STRING CUniString("File Format Version: ") @@ -74,8 +74,8 @@ MsgEdit::MsgEdit( AppError* pParent, BasicFrame *pBF, const WinBits& aBits ) , pCurrentTestCase(NULL) , pCurrentAssertion( NULL ) , pCurrentError(NULL) -, bModified(FALSE) -, bFileLoading(FALSE) +, bModified(sal_False) +, bFileLoading(sal_False) , nVersion(0) , pAppError( pParent ) , aEditTree( pParent, pBF, aBits | WB_HASBUTTONS | WB_HASLINES | WB_HASBUTTONSATROOT ) @@ -88,15 +88,15 @@ MsgEdit::MsgEdit( AppError* pParent, BasicFrame *pBF, const WinBits& aBits ) if ( !bPrintLogToStdoutSet ) { - bPrintLogToStdoutSet = TRUE; - for ( USHORT i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) + bPrintLogToStdoutSet = sal_True; + for ( sal_uInt16 i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) { if ( Application::GetCommandLineParam( i ).Copy(0,9).CompareIgnoreCaseToAscii("-printlog") == COMPARE_EQUAL #ifndef UNX || Application::GetCommandLineParam( i ).Copy(0,9).CompareIgnoreCaseToAscii("/printlog") == COMPARE_EQUAL #endif ) - bPrintLogToStdout = TRUE; + bPrintLogToStdout = sal_True; } } } @@ -177,11 +177,11 @@ void MsgEdit::AddAnyMsg( TTLogMsg *LogMsg ) if ( !bFileLoading ) { // Comes from Testtool and must be written immediately - BOOL bFileWasChanged = pAppError->DiskFileChanged( SINCE_LAST_LOAD ); + sal_Bool bFileWasChanged = pAppError->DiskFileChanged( SINCE_LAST_LOAD ); DBG_ASSERT( aLogFileName == LogMsg->aLogFileName, "Logging to different logfile as before" ); DirEntry aEntry( LogMsg->aLogFileName ); - BOOL bNewFile = !aEntry.Exists(); + sal_Bool bNewFile = !aEntry.Exists(); SvFileStream aStrm( LogMsg->aLogFileName, STREAM_STD_WRITE ); if ( bNewFile ) { @@ -229,7 +229,7 @@ void MsgEdit::AddRun( String aMsg, TTDebugData aDebugData ) { if ( !bFileLoading && bLimitLogLen ) { - USHORT nSkip = nMaxLogLen; + sal_uInt16 nSkip = nMaxLogLen; SvLBoxEntry *pRun = aEditTree.First(); while ( nSkip-- && pRun ) pRun = aEditTree.NextSibling( pRun ); @@ -240,7 +240,7 @@ void MsgEdit::AddRun( String aMsg, TTDebugData aDebugData ) aEditTree.GetModel()->Remove( aEditTree.NextSibling( pRun ) ); aEditTree.GetModel()->Remove( pRun ); - bModified = TRUE; + bModified = sal_True; lModify.Call( NULL ); Save( aLogFileName ); pAppError->UpdateFileInfo( HAS_BEEN_LOADED ); @@ -249,9 +249,9 @@ void MsgEdit::AddRun( String aMsg, TTDebugData aDebugData ) COPY_TTDEBUGDATA( LOG_RUN ); if ( !bFileLoading || ( bFileLoading && nVersion >= 2 ) ) - pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, FALSE, 0, pTTDebugData ); + pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, sal_False, 0, pTTDebugData ); else // First file format - pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, FALSE, LIST_APPEND, pTTDebugData ); // and therefor at the end + pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, sal_False, LIST_APPEND, pTTDebugData ); // and therefor at the end aEditTree.ShowEntry( pCurrentRun ); pCurrentTestCase = NULL; @@ -270,7 +270,7 @@ void MsgEdit::AddTestCase( String aMsg, TTDebugData aDebugData ) else { COPY_TTDEBUGDATA( LOG_TEST_CASE ); - pCurrentTestCase = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pCurrentTestCase = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pCurrentTestCase ); } } @@ -292,7 +292,7 @@ void MsgEdit::AddError( String aMsg, TTDebugData aDebugData ) if ( pCurrentTestCase ) { COPY_TTDEBUGDATA( LOG_ERROR ); - pCurrentError = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pCurrentError = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pCurrentError ); } } @@ -303,7 +303,7 @@ void MsgEdit::AddCallStack( String aMsg, TTDebugData aDebugData ) if ( pCurrentError ) { COPY_TTDEBUGDATA( LOG_CALL_STACK ); - aEditTree.InsertEntry( aMsg, pCurrentError, FALSE, LIST_APPEND, pTTDebugData ); + aEditTree.InsertEntry( aMsg, pCurrentError, sal_False, LIST_APPEND, pTTDebugData ); } } @@ -312,16 +312,16 @@ void MsgEdit::AddMessage( String aMsg, TTDebugData aDebugData ) SvLBoxEntry *pThisEntry = NULL; COPY_TTDEBUGDATA( LOG_MESSAGE ); if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } } @@ -334,16 +334,16 @@ void MsgEdit::AddWarning( String aMsg, TTDebugData aDebugData ) COPY_TTDEBUGDATA( LOG_WARNING ); if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } @@ -362,16 +362,16 @@ void MsgEdit::AddAssertion( String aMsg, TTDebugData aDebugData ) SvLBoxEntry *pThisEntry = NULL; COPY_TTDEBUGDATA( LOG_ASSERTION ); if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } @@ -386,18 +386,18 @@ void MsgEdit::AddAssertionStack( String aMsg, TTDebugData aDebugData ) SvLBoxEntry *pThisEntry = NULL; COPY_TTDEBUGDATA( LOG_ASSERTION_STACK ); if ( pCurrentAssertion ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentAssertion, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentAssertion, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } @@ -410,16 +410,16 @@ void MsgEdit::AddQAError( String aMsg, TTDebugData aDebugData ) SvLBoxEntry *pThisEntry = NULL; COPY_TTDEBUGDATA( LOG_QA_ERROR ); if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } @@ -428,8 +428,8 @@ void MsgEdit::AddQAError( String aMsg, TTDebugData aDebugData ) } /* - SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return SvLBox::GetEntry(pParent,nPos); } - SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return SvLBox::GetEntry(nRootPos);} + SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, sal_uIntPtr nPos ) const { return SvLBox::GetEntry(pParent,nPos); } + SvLBoxEntry* GetEntry( sal_uIntPtr nRootPos ) const { return SvLBox::GetEntry(nRootPos);} @@ -442,16 +442,16 @@ void MsgEdit::AddQAError( String aMsg, TTDebugData aDebugData ) SvLBoxEntry* PrevSelected( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(SvListView::PrevSelected(pEntry)); } SvLBoxEntry* LastSelected() const { return (SvLBoxEntry*)(SvListView::LastSelected()); } - SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); } - SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(nRootPos)); } + SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, sal_uIntPtr nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); } + SvLBoxEntry* GetEntry( sal_uIntPtr nRootPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(nRootPos)); } SvLBoxEntry* GetParent( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetParent(pEntry)); } SvLBoxEntry* GetRootLevelParent(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetRootLevelParent( pEntry ));} - BOOL IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const; - SvListEntry* GetEntry( SvListEntry* pParent, ULONG nPos ) const; - SvListEntry* GetEntry( ULONG nRootPos ) const; - SvListEntry* GetEntryAtAbsPos( ULONG nAbsPos ) const; + sal_Bool IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const; + SvListEntry* GetEntry( SvListEntry* pParent, sal_uIntPtr nPos ) const; + SvListEntry* GetEntry( sal_uIntPtr nRootPos ) const; + SvListEntry* GetEntryAtAbsPos( sal_uIntPtr nAbsPos ) const; SvListEntry* GetParent( SvListEntry* pEntry ) const; SvListEntry* GetRootLevelParent( SvListEntry* pEntry ) const; */ @@ -465,11 +465,11 @@ void MsgEdit::Delete() CHECK( pCurrentTestCase ); CHECK( pCurrentAssertion ); CHECK( pCurrentError ); - bModified = TRUE; + bModified = sal_True; lModify.Call( NULL ); } -void MsgEdit::Cut(){ Copy(); Delete(); bModified = TRUE; lModify.Call( NULL ); } +void MsgEdit::Cut(){ Copy(); Delete(); bModified = sal_True; lModify.Call( NULL ); } void MsgEdit::Copy(){ ::svt::OStringTransfer::CopyString( GetSelected(), &aEditTree ); } /**/void MsgEdit::Paste(){ Sound::Beep(); } void MsgEdit::Undo(){ Sound::Beep(); } @@ -548,7 +548,7 @@ String MsgEdit::GetSelected() TextSelection MsgEdit::GetSelection() const { - ULONG nStart=0,nEnd=0; + sal_uIntPtr nStart=0,nEnd=0; if ( aEditTree.FirstSelected() ) { @@ -563,25 +563,25 @@ TextSelection MsgEdit::GetSelection() const void MsgEdit::SetSelection( const TextSelection& rSelection ) { - ULONG nStart,nEnd; + sal_uIntPtr nStart,nEnd; while ( aEditTree.GetSelectionCount() ) - aEditTree.Select( aEditTree.FirstSelected(), FALSE ); + aEditTree.Select( aEditTree.FirstSelected(), sal_False ); if ( rSelection.HasRange() ) { nStart = rSelection.GetStart().GetPara(); nEnd = rSelection.GetEnd().GetPara(); - for ( ULONG i = nStart ; i <= nEnd ; i++ ) - aEditTree.Select( aEditTree.GetModel()->GetEntryAtAbsPos( i ), TRUE ); + for ( sal_uIntPtr i = nStart ; i <= nEnd ; i++ ) + aEditTree.Select( aEditTree.GetModel()->GetEntryAtAbsPos( i ), sal_True ); } } -USHORT MsgEdit::GetLineNr() const +sal_uInt16 MsgEdit::GetLineNr() const { if ( aEditTree.GetCurEntry() ) - return (USHORT)aEditTree.GetModel()->GetAbsPos(aEditTree.GetCurEntry() ) + 1; + return (sal_uInt16)aEditTree.GetModel()->GetAbsPos(aEditTree.GetCurEntry() ) + 1; else return 0; } @@ -593,7 +593,7 @@ void MsgEdit::ReplaceSelected( const String& rStr ) DBG_ERROR("Not Implemented"); } -BOOL MsgEdit::IsModified(){ return bModified; } +sal_Bool MsgEdit::IsModified(){ return bModified; } void MsgEdit::SetModifyHdl( Link l ){ lModify = l; } String MsgEdit::GetText() const @@ -617,16 +617,16 @@ void MsgEdit::SetText( const String& rStr ) DBG_ERROR("Not Implemented"); } -BOOL MsgEdit::HasText() const +sal_Bool MsgEdit::HasText() const { return aEditTree.First() != NULL; } // Search from the beginning or mark start + 1 -BOOL MsgEdit::Find( const String& s ) +sal_Bool MsgEdit::Find( const String& s ) { TextSelection r = GetSelection(); - USHORT bgn = (USHORT) r.GetStart().GetPara() + 1; + sal_uInt16 bgn = (sal_uInt16) r.GetStart().GetPara() + 1; if ( r.GetStart().GetPara() == 0 ) bgn = 0; // Search from the beginning @@ -636,11 +636,11 @@ BOOL MsgEdit::Find( const String& s ) if( aEditTree.GetEntryText( pEntry ).Search( s, 0 ) != STRING_NOTFOUND ) { aEditTree.SetCurEntry( pEntry ); - return TRUE; + return sal_True; } pEntry = aEditTree.Next( pEntry ); } - return FALSE; + return sal_False; } /****************************************************************** @@ -653,17 +653,17 @@ BOOL MsgEdit::Find( const String& s ) ******************************************************************/ -BOOL MsgEdit::Load( const String& aName ) +sal_Bool MsgEdit::Load( const String& aName ) { aLogFileName = aName; - BOOL bOk = TRUE, bFirstLine = TRUE; - BOOL bLoadError = FALSE; + sal_Bool bOk = sal_True, bFirstLine = sal_True; + sal_Bool bLoadError = sal_False; SvFileStream aStrm( aName, STREAM_STD_READ ); if( aStrm.IsOpen() ) { aEditTree.Clear(); String aLine; - bFileLoading = TRUE; // To avoid logging to disk + bFileLoading = sal_True; // To avoid logging to disk TTLogMsg *pLogMsg = new TTLogMsg; while( !aStrm.IsEof() && bOk ) { @@ -673,7 +673,7 @@ BOOL MsgEdit::Load( const String& aName ) aStrm.ReadByteStringLine( aLine, RTL_TEXTENCODING_IBM_850 ); if( aStrm.GetError() != SVSTREAM_OK ) - bOk = FALSE; + bOk = sal_False; #define TOKEN( n ) aLine.GetToken( n ) @@ -683,9 +683,9 @@ BOOL MsgEdit::Load( const String& aName ) TTDebugData aDebugData; aDebugData.aLogType = TTLogType( TOKEN(0).ToInt32() ); aDebugData.aFilename = TOKEN(1); - aDebugData.nLine = USHORT( TOKEN(2).ToInt32() ); - aDebugData.nCol1 = USHORT( TOKEN(3).ToInt32() ); - aDebugData.nCol2 = USHORT( TOKEN(4).ToInt32() ); + aDebugData.nLine = sal_uInt16( TOKEN(2).ToInt32() ); + aDebugData.nCol1 = sal_uInt16( TOKEN(3).ToInt32() ); + aDebugData.nCol2 = sal_uInt16( TOKEN(4).ToInt32() ); aDebugData.aMsg = aLine.GetQuotedToken( 5, CUniString("\"\"") ); // Remove leading and trailing quotes @@ -698,13 +698,13 @@ BOOL MsgEdit::Load( const String& aName ) AddAnyMsg( pLogMsg ); } else if ( bFirstLine && (aLine.Search( VERSION_STRING ) == 0) ) - nVersion = USHORT( aLine.Copy( VERSION_STRING.Len() ).ToInt32() ); + nVersion = sal_uInt16( aLine.Copy( VERSION_STRING.Len() ).ToInt32() ); else if ( aLine.Len() ) - bLoadError = TRUE; + bLoadError = sal_True; - bFirstLine = FALSE; + bFirstLine = sal_False; } - bFileLoading = FALSE; + bFileLoading = sal_False; delete pLogMsg; aStrm.Close(); if ( nVersion < 2 && !bLoadError ) @@ -712,16 +712,16 @@ BOOL MsgEdit::Load( const String& aName ) } else - bOk = FALSE; + bOk = sal_False; return bOk; } -BOOL MsgEdit::Save( const String& aName ) +sal_Bool MsgEdit::Save( const String& aName ) { - BOOL bOk = TRUE; - BOOL bIsText = DirEntry( aName ).GetExtension().CompareIgnoreCaseToAscii("TXT") == COMPARE_EQUAL; + sal_Bool bOk = sal_True; + sal_Bool bIsText = DirEntry( aName ).GetExtension().CompareIgnoreCaseToAscii("TXT") == COMPARE_EQUAL; if ( bIsText && !QueryBox( NULL, SttResId( IDS_LOSS_OF_INFORMATION ) ).Execute() ) - return FALSE; + return sal_False; SvFileStream aStrm( aName, STREAM_STD_WRITE | STREAM_TRUNC ); if( aStrm.IsOpen() ) { @@ -759,16 +759,16 @@ BOOL MsgEdit::Save( const String& aName ) } } if( aStrm.GetError() != SVSTREAM_OK ) - bOk = FALSE; + bOk = sal_False; else { - bModified = FALSE; + bModified = sal_False; lModify.Call( NULL ); } } else - bOk = FALSE; + bOk = sal_False; return bOk; } @@ -780,7 +780,7 @@ TTTreeListBox::TTTreeListBox( AppError* pParent, BasicFrame* pBF, WinBits nWinSt //, nDeselectParent(0) {} -BOOL TTTreeListBox::JumpToSourcecode( SvLBoxEntry *pThisEntry ) +sal_Bool TTTreeListBox::JumpToSourcecode( SvLBoxEntry *pThisEntry ) { if ( pThisEntry && pThisEntry->GetUserData() && ((TTDebugData*)pThisEntry->GetUserData())->aFilename.Len() > 0 ) { @@ -816,20 +816,20 @@ BOOL TTTreeListBox::JumpToSourcecode( SvLBoxEntry *pThisEntry ) if ( pBasicFrame->pWork && pBasicFrame->pWork->ISA(AppEdit) ) ((AppEdit*)pBasicFrame->pWork)->Highlight( aData->nLine, aData->nCol1, aData->nCol2 ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } -BOOL TTTreeListBox::DoubleClickHdl() +sal_Bool TTTreeListBox::DoubleClickHdl() { return JumpToSourcecode( GetHdlEntry() ); } -/*ULONG TTTreeListBox::SelectChildren( SvLBoxEntry* pParent, BOOL bSelect ) +/*sal_uIntPtr TTTreeListBox::SelectChildren( SvLBoxEntry* pParent, sal_Bool bSelect ) { SvLBoxEntry *pEntry = FirstChild( pParent ); - ULONG nRet = 0; + sal_uIntPtr nRet = 0; while ( pEntry ) { nRet++; @@ -844,8 +844,8 @@ void TTTreeListBox::SelectHdl() { SvLBoxEntry* pHdlEntry = GetHdlEntry(); - SelectChildren( pHdlEntry, TRUE ); - Select( pHdlEntry, TRUE ); + SelectChildren( pHdlEntry, sal_True ); + Select( pHdlEntry, sal_True ); // InitMenu(pApp->GetAppMenu()->GetPopupMenu( RID_APPEDIT )); // So da Delete richtig ist } @@ -855,13 +855,13 @@ void TTTreeListBox::DeselectHdl() if ( GetParent( pHdlEntry ) ) { nDeselectParent++; - Select( GetParent( pHdlEntry ), FALSE ); + Select( GetParent( pHdlEntry ), sal_False ); nDeselectParent--; } if ( !nDeselectParent ) { - SelectChildren( pHdlEntry, FALSE ); - Select( pHdlEntry, FALSE ); + SelectChildren( pHdlEntry, sal_False ); + Select( pHdlEntry, sal_False ); } Invalidate(); } */ @@ -932,15 +932,15 @@ class TTLBoxString : public SvLBoxString { public: - TTLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, + TTLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr) {} - virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, + virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); }; -void TTLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, +void TTLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ) { TTFeatures aFeatures = ((TTTreeListBox*)&rDev)->GetFeatures( pEntry ); @@ -964,7 +964,7 @@ void TTLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, else { aFont.SetFillColor( aCol ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); Color aCol2( COL_BLACK ); aFont.SetColor( aCol2 ); } @@ -990,7 +990,7 @@ void TTTreeListBox::InitEntry(SvLBoxEntry* pEntry, const String& rStr ,const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind ) { - USHORT nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" + sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); TTLBoxString* pStr = new TTLBoxString( pEntry, 0, pCol->GetText() ); diff --git a/basic/source/app/msgedit.hxx b/basic/source/app/msgedit.hxx index 76b085668768..c3e4d6413db4 100644 --- a/basic/source/app/msgedit.hxx +++ b/basic/source/app/msgedit.hxx @@ -37,7 +37,7 @@ class AppError; #define SelectChildren SelectChilds // Sonst wird mir schlecht -typedef USHORT TTFeatures; // Bitfield for features of the entries +typedef sal_uInt16 TTFeatures; // Bitfield for features of the entries #define HasNothing TTFeatures(0x00) #define HasError TTFeatures(0x01) #define HasWarning TTFeatures(0x02) @@ -49,13 +49,13 @@ class TTTreeListBox : public SvTreeListBox { protected: // virtual void Command( const CommandEvent& rCEvt ); -// USHORT nDeselectParent; +// sal_uInt16 nDeselectParent; BasicFrame *pBasicFrame; void InitEntry( SvLBoxEntry*, const String&, const Image&, const Image&, SvLBoxButtonKind eButtonKind ); AppError *pAppError; - BOOL JumpToSourcecode( SvLBoxEntry *pThisEntry ); + sal_Bool JumpToSourcecode( SvLBoxEntry *pThisEntry ); public: TTTreeListBox( AppError* pParent, BasicFrame* pBF, WinBits nWinStyle=0 ); @@ -63,11 +63,11 @@ public: // virtual void SelectHdl(); // virtual void DeselectHdl(); - virtual BOOL DoubleClickHdl(); + virtual sal_Bool DoubleClickHdl(); virtual void KeyInput( const KeyEvent& rKEvt ); -// ULONG SelectChildren( SvLBoxEntry* pParent, BOOL bSelect ); +// sal_uIntPtr SelectChildren( SvLBoxEntry* pParent, sal_Bool bSelect ); TTFeatures GetFeatures( SvLBoxEntry* ); }; @@ -79,20 +79,20 @@ class MsgEdit : public DataEdit SvLBoxEntry *pCurrentTestCase; SvLBoxEntry *pCurrentAssertion; SvLBoxEntry *pCurrentError; - BOOL bModified; + sal_Bool bModified; Link lModify; - BOOL bFileLoading; // TRUE while loading a file + sal_Bool bFileLoading; // sal_True while loading a file String Impl_MakeText( SvLBoxEntry *pEntry ) const; String Impl_MakeSaveText( SvLBoxEntry *pEntry ) const; String Impl_MakeSaveText( TTDebugData aData ) const; - USHORT nVersion; // Stores file version + sal_uInt16 nVersion; // Stores file version AppError* pAppError; String aLogFileName; - static USHORT nMaxLogLen; - static BOOL bLimitLogLen; - static BOOL bPrintLogToStdout; - static BOOL bPrintLogToStdoutSet; // has it been initialized yet + static sal_uInt16 nMaxLogLen; + static sal_Bool bLimitLogLen; + static sal_Bool bPrintLogToStdout; + static sal_Bool bPrintLogToStdoutSet; // has it been initialized yet public: MsgEdit( AppError*, BasicFrame *pBF, const WinBits& ); ~MsgEdit(); @@ -107,7 +107,7 @@ public: void AddAssertionStack( String aMsg, TTDebugData aDebugData ); void AddQAError( String aMsg, TTDebugData aDebugData ); - static void SetMaxLogLen( USHORT nLen ) { nMaxLogLen = nLen; bLimitLogLen = TRUE; } + static void SetMaxLogLen( sal_uInt16 nLen ) { nMaxLogLen = nLen; bLimitLogLen = sal_True; } DATA_FUNC_DEF( aEditTree, TTTreeListBox ) }; diff --git a/basic/source/app/mybasic.cxx b/basic/source/app/mybasic.cxx index f69c4c468111..791c267cda44 100644 --- a/basic/source/app/mybasic.cxx +++ b/basic/source/app/mybasic.cxx @@ -65,7 +65,7 @@ TYPEINIT1(MyBasic,StarBASIC) class MyFactory : public SbxFactory { public: - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); }; static SampleObjectFac aFac1; @@ -73,7 +73,7 @@ static MyFactory aFac2; static ProcessFactory aProcessFac; static short nInst = 0; -SbxBase* MyFactory::Create( UINT16 nSbxId, UINT32 nCr ) +SbxBase* MyFactory::Create( sal_uInt16 nSbxId, sal_uInt32 nCr ) { if( nCr == SBXCR_TEST && nSbxId == SBXID_MYBASIC ) return new MyBasic; @@ -156,7 +156,7 @@ void MyBasic::LoadIniFile() { } -SbTextType MyBasic::GetSymbolType( const String &rSymbol, BOOL bWasTTControl ) +SbTextType MyBasic::GetSymbolType( const String &rSymbol, sal_Bool bWasTTControl ) { (void) rSymbol; /* avoid warning about unused parameter */ (void) bWasTTControl; /* avoid warning about unused parameter */ @@ -181,13 +181,13 @@ void MyBasic::Reset() nError = 0; } -BOOL MyBasic::Compile( SbModule* p ) +sal_Bool MyBasic::Compile( SbModule* p ) { Reset(); return StarBASIC::Compile( p ); } -BOOL MyBasic::ErrorHdl() +sal_Bool MyBasic::ErrorHdl() { AppBasEd* pWin = aBasicApp.pFrame->FindModuleWin( GetActiveModule()->GetName() ); if( !pWin ) @@ -204,12 +204,12 @@ BOOL MyBasic::ErrorHdl() 0, StarBASIC::GetErrorText(), GetLine(), GetCol1(), GetCol2() ), LIST_APPEND ); nError++; - return BOOL( nError < 20 ); // Cancel after 20 errors + return sal_Bool( nError < 20 ); // Cancel after 20 errors } else { ReportRuntimeError( pWin ); - return FALSE; + return sal_False; } } @@ -226,7 +226,7 @@ void MyBasic::ReportRuntimeError( AppBasEd *pEditWin ) GetCol1(), GetCol2() ).Show(); } -void MyBasic::DebugFindNoErrors( BOOL bDebugFindNoErrors ) +void MyBasic::DebugFindNoErrors( sal_Bool bDebugFindNoErrors ) { (void) bDebugFindNoErrors; /* avoid warning about unused parameter */ } @@ -236,7 +236,7 @@ const String MyBasic::GetSpechialErrorText() return GetErrorText(); } -USHORT MyBasic::BreakHdl() +sal_uInt16 MyBasic::BreakHdl() { SbModule* pMod = GetActiveModule(); if( pMod ) @@ -270,7 +270,7 @@ USHORT MyBasic::BreakHdl() ***************************************************************************/ BasicError::BasicError - ( AppBasEd* w, USHORT nE, const String& r, USHORT nL, USHORT nC1, USHORT nC2 ) + ( AppBasEd* w, sal_uInt16 nE, const String& r, sal_uInt16 nL, sal_uInt16 nC1, sal_uInt16 nC2 ) : aText( SttResId( IDS_ERROR1 ) ) { pWin = w; diff --git a/basic/source/app/printer.cxx b/basic/source/app/printer.cxx index 0ad562970fe6..8e89f5d90c03 100644 --- a/basic/source/app/printer.cxx +++ b/basic/source/app/printer.cxx @@ -97,7 +97,7 @@ void BasicPrinter::Print( const String& rFile, const String& rText, BasicFrame * // Disable PRINT-Menu MenuBar* pBar = pFrame->GetMenuBar(); Menu* pFileMenu = pBar->GetPopupMenu( RID_APPFILE ); - pFileMenu->EnableItem( RID_FILEPRINT, FALSE ); + pFileMenu->EnableItem( RID_FILEPRINT, sal_False ); mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) ); mpListener->StartPage(); @@ -116,7 +116,7 @@ void BasicPrinter::Print( const String& rFile, const String& rText, BasicFrame * Printer::PrintJob( mpListener, mpPrinter->GetJobSetup() ); nPage = 1; - pFileMenu->EnableItem( RID_FILEPRINT, TRUE ); + pFileMenu->EnableItem( RID_FILEPRINT, sal_True ); } diff --git a/basic/source/app/process.cxx b/basic/source/app/process.cxx index 0eec05e1697c..703f684b38de 100644 --- a/basic/source/app/process.cxx +++ b/basic/source/app/process.cxx @@ -55,8 +55,8 @@ Process::Process() : pArgumentList( NULL ) , pEnvList( NULL ) , pProcess( NULL ) -, bWasGPF( FALSE ) -, bHasBeenStarted( FALSE ) +, bWasGPF( sal_False ) +, bHasBeenStarted( sal_False ) { } @@ -68,19 +68,19 @@ Process::~Process() } -BOOL Process::ImplIsRunning() +sal_Bool Process::ImplIsRunning() { if ( pProcess && bHasBeenStarted ) { vos::OProcess::TProcessInfo aProcessInfo; pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo ); if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } else - return FALSE; + return sal_False; } long Process::ImplGetExitCode() @@ -149,19 +149,19 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const ::rtl::OUString aNormalizedAppPath; osl::FileBase::getFileURLFromSystemPath( ::rtl::OUString(aAppPath), aNormalizedAppPath ); pProcess = new vos::OProcess( aNormalizedAppPath ); - bHasBeenStarted = FALSE; + bHasBeenStarted = sal_False; delete [] pParamList; delete [] pEnvArray; } } -BOOL Process::Start() +sal_Bool Process::Start() { // Start program - BOOL bSuccess=FALSE; + sal_Bool bSuccess=sal_False; if ( pProcess && !ImplIsRunning() ) { - bWasGPF = FALSE; + bWasGPF = sal_False; #ifdef WNT // sal_uInt32 nErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_NOALIGNMENTFAULTEXCEPT | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); sal_uInt32 nErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOGPFAULTERRORBOX); @@ -189,7 +189,7 @@ BOOL Process::Start() } catch( ... ) { - bWasGPF = TRUE; + bWasGPF = sal_True; // TODO: Output debug message !! } nErrorMode = SetErrorMode(nErrorMode); @@ -201,17 +201,17 @@ BOOL Process::Start() return bSuccess; } -ULONG Process::GetExitCode() +sal_uIntPtr Process::GetExitCode() { // ExitCode of program after execution return ImplGetExitCode(); } -BOOL Process::IsRunning() +sal_Bool Process::IsRunning() { return ImplIsRunning(); } -BOOL Process::WasGPF() +sal_Bool Process::WasGPF() { // Did the process fail? #ifdef WNT return ImplGetExitCode() == 3221225477; @@ -220,10 +220,10 @@ BOOL Process::WasGPF() #endif } -BOOL Process::Terminate() +sal_Bool Process::Terminate() { if ( ImplIsRunning() ) return pProcess->terminate() == vos::OProcess::E_None; - return TRUE; + return sal_True; } diff --git a/basic/source/app/processw.cxx b/basic/source/app/processw.cxx index 291ea9db33b7..0abf5afc0d57 100644 --- a/basic/source/app/processw.cxx +++ b/basic/source/app/processw.cxx @@ -48,10 +48,10 @@ // none // 2) Methods: // SetImage( Filename ) -// BOOL Start -// USHORT GetExitCode -// BOOL IsRunning -// BOOL WasGPF +// sal_Bool Start +// sal_uInt16 GetExitCode +// sal_Bool IsRunning +// sal_Bool WasGPF // This implementation is a sample for a table driven version that @@ -67,7 +67,7 @@ #define _BWRITE 0x0200 // can be used as Lvaluen #define _LVALUE _BWRITE #define _READWRITE 0x0300 // can read and written -#define _OPT 0x0400 // TRUE: optional parameter +#define _OPT 0x0400 // sal_True: optional parameter #define _METHOD 0x1000 // Mask-Bit for a method #define _PROPERTY 0x2000 // Mask-Bit for a property #define _COLL 0x4000 // Mask-Bit for a collection @@ -128,12 +128,12 @@ SbxVariable* ProcessWrapper::Find( const String& rName, SbxClassType t ) // otherwise search Methods* p = pMethods; short nIndex = 0; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; while( p->nArgs != -1 ) { if( rName.EqualsIgnoreCaseAscii( p->pName ) ) { - bFound = TRUE; break; + bFound = sal_True; break; } nIndex += ( p->nArgs & _ARGSMASK ) + 1; p = pMethods + nIndex; @@ -168,22 +168,22 @@ void ProcessWrapper::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCT, { SbxVariable* pVar = pHint->GetVar(); SbxArray* pNotifyPar = pVar->GetParameters(); - USHORT nIndex = (USHORT) pVar->GetUserData(); + sal_uInt16 nIndex = (sal_uInt16) pVar->GetUserData(); // No index: put through if( nIndex ) { - ULONG t = pHint->GetId(); + sal_uIntPtr t = pHint->GetId(); if( t == SBX_HINT_INFOWANTED ) pVar->SetInfo( GetInfo( (short) pVar->GetUserData() ) ); else { - BOOL bWrite = FALSE; + sal_Bool bWrite = sal_False; if( t == SBX_HINT_DATACHANGED ) - bWrite = TRUE; + bWrite = sal_True; if( t == SBX_HINT_DATAWANTED || bWrite ) { // Parameter-Test for methods: - USHORT nPar = pMethods[ --nIndex ].nArgs & 0x00FF; + sal_uInt16 nPar = pMethods[ --nIndex ].nArgs & 0x00FF; // Element 0 is the return value if( ( !pNotifyPar && nPar ) || ( pNotifyPar && pNotifyPar->Count() < nPar+1 ) ) @@ -212,7 +212,7 @@ SbxInfo* ProcessWrapper::GetInfo( short nIdx ) { p++; String aMethodName( p->pName, RTL_TEXTENCODING_ASCII_US ); - USHORT nInfoFlags = ( p->nArgs >> 8 ) & 0x03; + sal_uInt16 nInfoFlags = ( p->nArgs >> 8 ) & 0x03; if( p->nArgs & _OPT ) nInfoFlags |= SBX_OPTIONAL; pResultInfo->AddParam( aMethodName, p->eType, nInfoFlags ); @@ -226,10 +226,10 @@ SbxInfo* ProcessWrapper::GetInfo( short nIdx ) //////////////////////////////////////////////////////////////////////////// -// Properties and methods save the return value in argv[0] (Get, bPut = FALSE) -// and store the value from argv[0] (Put, bPut = TRUE) +// Properties and methods save the return value in argv[0] (Get, bPut = sal_False) +// and store the value from argv[0] (Put, bPut = sal_True) -void ProcessWrapper::PSetImage( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PSetImage( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // Imagefile of the executable (void) pVar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ @@ -239,28 +239,28 @@ void ProcessWrapper::PSetImage( SbxVariable* pVar, SbxArray* pMethodePar, BOOL b pProcess->SetImage(pMethodePar->Get( 1 )->GetString(), String() ); } -void ProcessWrapper::PStart( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PStart( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // Program is started (void) pMethodePar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ pVar->PutBool( pProcess->Start() ); } -void ProcessWrapper::PGetExitCode( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PGetExitCode( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // ExitCode of the program after it was finished (void) pMethodePar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ pVar->PutULong( pProcess->GetExitCode() ); } -void ProcessWrapper::PIsRunning( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PIsRunning( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // Program is still running (void) pMethodePar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ pVar->PutBool( pProcess->IsRunning() ); } -void ProcessWrapper::PWasGPF( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PWasGPF( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // Program faulted with GPF etc. (void) pMethodePar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ diff --git a/basic/source/app/processw.hxx b/basic/source/app/processw.hxx index e04396e20809..69f6eb73a793 100644 --- a/basic/source/app/processw.hxx +++ b/basic/source/app/processw.hxx @@ -44,7 +44,7 @@ using SbxVariable::GetInfo; public: #endif typedef void( ProcessWrapper::*pMeth ) - ( SbxVariable* pThis, SbxArray* pArgs, BOOL bWrite ); + ( SbxVariable* pThis, SbxArray* pArgs, sal_Bool bWrite ); #if defined ( ICC ) || defined ( HPUX ) private: #endif @@ -58,11 +58,11 @@ private: static Methods aProcessMethods[]; // Method table Methods *pMethods; // Current method table - void PSetImage( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PStart( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PGetExitCode( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PIsRunning( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PWasGPF( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + void PSetImage( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PStart( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PGetExitCode( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PIsRunning( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PWasGPF( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); // Internal members and methods Process *pProcess; diff --git a/basic/source/app/status.cxx b/basic/source/app/status.cxx index 604fdedfc133..beb43ec1de18 100644 --- a/basic/source/app/status.cxx +++ b/basic/source/app/status.cxx @@ -72,7 +72,7 @@ void StatusLine::SetProfileName( const String& s ) IMPL_LINK( StatusLine, ActivateTask, TaskToolBox*, pTTB ) { - USHORT nFirstWinPos=0; + sal_uInt16 nFirstWinPos=0; MenuBar* pMenu = pFrame->GetMenuBar(); PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); @@ -81,14 +81,14 @@ IMPL_LINK( StatusLine, ActivateTask, TaskToolBox*, pTTB ) nFirstWinPos += pTTB->GetItemPos( pTTB->GetCurItemId() ) / 2; - USHORT x; + sal_uInt16 x; x = pTTB->GetItemPos( pTTB->GetCurItemId() ); x = pWinMenu->GetItemId( nFirstWinPos ); x = pWinMenu->GetItemCount(); AppWin* pWin = pFrame->FindWin( pWinMenu->GetItemText( pWinMenu->GetItemId( nFirstWinPos ) ).EraseAllChars( L'~' ) ); if ( pWin ) { - pWin->Minimize( FALSE ); + pWin->Minimize( sal_False ); pWin->ToTop(); } return 0; @@ -96,7 +96,7 @@ IMPL_LINK( StatusLine, ActivateTask, TaskToolBox*, pTTB ) void StatusLine::LoadTaskToolBox() { - USHORT nFirstWinPos=0; + sal_uInt16 nFirstWinPos=0; MenuBar* pMenu = pFrame->GetMenuBar(); PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); diff --git a/basic/source/app/textedit.cxx b/basic/source/app/textedit.cxx index bd18d4176803..55e91ea879b5 100644 --- a/basic/source/app/textedit.cxx +++ b/basic/source/app/textedit.cxx @@ -45,19 +45,19 @@ TextEditImp::TextEditImp( AppEdit* pParent, const WinBits& aBits ) : Window( pParent, aBits ) , pAppEdit( pParent ) -, bHighlightning( FALSE ) -, bDoSyntaxHighlight( FALSE ) -, bDelayHighlight( TRUE ) +, bHighlightning( sal_False ) +, bDoSyntaxHighlight( sal_False ) +, bDelayHighlight( sal_True ) , nTipId( 0 ) -, bViewMoved( FALSE ) +, bViewMoved( sal_False ) { pTextEngine = new TextEngine(); pTextEngine->SetMaxTextLen( STRING_MAXLEN ); - pTextEngine->EnableUndo( TRUE ); + pTextEngine->EnableUndo( sal_True ); pTextView = new TextView( pTextEngine, this ); pTextEngine->InsertView( pTextView ); - pTextEngine->SetModified( FALSE ); + pTextEngine->SetModified( sal_False ); aSyntaxIdleTimer.SetTimeout( 200 ); aSyntaxIdleTimer.SetTimeoutHdl( LINK( this, TextEditImp, SyntaxTimerHdl ) ); @@ -80,10 +80,10 @@ TextEditImp::~TextEditImp() delete pTextEngine; } -BOOL TextEditImp::ViewMoved() +sal_Bool TextEditImp::ViewMoved() { - BOOL bOld = bViewMoved; - bViewMoved = FALSE; + sal_Bool bOld = bViewMoved; + bViewMoved = sal_False; return bOld; } @@ -99,7 +99,7 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) pAppEdit->pVScroll->SetThumbPos( pTextView->GetStartDocPos().Y() ); if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->Scroll( 0, ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->GetCurYOffset() - pTextView->GetStartDocPos().Y() ); - bViewMoved = TRUE; + bViewMoved = sal_True; } else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED ) { @@ -115,8 +115,8 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED ) { - ULONG nWidth = pTextEngine->CalcTextWidth(); - if ( (ULONG)nWidth != pAppEdit->nCurTextWidth ) + sal_uIntPtr nWidth = pTextEngine->CalcTextWidth(); + if ( (sal_uIntPtr)nWidth != pAppEdit->nCurTextWidth ) { pAppEdit->nCurTextWidth = nWidth; if ( pAppEdit->pHScroll ) @@ -129,12 +129,12 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) else if( rTextHint.GetId() == TEXT_HINT_PARAINSERTED ) { if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) - ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, TRUE ); + ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, sal_True ); } else if( rTextHint.GetId() == TEXT_HINT_PARAREMOVED ) { if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) - ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, FALSE ); + ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, sal_False ); // Itchy adaption for two signs at line ends instead of one (hard coded default) pTextEngine->SetMaxTextLen( STRING_MAXLEN - pTextEngine->GetParagraphCount() ); @@ -189,12 +189,12 @@ int TextAttribSpechial::operator==( const TextAttrib& rAttr ) const ( maFontWeight == ((const TextAttribSpechial&)rAttr).maFontWeight ) ); } -void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) +void TextEditImp::ImpDoHighlight( const String& rSource, sal_uIntPtr nLineOff ) { SbTextPortions aPortionList; pAppEdit->GetBasicFrame()->Basic().Highlight( rSource, aPortionList ); - USHORT nCount = aPortionList.Count(); + sal_uInt16 nCount = aPortionList.Count(); if ( !nCount ) return; @@ -211,8 +211,8 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) } // here is the postprocessing for types for the TestTool - USHORT i; - BOOL bWasTTControl = FALSE; + sal_uInt16 i; + sal_Bool bWasTTControl = sal_False; for ( i = 0; i < aPortionList.Count(); i++ ) { SbTextPortion& r = aPortionList[i]; @@ -230,20 +230,20 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) r.eType = pAppEdit->GetBasicFrame()->Basic().GetSymbolType( aSymbol, bWasTTControl ); if ( r.eType == TT_CONTROL ) - bWasTTControl = TRUE; + bWasTTControl = sal_True; else - bWasTTControl = FALSE; + bWasTTControl = sal_False; } break; case SB_PUNCTUATION: { String aPunctuation = rSource.Copy( r.nStart, r.nEnd - r.nStart +1 ); if ( aPunctuation.CompareToAscii( "." ) != COMPARE_EQUAL ) - bWasTTControl = FALSE; + bWasTTControl = sal_False; } break; default: - bWasTTControl = FALSE; + bWasTTControl = sal_False; } } @@ -273,7 +273,7 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) r.nEnd = rSource.Len()-1; } - BOOL bWasModified = pTextEngine->IsModified(); + sal_Bool bWasModified = pTextEngine->IsModified(); for ( i = 0; i < aPortionList.Count(); i++ ) { SbTextPortion& r = aPortionList[i]; @@ -283,7 +283,7 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) SbTextType eCol = r.eType; Color aColor; - ULONG nLine = nLineOff+r.nLine-1; // -1, because BASIC starts with 1 + sal_uIntPtr nLine = nLineOff+r.nLine-1; // -1, because BASIC starts with 1 switch ( +eCol ) { case SB_KEYWORD: @@ -336,7 +336,7 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) pTextEngine->SetModified( bWasModified ); } -void TextEditImp::DoSyntaxHighlight( ULONG nPara ) +void TextEditImp::DoSyntaxHighlight( sal_uIntPtr nPara ) { // Due to delayed syntax highlight it can happend that the // paragraph does no longer exist @@ -362,7 +362,7 @@ void TextEditImp::DoDelayedSyntaxHighlight( xub_StrLen nPara ) { if ( bDelayHighlight ) { - aSyntaxLineTable.Insert( nPara, (void*)(ULONG)1 ); + aSyntaxLineTable.Insert( nPara, (void*)(sal_uIntPtr)1 ); aSyntaxIdleTimer.Start(); } else @@ -373,38 +373,38 @@ void TextEditImp::DoDelayedSyntaxHighlight( xub_StrLen nPara ) IMPL_LINK( TextEditImp, SyntaxTimerHdl, Timer *, EMPTYARG ) { DBG_ASSERT( pTextView, "Not yet a View but Syntax-Highlight ?!" ); - pTextEngine->SetUpdateMode( FALSE ); + pTextEngine->SetUpdateMode( sal_False ); - bHighlightning = TRUE; - USHORT nLine; + bHighlightning = sal_True; + sal_uInt16 nLine; while ( aSyntaxLineTable.First() && !Application::AnyInput( INPUT_MOUSEANDKEYBOARD ) ) { - nLine = (USHORT)aSyntaxLineTable.GetCurKey(); + nLine = (sal_uInt16)aSyntaxLineTable.GetCurKey(); DoSyntaxHighlight( nLine ); aSyntaxLineTable.Remove( nLine ); /* if ( Application::AnyInput() ) { aSyntaxIdleTimer.Start(); // Starten, falls wir in einem Dialog landen - pTextView->ShowCursor( TRUE, TRUE ); - pTextEngine->SetUpdateMode( TRUE ); - bHighlightning = FALSE; + pTextView->ShowCursor( sal_True, sal_True ); + pTextEngine->SetUpdateMode( sal_True ); + bHighlightning = sal_False; GetpApp()->Reschedule(); - bHighlightning = TRUE; - pTextEngine->SetUpdateMode( FALSE ); + bHighlightning = sal_True; + pTextEngine->SetUpdateMode( sal_False ); }*/ } - BOOL bWasModified = pTextEngine->IsModified(); + sal_Bool bWasModified = pTextEngine->IsModified(); if ( aSyntaxLineTable.Count() > 3 ) // Without VDev { - pTextEngine->SetUpdateMode( TRUE ); - pTextView->ShowCursor( TRUE, TRUE ); + pTextEngine->SetUpdateMode( sal_True ); + pTextView->ShowCursor( sal_True, sal_True ); } else - pTextEngine->SetUpdateMode( TRUE ); // ! With VDev + pTextEngine->SetUpdateMode( sal_True ); // ! With VDev // pTextView->ForceUpdate(); - // SetUpdateMode( TRUE ) soll kein Modify setzen + // SetUpdateMode( sal_True ) soll kein Modify setzen pTextEngine->SetModified( bWasModified ); // SyntaxTimerHdl wird gerufen, wenn Text-Aenderung @@ -413,7 +413,7 @@ IMPL_LINK( TextEditImp, SyntaxTimerHdl, Timer *, EMPTYARG ) // nCurTextWidth = pTextEngine->CalcTextWidth(); // if ( nCurTextWidth != nPrevTextWidth ) // SetScrollBarRanges(); - bHighlightning = FALSE; + bHighlightning = sal_False; if ( aSyntaxLineTable.First() ) aImplSyntaxIdleTimer.Start(); @@ -430,7 +430,7 @@ void TextEditImp::InvalidateSyntaxHighlight() DoDelayedSyntaxHighlight( i ); } -void TextEditImp::SyntaxHighlight( BOOL bNew ) +void TextEditImp::SyntaxHighlight( sal_Bool bNew ) { if ( ( bNew && bDoSyntaxHighlight ) || ( !bNew && !bDoSyntaxHighlight ) ) return; @@ -447,13 +447,13 @@ void TextEditImp::SyntaxHighlight( BOOL bNew ) else { aSyntaxIdleTimer.Stop(); - pTextEngine->SetUpdateMode( FALSE ); - for ( ULONG i = 0; i < pTextEngine->GetParagraphCount(); i++ ) + pTextEngine->SetUpdateMode( sal_False ); + for ( sal_uIntPtr i = 0; i < pTextEngine->GetParagraphCount(); i++ ) pTextEngine->RemoveAttribs( i ); // pTextEngine->QuickFormatDoc(); - pTextEngine->SetUpdateMode( TRUE ); - pTextView->ShowCursor(TRUE, TRUE ); + pTextEngine->SetUpdateMode( sal_True ); + pTextView->ShowCursor(sal_True, sal_True ); } } @@ -463,15 +463,15 @@ void TextEditImp::SetFont( const Font& rNewFont ) pTextEngine->SetFont(rNewFont); } -BOOL TextEditImp::IsModified() +sal_Bool TextEditImp::IsModified() { return pTextEngine->IsModified(); } void TextEditImp::KeyInput( const KeyEvent& rKeyEvent ) { - BOOL bWasModified = pTextView->GetTextEngine()->IsModified(); - pTextView->GetTextEngine()->SetModified( FALSE ); + sal_Bool bWasModified = pTextView->GetTextEngine()->IsModified(); + pTextView->GetTextEngine()->SetModified( sal_False ); if ( !pTextView->KeyInput( rKeyEvent ) ) Window::KeyInput( rKeyEvent ); @@ -487,8 +487,8 @@ void TextEditImp::MouseButtonUp( const MouseEvent& rMouseEvent ){ pTextView->Mou //void TextEditImp::MouseButtonDown( const MouseEvent& rMouseEvent ){ pTextView->MouseButtonDown( rMouseEvent );} //void TextEditImp::MouseMove( const MouseEvent& rMouseEvent ){ pTextView->MouseMove( rMouseEvent );} //void TextEditImp::Command( const CommandEvent& rCEvt ){ pTextView->Command( rCEvt );} -//BOOL TextEditImp::Drop( const DropEvent& rEvt ){ return FALSE /*pTextView->Drop( rEvt )*/;} -//BOOL TextEditImp::QueryDrop( DropEvent& rEvt ){ return FALSE /*pTextView->QueryDrop( rEvt )*/;} +//sal_Bool TextEditImp::Drop( const DropEvent& rEvt ){ return sal_False /*pTextView->Drop( rEvt )*/;} +//sal_Bool TextEditImp::QueryDrop( DropEvent& rEvt ){ return sal_False /*pTextView->QueryDrop( rEvt )*/;} void TextEditImp::Command( const CommandEvent& rCEvt ) @@ -550,10 +550,10 @@ SbxBase* TextEditImp::GetSbxAtMousePos( String &aWord ) if ( aSuffixes.Search( aWord.GetChar(nLastChar) ) != STRING_NOTFOUND ) aWord.Erase( nLastChar, 1 ); // because perhaps TestTools throws an error - BOOL bWasError = SbxBase::IsError(); - pAppEdit->GetBasicFrame()->Basic().DebugFindNoErrors( TRUE ); + sal_Bool bWasError = SbxBase::IsError(); + pAppEdit->GetBasicFrame()->Basic().DebugFindNoErrors( sal_True ); SbxBase* pSBX = StarBASIC::FindSBXInCurrentScope( aWord ); - pAppEdit->GetBasicFrame()->Basic().DebugFindNoErrors( FALSE ); + pAppEdit->GetBasicFrame()->Basic().DebugFindNoErrors( sal_False ); DBG_ASSERT( !( !bWasError && SbxBase::IsError()), "Error generated while retrieving Variable data for viewing" ); if ( !bWasError && SbxBase::IsError() ) SbxBase::ResetError(); @@ -679,8 +679,8 @@ DBG_NAME(TextEdit) TextEdit::TextEdit( AppEdit* pParent, const WinBits& aBits ) : pBreakpointWindow( NULL ) -, bFileWasUTF8( FALSE ) -, bSaveAsUTF8( FALSE ) +, bFileWasUTF8( sal_False ) +, bSaveAsUTF8( sal_False ) , aEdit( pParent, aBits | WB_NOHIDESELECTION ) { DBG_CTOR(TextEdit,0); @@ -689,7 +689,7 @@ DBG_CTOR(TextEdit,0); TextEdit::~TextEdit() {DBG_DTOR(TextEdit,0);} -void TextEdit::Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) +void TextEdit::Highlight( sal_uIntPtr nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) { if ( nLine ) // Should not occure but at 'Sub expected' in first line nLine--; @@ -715,7 +715,7 @@ void TextEdit::Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) // Because nCol2 *may* point after the current statement // (because the next one starts there) there are space // that must be removed - BOOL bColon = FALSE; + sal_Bool bColon = sal_False; while ( s.GetChar( nCol2 ) == ' ' && nCol2 > nCol1 && !bColon ) { @@ -723,7 +723,7 @@ void TextEdit::Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) if ( s.GetChar( nCol2 ) == ':' ) { nCol2--; - bColon = TRUE; + bColon = sal_True; } } @@ -748,31 +748,31 @@ String TextEdit::GetSelected(){ return aEdit.pTextView->GetSelected(); } TextSelection TextEdit::GetSelection() const{ return aEdit.pTextView->GetSelection(); } void TextEdit::SetSelection( const TextSelection& rSelection ){ aEdit.pTextView->SetSelection( rSelection ); } -USHORT TextEdit::GetLineNr() const +sal_uInt16 TextEdit::GetLineNr() const { - return sal::static_int_cast< USHORT >( + return sal::static_int_cast< sal_uInt16 >( aEdit.pTextView->GetSelection().GetEnd().GetPara()+1); } void TextEdit::ReplaceSelected( const String& rStr ){ aEdit.pTextView->InsertText(rStr); } -BOOL TextEdit::IsModified(){ return aEdit.IsModified(); } +sal_Bool TextEdit::IsModified(){ return aEdit.IsModified(); } String TextEdit::GetText() const { return aEdit.pTextEngine->GetText( GetSystemLineEnd() ); } -void TextEdit::SetText( const String& rStr ){ aEdit.pTextEngine->SetText(rStr); aEdit.pTextEngine->SetModified( FALSE ); } +void TextEdit::SetText( const String& rStr ){ aEdit.pTextEngine->SetText(rStr); aEdit.pTextEngine->SetModified( sal_False ); } void TextEdit::SetModifyHdl( Link l ){ aEdit.SetModifyHdl(l); } -BOOL TextEdit::HasText() const { return aEdit.pTextEngine->GetTextLen() > 0; } +sal_Bool TextEdit::HasText() const { return aEdit.pTextEngine->GetTextLen() > 0; } // Search from the beginning or at mark + 1 -BOOL TextEdit::Find( const String& s ) +sal_Bool TextEdit::Find( const String& s ) { DBG_CHKTHIS(TextEdit,0); TextSelection aSelection = aEdit.pTextView->GetSelection(); - ULONG nPara = aSelection.GetStart().GetPara(); + sal_uIntPtr nPara = aSelection.GetStart().GetPara(); xub_StrLen nIndex = aSelection.GetStart().GetIndex(); if ( aSelection.HasRange() ) @@ -786,23 +786,23 @@ BOOL TextEdit::Find( const String& s ) if( nIndex != STRING_NOTFOUND ) { aEdit.pTextView->SetSelection( TextSelection( TextPaM( nPara, nIndex ), TextPaM( nPara, nIndex + s.Len() ) ) ); - return TRUE; + return sal_True; } nIndex = 0; nPara++; } - return FALSE; + return sal_False; } -BOOL TextEdit::Load( const String& aName ) +sal_Bool TextEdit::Load( const String& aName ) { DBG_CHKTHIS(TextEdit,0); - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; SvFileStream aStrm( aName, STREAM_STD_READ ); if( aStrm.IsOpen() ) { String aText, aLine, aLineBreak; - BOOL bIsFirstLine = TRUE; + sal_Bool bIsFirstLine = sal_True; aLineBreak += '\n'; aLineBreak.ConvertLineEnd(); rtl_TextEncoding aFileEncoding = RTL_TEXTENCODING_IBM_850; @@ -812,29 +812,29 @@ DBG_CHKTHIS(TextEdit,0); if ( bIsFirstLine && IsTTSignatureForUnicodeTextfile( aLine ) ) { aFileEncoding = RTL_TEXTENCODING_UTF8; - bFileWasUTF8 = TRUE; + bFileWasUTF8 = sal_True; } else { if ( !bIsFirstLine ) aText += aLineBreak; aText += aLine; - bIsFirstLine = FALSE; + bIsFirstLine = sal_False; } if( aStrm.GetError() != SVSTREAM_OK ) - bOk = FALSE; + bOk = sal_False; } SetText( aText ); } else - bOk = FALSE; + bOk = sal_False; return bOk; } -BOOL TextEdit::Save( const String& aName ) +sal_Bool TextEdit::Save( const String& aName ) { DBG_CHKTHIS(TextEdit,0); - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; SvFileStream aStrm( aName, STREAM_STD_WRITE | STREAM_TRUNC ); rtl_TextEncoding aFileEncoding = RTL_TEXTENCODING_IBM_850; if( aStrm.IsOpen() ) @@ -849,10 +849,10 @@ DBG_CHKTHIS(TextEdit,0); aSave.ConvertLineEnd(LINEEND_LF); aStrm << ByteString( aSave, aFileEncoding ).GetBuffer(); if( aStrm.GetError() != SVSTREAM_OK ) - bOk = FALSE; + bOk = sal_False; else - aEdit.pTextEngine->SetModified(FALSE); - } else bOk = FALSE; + aEdit.pTextEngine->SetModified(sal_False); + } else bOk = sal_False; return bOk; } diff --git a/basic/source/app/textedit.hxx b/basic/source/app/textedit.hxx index 354c94dc44ab..404dc4acb2bd 100644 --- a/basic/source/app/textedit.hxx +++ b/basic/source/app/textedit.hxx @@ -49,7 +49,7 @@ class TextEditImp : public Window, public SfxListener using Window::Notify; protected: - void DoSyntaxHighlight( ULONG nPara ); + void DoSyntaxHighlight( sal_uIntPtr nPara ); private: @@ -63,10 +63,10 @@ private: void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - void ImpDoHighlight( const String& rSource, ULONG nLineOff ); - BOOL bHighlightning; - BOOL bDoSyntaxHighlight; - BOOL bDelayHighlight; + void ImpDoHighlight( const String& rSource, sal_uIntPtr nLineOff ); + sal_Bool bHighlightning; + sal_Bool bDoSyntaxHighlight; + sal_Bool bDelayHighlight; SbxBase* GetSbxAtMousePos( String &aWord ); @@ -75,12 +75,12 @@ private: DECL_LINK( ShowVarContents, void* ); Point aTipPos; String aTipWord; - ULONG nTipId; + sal_uIntPtr nTipId; Timer HideTipTimer; Timer ShowTipTimer; - BOOL bViewMoved; + sal_Bool bViewMoved; public: TextEditImp( AppEdit *pParent, const WinBits& aBits ); @@ -90,7 +90,7 @@ public: TextView *pTextView; void SetFont( const Font& rNewFont ); - BOOL IsModified(); + sal_Bool IsModified(); void SetModifyHdl( Link l ){ ModifyHdl = l; } void KeyInput( const KeyEvent& rKeyEvent ); @@ -99,14 +99,14 @@ public: void MouseButtonDown( const MouseEvent& rMouseEvent ); // void MouseMove( const MouseEvent& rMouseEvent ); void Command( const CommandEvent& rCEvt ); - //BOOL Drop( const DropEvent& rEvt ); - //BOOL QueryDrop( DropEvent& rEvt ); + //sal_Bool Drop( const DropEvent& rEvt ); + //sal_Bool QueryDrop( DropEvent& rEvt ); - BOOL ViewMoved(); + sal_Bool ViewMoved(); void DoDelayedSyntaxHighlight( xub_StrLen nPara ); void InvalidateSyntaxHighlight(); - void SyntaxHighlight( BOOL bNew ); + void SyntaxHighlight( sal_Bool bNew ); void BuildKontextMenu( PopupMenu *&pMenu ); }; @@ -116,13 +116,13 @@ DBG_NAMEEX(TextEdit) class TextEdit : public DataEdit { BreakpointWindow *pBreakpointWindow; - BOOL bFileWasUTF8; - BOOL bSaveAsUTF8; + sal_Bool bFileWasUTF8; + sal_Bool bSaveAsUTF8; public: TextEdit( AppEdit*, const WinBits& ); ~TextEdit(); - void Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); + void Highlight( sal_uIntPtr nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); TextEditImp& GetTextEditImp() { return aEdit; } void SetBreakpointWindow( BreakpointWindow *pBPWindow ){ pBreakpointWindow = pBPWindow; } @@ -132,7 +132,7 @@ public: virtual void BuildKontextMenu( PopupMenu *&pMenu ); - void SaveAsUTF8( BOOL bUTF8 ) { bSaveAsUTF8 = bUTF8; } + void SaveAsUTF8( sal_Bool bUTF8 ) { bSaveAsUTF8 = bUTF8; } }; #endif |