summaryrefslogtreecommitdiff
path: root/cui/source/options/dbregister.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/options/dbregister.cxx')
-rw-r--r--cui/source/options/dbregister.cxx80
1 files changed, 13 insertions, 67 deletions
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index a5ae42598841..8c8562527c51 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -126,7 +126,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
pPathBox ( NULL ),
m_pCurEntry ( NULL ),
m_nOldCount ( 0 ),
- m_bModified ( FALSE )
+ m_bModified ( sal_False )
{
m_aNew.SetClickHdl( LINK( this, DbRegistrationOptionsPage, NewHdl ) );
m_aEdit.SetClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
@@ -156,7 +156,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
Size aHeadSize = pHeaderBar->GetSizePixel();
aPathCtrl.SetFocusControl( pPathBox );
- pPathBox->SetWindowBits( nBits );
+ pPathBox->SetStyle( pPathBox->GetStyle()|nBits );
pPathBox->SetDoubleClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
pPathBox->SetSelectHdl( LINK( this, DbRegistrationOptionsPage, PathSelect_Impl ) );
pPathBox->SetSelectionMode( SINGLE_SELECTION );
@@ -183,7 +183,7 @@ DbRegistrationOptionsPage::~DbRegistrationOptionsPage()
aPathCtrl.SetFocusControl( NULL );
pHeaderBar->Hide();
- for ( USHORT i = 0; i < pPathBox->GetEntryCount(); ++i )
+ for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
delete static_cast< DatabaseRegistration* >( pPathBox->GetEntry(i)->GetUserData() );
delete pPathBox;
delete pHeaderBar;
@@ -199,13 +199,13 @@ SfxTabPage* DbRegistrationOptionsPage::Create( Window* pParent,
// -----------------------------------------------------------------------
-BOOL DbRegistrationOptionsPage::FillItemSet( SfxItemSet& rCoreSet )
+sal_Bool DbRegistrationOptionsPage::FillItemSet( SfxItemSet& rCoreSet )
{
// the settings for the single drivers
sal_Bool bModified = sal_False;
DatabaseRegistrations aRegistrations;
- ULONG nCount = pPathBox->GetEntryCount();
- for ( ULONG i = 0; i < nCount; ++i )
+ sal_uLong nCount = pPathBox->GetEntryCount();
+ for ( sal_uLong i = 0; i < nCount; ++i )
{
SvLBoxEntry* pEntry = pPathBox->GetEntry(i);
DatabaseRegistration* pRegistration = static_cast< DatabaseRegistration* >( pEntry->GetUserData() );
@@ -253,7 +253,7 @@ void DbRegistrationOptionsPage::Reset( const SfxItemSet& rSet )
pHeaderBar->SetItemSize( ITEMID_TYPE, aUserData.GetToken(0).ToInt32() );
HeaderEndDrag_Impl( NULL );
// Sortierrichtung restaurieren
- BOOL bUp = (BOOL)(USHORT)aUserData.GetToken(1).ToInt32();
+ sal_Bool bUp = (sal_Bool)(sal_uInt16)aUserData.GetToken(1).ToInt32();
HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
if ( bUp )
@@ -278,7 +278,7 @@ void DbRegistrationOptionsPage::FillUserData()
String aUserData = String::CreateFromInt32( pHeaderBar->GetItemSize( ITEMID_TYPE ) );
aUserData += ';';
HeaderBarItemBits nBits = pHeaderBar->GetItemBits( ITEMID_TYPE );
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
+ sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
aUserData += bUp ? '1' : '0';
SetUserData( aUserData );
}
@@ -331,7 +331,7 @@ IMPL_LINK( DbRegistrationOptionsPage, HeaderSelect_Impl, HeaderBar*, pBar )
return 0;
HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
+ sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
SvSortMode eMode = SortAscending;
if ( bUp )
@@ -362,7 +362,7 @@ IMPL_LINK( DbRegistrationOptionsPage, HeaderEndDrag_Impl, HeaderBar*, pBar )
if ( !pHeaderBar->IsItemMode() )
{
Size aSz;
- USHORT nTabs = pHeaderBar->GetItemCount();
+ sal_uInt16 nTabs = pHeaderBar->GetItemCount();
long nTmpSz = 0;
long nWidth = pHeaderBar->GetItemSize(ITEMID_TYPE);
long nBarWidth = pHeaderBar->GetSizePixel().Width();
@@ -372,7 +372,7 @@ IMPL_LINK( DbRegistrationOptionsPage, HeaderEndDrag_Impl, HeaderBar*, pBar )
else if ( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
pHeaderBar->SetItemSize( ITEMID_TYPE, nBarWidth - TAB_WIDTH_MIN );
- for ( USHORT i = 1; i <= nTabs; ++i )
+ for ( sal_uInt16 i = 1; i <= nTabs; ++i )
{
long _nWidth = pHeaderBar->GetItemSize(i);
aSz.Width() = _nWidth + nTmpSz;
@@ -421,60 +421,6 @@ void DbRegistrationOptionsPage::insertNewEntry( const ::rtl::OUString& _sName,co
}
// -----------------------------------------------------------------------------
-String DbRegistrationOptionsPage::getFileLocation(const String& _sLocation)
-{
- try
- {
- rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) );
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < XFilePicker > xFilePicker( xFactory->createInstance( aService ), UNO_QUERY );
- OSL_ENSURE(xFilePicker.is() ,"Could create file picker service!");
- Reference < XFilterManager> xFilterManager(xFilePicker,UNO_QUERY);
- static const String s_sDatabaseType = String::CreateFromAscii("StarOffice XML (Base)");
- const SfxFilter* pFilter = SfxFilter::GetFilterByName( s_sDatabaseType);
- if ( pFilter )
- {
- xFilterManager->appendFilter( pFilter->GetUIName(),pFilter->GetDefaultExtension());
- xFilterManager->setCurrentFilter(pFilter->GetUIName());
- }
-
- INetURLObject aURL( _sLocation, INET_PROT_FILE );
- xFilePicker->setMultiSelectionMode(sal_False);
- xFilePicker->setDisplayDirectory( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
- short nRet = xFilePicker->execute();
-
- if ( ExecutableDialogResults::OK == nRet )
- {
-
- // old path is an URL?
- INetURLObject aObj( _sLocation );
- bool bURL = ( aObj.GetProtocol() != INET_PROT_NOT_VALID );
- Sequence< ::rtl::OUString > aFiles = xFilePicker->getFiles();
- INetURLObject aNewObj( aFiles[0] );
- aNewObj.removeFinalSlash();
-
- // then the new path also an URL else system path
- String sNewLocation = bURL ? rtl::OUString(aFiles[0]) : aNewObj.getFSysPath( INetURLObject::FSYS_DETECT );
-
- if (
-#ifdef UNX
- // Unix is case sensitive
- ( sNewLocation != _sLocation )
-#else
- ( sNewLocation.CompareIgnoreCaseToAscii( _sLocation ) != COMPARE_EQUAL )
-#endif
- )
- return sNewLocation;
- }
- }
- catch( Exception& )
- {
- DBG_ERRORFILE( "DbRegistrationOptionsPage::EditLocationHdl: exception from folder picker" );
- }
-
- return String();
-}
-// -----------------------------------------------------------------------------
void DbRegistrationOptionsPage::openLinkDialog(const String& _sOldName,const String& _sOldLocation,SvLBoxEntry* _pEntry)
{
ODocumentLinkDialog aDlg(this,_pEntry == NULL);
@@ -503,8 +449,8 @@ IMPL_LINK( DbRegistrationOptionsPage, NameValidator, String*, _pName )
{
if ( _pName )
{
- ULONG nCount = pPathBox->GetEntryCount();
- for ( ULONG i = 0; i < nCount; ++i )
+ sal_uLong nCount = pPathBox->GetEntryCount();
+ for ( sal_uLong i = 0; i < nCount; ++i )
{
SvLBoxEntry* pEntry = pPathBox->GetEntry(i);
if ( (!m_pCurEntry || m_pCurEntry != pEntry) && pPathBox->GetEntryText(pEntry,0) == *_pName )