diff options
Diffstat (limited to 'basctl/source/basicide/macrodlg.cxx')
-rw-r--r-- | basctl/source/basicide/macrodlg.cxx | 79 |
1 files changed, 40 insertions, 39 deletions
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index f39f0d214d4c..f6fdd7754805 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -63,7 +63,7 @@ using ::std::pair; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -MacroChooser::MacroChooser( Window* pParnt, BOOL bCreateEntries ) : +MacroChooser::MacroChooser( Window* pParnt, sal_Bool bCreateEntries ) : SfxModalDialog( pParnt, IDEResId( RID_MACROCHOOSER ) ), aMacroNameTxt( this, IDEResId( RID_TXT_MACRONAME ) ), aMacroNameEdit( this, IDEResId( RID_ED_MACRONAME ) ), @@ -85,12 +85,12 @@ MacroChooser::MacroChooser( Window* pParnt, BOOL bCreateEntries ) : FreeResource(); nMode = MACROCHOOSER_ALL; - bNewDelIsDel = TRUE; + bNewDelIsDel = sal_True; // Der Sfx fragt den BasicManager nicht, ob modified // => Speichern anschmeissen, wenn Aenderung, aber kein Sprung in // die BasicIDE. - bForceStoreBasic = FALSE; + bForceStoreBasic = sal_False; aMacrosInTxtBaseStr = aMacrosInTxt.GetText(); @@ -121,9 +121,10 @@ MacroChooser::MacroChooser( Window* pParnt, BOOL bCreateEntries ) : aMacroBox.SetSelectHdl( LINK( this, MacroChooser, MacroSelectHdl ) ); aBasicBox.SetMode( BROWSEMODE_MODULES ); - aBasicBox.SetWindowBits( WB_HASLINES | WB_HASLINESATROOT | - WB_HASBUTTONS | WB_HASBUTTONSATROOT | - WB_HSCROLL ); + aBasicBox.SetStyle( WB_TABSTOP | WB_BORDER | + WB_HASLINES | WB_HASLINESATROOT | + WB_HASBUTTONS | WB_HASBUTTONSATROOT | + WB_HSCROLL ); BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL; @@ -187,7 +188,7 @@ void MacroChooser::RestoreMacroDescription() { // find entry in macro box SvLBoxEntry* pEntry = 0; - ULONG nPos = 0; + sal_uLong nPos = 0; SvLBoxEntry* pE = aMacroBox.GetEntry( nPos ); while ( pE ) { @@ -223,7 +224,7 @@ short MacroChooser::Execute() if( rSelectedDoc.isDocument() && !rSelectedDoc.isActive() ) { // Search for the right entry - ULONG nRootPos = 0; + sal_uLong nRootPos = 0; SvLBoxEntry* pRootEntry = aBasicBox.GetEntry( nRootPos ); while( pRootEntry ) { @@ -261,7 +262,7 @@ short MacroChooser::Execute() } -void MacroChooser::EnableButton( Button& rButton, BOOL bEnable ) +void MacroChooser::EnableButton( Button& rButton, sal_Bool bEnable ) { if ( bEnable ) { @@ -332,10 +333,10 @@ void MacroChooser::DeleteMacro() SbModule* pModule = pMethod->GetModule(); DBG_ASSERT( pModule, "DeleteMacro: Kein Modul?!" ); ::rtl::OUString aSource( pModule->GetSource32() ); - USHORT nStart, nEnd; + sal_uInt16 nStart, nEnd; pMethod->GetLineRange( nStart, nEnd ); pModule->GetMethods()->Remove( pMethod ); - CutLines( aSource, nStart-1, nEnd-nStart+1, TRUE ); + CutLines( aSource, nStart-1, nEnd-nStart+1, sal_True ); pModule->SetSource32( aSource ); // update module in library @@ -346,7 +347,7 @@ void MacroChooser::DeleteMacro() SvLBoxEntry* pEntry = aMacroBox.FirstSelected(); DBG_ASSERT( pEntry, "DeleteMacro: Entry ?!" ); aMacroBox.GetModel()->Remove( pEntry ); - bForceStoreBasic = TRUE; + bForceStoreBasic = sal_True; } } @@ -428,8 +429,8 @@ void MacroChooser::CheckButtons() SbMethod* pMethod = GetMacro(); // check, if corresponding libraries are readonly - BOOL bReadOnly = FALSE; - USHORT nDepth = pCurEntry ? aBasicBox.GetModel()->GetDepth( pCurEntry ) : 0; + sal_Bool bReadOnly = sal_False; + sal_uInt16 nDepth = pCurEntry ? aBasicBox.GetModel()->GetDepth( pCurEntry ) : 0; if ( nDepth == 1 || nDepth == 2 ) { ScriptDocument aDocument( aDesc.GetDocument() ); @@ -439,26 +440,26 @@ void MacroChooser::CheckButtons() if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryReadOnly( aOULibName ) ) || ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) && xDlgLibContainer->isLibraryReadOnly( aOULibName ) ) ) { - bReadOnly = TRUE; + bReadOnly = sal_True; } } if ( nMode != MACROCHOOSER_RECORDING ) { // Run... - BOOL bEnable = pMethod ? TRUE : FALSE; + sal_Bool bEnable = pMethod ? sal_True : sal_False; if ( ( nMode != MACROCHOOSER_CHOOSEONLY ) && StarBASIC::IsRunning() ) - bEnable = FALSE; + bEnable = sal_False; EnableButton( aRunButton, bEnable ); } // Organisieren immer moeglich ? // Assign... - EnableButton( aAssignButton, pMethod ? TRUE : FALSE ); + EnableButton( aAssignButton, pMethod ? sal_True : sal_False ); // Edit... - EnableButton( aEditButton, pMacroEntry ? TRUE : FALSE ); + EnableButton( aEditButton, pMacroEntry ? sal_True : sal_False ); // aOrganizeButton EnableButton( aOrganizeButton, !StarBASIC::IsRunning() && ( nMode == MACROCHOOSER_ALL )); @@ -468,8 +469,8 @@ void MacroChooser::CheckButtons() bool bShare = ( aDesc.GetLocation() == LIBRARY_LOCATION_SHARE ); EnableButton( aNewDelButton, !StarBASIC::IsRunning() && ( nMode == MACROCHOOSER_ALL ) && !bProtected && !bReadOnly && !bShare ); - BOOL bPrev = bNewDelIsDel; - bNewDelIsDel = pMethod ? TRUE : FALSE; + sal_Bool bPrev = bNewDelIsDel; + bNewDelIsDel = pMethod ? sal_True : sal_False; if ( ( bPrev != bNewDelIsDel ) && ( nMode == MACROCHOOSER_ALL ) ) { String aBtnText( bNewDelIsDel ? IDEResId( RID_STR_BTNDEL) : IDEResId( RID_STR_BTNNEW ) ); @@ -568,10 +569,10 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) aMacros.insert( map< sal_uInt16, SbMethod*>::value_type( nStart, pMethod ) ); } - aMacroBox.SetUpdateMode( FALSE ); + aMacroBox.SetUpdateMode( sal_False ); for ( map< sal_uInt16, SbMethod* >::iterator it = aMacros.begin(); it != aMacros.end(); ++it ) aMacroBox.InsertEntry( (*it).second->GetName() ); - aMacroBox.SetUpdateMode( TRUE ); + aMacroBox.SetUpdateMode( sal_True ); if ( aMacroBox.GetEntryCount() ) { @@ -597,7 +598,7 @@ IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); if ( pCurEntry ) { - USHORT nDepth = aBasicBox.GetModel()->GetDepth( pCurEntry ); + sal_uInt16 nDepth = aBasicBox.GetModel()->GetDepth( pCurEntry ); if ( ( nDepth == 1 ) && ( aBasicBox.IsEntryProtected( pCurEntry ) ) ) { // Dann auf die entsprechende Std-Lib stellen... @@ -621,15 +622,15 @@ IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) if ( aMacroBox.GetEntryCount() ) { String aEdtText( aMacroNameEdit.GetText() ); - BOOL bFound = FALSE; - for ( USHORT n = 0; n < aMacroBox.GetEntryCount(); n++ ) + sal_Bool bFound = sal_False; + for ( sal_uInt16 n = 0; n < aMacroBox.GetEntryCount(); n++ ) { SvLBoxEntry* pEntry = aMacroBox.GetEntry( n ); DBG_ASSERT( pEntry, "Entry ?!" ); if ( aMacroBox.GetEntryText( pEntry ).CompareIgnoreCaseToAscii( aEdtText ) == COMPARE_EQUAL ) { SaveSetCurEntry( aMacroBox, pEntry ); - bFound = TRUE; + bFound = sal_True; break; } } @@ -638,7 +639,7 @@ IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) SvLBoxEntry* pEntry = aMacroBox.FirstSelected(); // Wenn es den Eintrag gibt ->Select ->Desription... if ( pEntry ) - aMacroBox.Select( pEntry, FALSE ); + aMacroBox.Select( pEntry, sal_False ); } } } @@ -675,7 +676,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) } else if ( nMode == MACROCHOOSER_RECORDING ) { - BOOL bValid = BasicIDE::IsValidSbxName( aMacroNameEdit.GetText() ); + sal_Bool bValid = BasicIDE::IsValidSbxName( aMacroNameEdit.GetText() ); if ( !bValid ) { ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); @@ -752,7 +753,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) } else { - BOOL bValid = BasicIDE::IsValidSbxName( aMacroNameEdit.GetText() ); + sal_Bool bValid = BasicIDE::IsValidSbxName( aMacroNameEdit.GetText() ); if ( !bValid ) { ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); @@ -827,7 +828,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( aBasicBox.FirstSelected() ) ); OrganizeDialog* pDlg = new OrganizeDialog( this, 0, aDesc ); - USHORT nRet = pDlg->Execute(); + sal_uInt16 nRet = pDlg->Execute(); delete pDlg; if ( nRet ) // Nicht einfach nur geschlossen @@ -838,7 +839,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); if ( pIDEShell && pIDEShell->IsAppBasicModified() ) - bForceStoreBasic = TRUE; + bForceStoreBasic = sal_True; aBasicBox.UpdateEntries(); } @@ -857,26 +858,26 @@ void MacroChooser::UpdateFields() aMacroNameEdit.SetText( aMacroBox.GetEntryText( pMacroEntry ) ); } -void MacroChooser::SetMode( USHORT nM ) +void MacroChooser::SetMode( sal_uInt16 nM ) { nMode = nM; if ( nMode == MACROCHOOSER_ALL ) { aRunButton.SetText( String( IDEResId( RID_STR_RUN ) ) ); - EnableButton( aNewDelButton, TRUE ); - EnableButton( aOrganizeButton, TRUE ); + EnableButton( aNewDelButton, sal_True ); + EnableButton( aOrganizeButton, sal_True ); } else if ( nMode == MACROCHOOSER_CHOOSEONLY ) { aRunButton.SetText( String( IDEResId( RID_STR_CHOOSE ) ) ); - EnableButton( aNewDelButton, FALSE ); - EnableButton( aOrganizeButton, FALSE ); + EnableButton( aNewDelButton, sal_False ); + EnableButton( aOrganizeButton, sal_False ); } else if ( nMode == MACROCHOOSER_RECORDING ) { aRunButton.SetText( String( IDEResId( RID_STR_RECORD ) ) ); - EnableButton( aNewDelButton, FALSE ); - EnableButton( aOrganizeButton, FALSE ); + EnableButton( aNewDelButton, sal_False ); + EnableButton( aOrganizeButton, sal_False ); aAssignButton.Hide(); aEditButton.Hide(); |