diff options
Diffstat (limited to 'svtools/source/dialogs/filedlg2.cxx')
-rw-r--r-- | svtools/source/dialogs/filedlg2.cxx | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx index a2c68270ed81..6e6fd4fd2e84 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -73,9 +73,9 @@ DECLARE_LIST( UniStringList, UniString* ) p->Show(); -inline BOOL IsPrintable( sal_Unicode c ) +inline sal_Bool IsPrintable( sal_Unicode c ) { - return c >= 32 && c != 127 ? TRUE : FALSE; + return c >= 32 && c != 127 ? sal_True : sal_False; } long @@ -88,10 +88,10 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt ) if ( IsPrintable ( cCharCode ) ) { - USHORT nCurrentPos = GetSelectEntryPos(); - USHORT nEntries = GetEntryCount(); + sal_uInt16 nCurrentPos = GetSelectEntryPos(); + sal_uInt16 nEntries = GetEntryCount(); - for ( USHORT i = 1; i < nEntries; i++ ) + for ( sal_uInt16 i = 1; i < nEntries; i++ ) { UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries ); aEntry.EraseLeadingChars( ' ' ); @@ -116,7 +116,7 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt ) return ListBox::PreNotify ( rNEvt ); } -ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir ) +ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir ) { pSvPathDialog = pDlg; nDirCount = 0; @@ -287,14 +287,14 @@ IMPL_LINK( ImpPathDialog, SelectHdl, ListBox *, p ) UniString aEntry( pDirList->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item DirEntry aNewPath; aNewPath.ToAbs(); - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wird nach oben gewechselt if( nCurPos < nDirCount ) @@ -321,7 +321,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn ) // Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aFile; aPath.ToAbs(); - GetPathDialog()->EndDialog( TRUE ); + GetPathDialog()->EndDialog( sal_True ); } else { @@ -338,7 +338,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn ) else if ( pBtn == pCancelBtn ) { - GetPathDialog()->EndDialog( FALSE ); + GetPathDialog()->EndDialog( sal_False ); } else if ( pBtn == pHomeBtn ) @@ -380,7 +380,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) UniString aEntry( pBox->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item @@ -388,7 +388,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) aNewPath.ToAbs(); if( pBox == pDirList ) { - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wenn es schon das aktuelle ist, dann mache nichts if( nCurPos == nDirCount-1 ) @@ -409,22 +409,22 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) { // Neuen Pfad setzen und Listboxen updaten aPath = aNewPath; - if( !aPath.SetCWD( TRUE ) ) + if( !aPath.SetCWD( sal_True ) ) { ErrorBox aBox( GetPathDialog(), WB_OK_CANCEL | WB_DEF_OK, UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ); if( aBox.Execute() == RET_CANCEL ) - GetPathDialog()->EndDialog( FALSE ); + GetPathDialog()->EndDialog( sal_False ); } - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); } pSvPathDialog->LeaveWait(); return 0; } -void ImpPathDialog::UpdateEntries( const BOOL ) +void ImpPathDialog::UpdateEntries( const sal_Bool ) { UniString aTabString; DirEntry aTmpPath; @@ -432,10 +432,10 @@ void ImpPathDialog::UpdateEntries( const BOOL ) nDirCount = aTmpPath.Level(); - pDirList->SetUpdateMode( FALSE ); + pDirList->SetUpdateMode( sal_False ); pDirList->Clear(); - for( USHORT i = nDirCount; i > 0; i-- ) + for( sal_uInt16 i = nDirCount; i > 0; i-- ) { UniString aName( aTabString ); aName += aTmpPath[i-1].GetName(); @@ -449,11 +449,11 @@ void ImpPathDialog::UpdateEntries( const BOOL ) Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE ); - USHORT nEntries = aDir.Count(); + sal_uInt16 nEntries = aDir.Count(); if( nEntries ) { UniStringList aSortDirList; - for ( USHORT n = 0; n < nEntries; n++ ) + for ( sal_uInt16 n = 0; n < nEntries; n++ ) { DirEntry& rEntry = aDir[n]; UniString aName( rEntry.GetName() ); @@ -461,7 +461,7 @@ void ImpPathDialog::UpdateEntries( const BOOL ) { if( FileStat( rEntry ).GetKind() & FSYS_KIND_DIR ) { - ULONG l = 0; + sal_uLong l = 0; if( xCollator.is() ) { for( l = 0; l < aSortDirList.Count(); l++ ) @@ -473,7 +473,7 @@ void ImpPathDialog::UpdateEntries( const BOOL ) } } - for( ULONG l = 0; l < aSortDirList.Count(); l++ ) + for( sal_uLong l = 0; l < aSortDirList.Count(); l++ ) { UniString aEntryStr( aTabString ); aEntryStr += *aSortDirList.GetObject(l); @@ -491,7 +491,7 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath ) pDirList->SetTopEntry( nDirCount > 1 ? nDirCount - 2 : nDirCount - 1 ); - pDirList->SetUpdateMode( TRUE ); + pDirList->SetUpdateMode( sal_True ); pDirList->Invalidate(); pDirList->Update(); @@ -502,10 +502,10 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath ) pEdit->SetText( aDirName ); } -BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) +sal_Bool ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) { if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) ) - return FALSE; + return sal_False; else { // Datei vorhanden ? @@ -519,7 +519,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) if( aQuery.Execute() == RET_YES ) rDirEntry.MakeDir(); else - return FALSE; + return sal_False; } if( !FileStat( rDirEntry ).IsKind( FSYS_KIND_DIR ) ) { @@ -529,7 +529,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) aBoxText.AppendAscii( "]" ); InfoBox aBox( GetPathDialog(), aBoxText ); aBox.Execute(); - return FALSE; + return sal_False; } } return GetPathDialog()->OK() != 0; @@ -539,8 +539,8 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) void ImpPathDialog::PreExecute() { // Neues Verzeichnis setzen und Listboxen updaten - aPath.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aPath.SetCWD( sal_True ); + UpdateEntries( sal_True ); // Zusaetzliche Buttons anordnen Point aPos; @@ -563,8 +563,8 @@ void ImpPathDialog::PreExecute() long nMaxWidth = 0; // Maximale Breite ermitteln - USHORT nChilds = GetPathDialog()->GetChildCount(); - USHORT n; + sal_uInt16 nChilds = GetPathDialog()->GetChildCount(); + sal_uInt16 n; for ( n = nOwnChilds; n < nChilds; n++ ) { Window* pChild = GetPathDialog()->GetChild( n ); @@ -624,11 +624,11 @@ void ImpPathDialog::PreExecute() DirEntry aTmpDirEntry; Dir aDir( aTmpDirEntry, FSYS_KIND_BLOCK ); - USHORT nCount = aDir.Count(), i; + sal_uInt16 nCount = aDir.Count(), i; for( i = 0; i < nCount; ++i ) { DirEntry& rEntry = aDir[i]; - UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, FALSE ); + UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, sal_False ); UniString aVolume = rEntry.GetVolume() ; aStr.ToUpperAscii(); @@ -674,8 +674,8 @@ void ImpPathDialog::SetPath( UniString const & rPath ) // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten pEdit->SetText( rPath ); - aFile.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aFile.SetCWD( sal_True ); + UpdateEntries( sal_True ); pSvPathDialog->LeaveWait(); } @@ -697,7 +697,7 @@ UniString ImpPathDialog::GetPath() const ImpFileDialog::ImpFileDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType ) : - ImpPathDialog( pDlg, nType, FALSE ) + ImpPathDialog( pDlg, nType, sal_False ) { bOpen = (nWinBits & WB_SAVEAS) == 0; @@ -838,7 +838,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) UniString aEntry( pBox->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item @@ -848,7 +848,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) if( ( pDirList != pFileList ) && ( pBox == pDirList ) ) { // SVLOOK - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wenn es schon das aktuelle ist, dann mache nichts if( nCurPos == nDirCount-1 ) @@ -877,7 +877,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) { // dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aNewPath; - GetFileDialog()->EndDialog( TRUE ); + GetFileDialog()->EndDialog( sal_True ); } } @@ -890,23 +890,23 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) { // Neuen Pfad setzen und Listboxen updaten aPath = aNewPath; - if( !aPath.SetCWD( TRUE ) ) + if( !aPath.SetCWD( sal_True ) ) { if( ErrorBox( GetFileDialog(), WB_OK_CANCEL|WB_DEF_OK, UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ).Execute() == RET_CANCEL ) { - GetFileDialog()->EndDialog( FALSE ); + GetFileDialog()->EndDialog( sal_False ); } } - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); GetFileDialog()->FileSelect(); } if( pBox == pTypeList ) { // Neue Maske setzen, und Listboxen updaten - USHORT nCurPos = pTypeList->GetSelectEntryPos(); - if( nCurPos+1 > (USHORT)aFilterList.Count() ) + sal_uInt16 nCurPos = pTypeList->GetSelectEntryPos(); + if( nCurPos+1 > (sal_uInt16)aFilterList.Count() ) aMask = UniString::CreateFromAscii( ALLFILES ); else { @@ -918,7 +918,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) } pEdit->SetText( aMask() ); - UpdateEntries( FALSE ); + UpdateEntries( sal_False ); GetFileDialog()->FilterSelect(); } @@ -939,7 +939,7 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn ) // Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aFile; aPath.ToAbs(); - GetFileDialog()->EndDialog( TRUE ); + GetFileDialog()->EndDialog( sal_True ); } else { @@ -954,19 +954,19 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn ) // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten pEdit->SetText( aMask() ); - aFile.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aFile.SetCWD( sal_True ); + UpdateEntries( sal_True ); GetFileDialog()->LeaveWait(); } } else if( pBtn == pCancelBtn ) - GetFileDialog()->EndDialog( FALSE ); + GetFileDialog()->EndDialog( sal_False ); return 0; } -void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) +void ImpFileDialog::UpdateEntries( const sal_Bool bWithDirs ) { GetFileDialog()->EnterWait(); @@ -977,16 +977,16 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) if( pFileList ) { - pFileList->SetUpdateMode( FALSE ); + pFileList->SetUpdateMode( sal_False ); pFileList->Clear(); } if( bWithDirs && (pDirList != pFileList) ) { - pDirList->SetUpdateMode( FALSE ); + pDirList->SetUpdateMode( sal_False ); pDirList->Clear(); - for( USHORT i = nDirCount; i > 0; i-- ) + for( sal_uInt16 i = nDirCount; i > 0; i-- ) { UniString aEntryStr( aTabString ); aEntryStr += aTmpPath[i-1].GetName(); @@ -1005,10 +1005,10 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) DirEntry aCurrent; aCurrent.ToAbs(); Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE ); - USHORT nEntries = aDir.Count(); + sal_uInt16 nEntries = aDir.Count(); // TempMask, weil Vergleich case-sensitiv - BOOL bMatchCase = FALSE; //aCurrent.IsCaseSensitive(); + sal_Bool bMatchCase = sal_False; //aCurrent.IsCaseSensitive(); UniString aWildCard( aMask.GetWildCard() ); if ( !bMatchCase ) aWildCard.ToLowerAscii(); @@ -1016,7 +1016,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) if ( nEntries ) { UniStringList aSortDirList; - for ( USHORT n = 0; n < nEntries; n++ ) + for ( sal_uInt16 n = 0; n < nEntries; n++ ) { DirEntry& rEntry = aDir[n]; UniString aName( rEntry.GetName() ); @@ -1045,7 +1045,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) } else { - ULONG l = 0; + sal_uLong l = 0; if( xCollator.is() ) { for( l = 0; l < aSortDirList.Count(); l++ ) @@ -1057,7 +1057,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) } } } - for( ULONG l = 0; l < aSortDirList.Count(); l++ ) + for( sal_uLong l = 0; l < aSortDirList.Count(); l++ ) { UniString aEntryStr( aTabString ); aEntryStr += *aSortDirList.GetObject(l); @@ -1075,7 +1075,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) pFileList->SelectEntryPos( 1 ); else pFileList->SetNoSelection(); - pFileList->SetUpdateMode( TRUE ); + pFileList->SetUpdateMode( sal_True ); pFileList->Invalidate(); pFileList->Update(); } @@ -1094,14 +1094,14 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) GetFileDialog()->LeaveWait(); } -BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) +sal_Bool ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) { if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) ) - return FALSE; + return sal_False; if( FileStat( rDirEntry ).GetKind() & FSYS_KIND_DIR ) { if( pFileList ) - return FALSE; + return sal_False; } else if( bOpen ) { @@ -1115,7 +1115,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) InfoBox aBox( GetFileDialog(), aErrorString ); aBox.Execute(); - return FALSE; + return sal_False; } } else @@ -1131,7 +1131,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) WinBits( WB_YES_NO | WB_DEF_NO ), aQueryString ); if( aBox.Execute() != RET_YES ) - return FALSE; + return sal_False; } } return GetFileDialog()->OK() != 0; @@ -1160,9 +1160,9 @@ void ImpFileDialog::SetPath( UniString const & rPath ) pEdit->SetText( rPath ); } - aFile.SetCWD( TRUE ); + aFile.SetCWD( sal_True ); - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); GetFileDialog()->LeaveWait(); } @@ -1223,7 +1223,7 @@ void ImpFileDialog::SetCurFilter( const UniString& rFilter ) pItem = aFilterList.Next(); if( pItem ) - pTypeList->SelectEntryPos( (USHORT)aFilterList.GetCurPos() ); + pTypeList->SelectEntryPos( (sal_uInt16)aFilterList.GetCurPos() ); else pTypeList->SetNoSelection(); } @@ -1254,7 +1254,7 @@ void ImpFileDialog::PreExecute() if( pTypeList ) { - USHORT nCurType = pTypeList->GetSelectEntryPos(); + sal_uInt16 nCurType = pTypeList->GetSelectEntryPos(); if( nCurType < aFilterList.Count() ) { UniString aFilterListMask = aFilterList.GetObject( nCurType )->aMask; @@ -1294,7 +1294,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const UniString aPostfix; // hier kommt die ausgesuchte Extension herein // ist ein Filter mit Extension gesetzt? - USHORT nChosenFilterPos = pTypeList->GetSelectEntryPos(); + sal_uInt16 nChosenFilterPos = pTypeList->GetSelectEntryPos(); if( nChosenFilterPos != LISTBOX_ENTRY_NOTFOUND ) { UniString aExtensionMask = GetFileDialog()->GetFilterType( nChosenFilterPos ); @@ -1347,7 +1347,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const } -void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate ) +void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate ) { delete pDlg; if ( nType == WINDOW_PATHDIALOG ) |