diff options
Diffstat (limited to 'dbaccess/source/ui/dlg')
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.cxx | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionPage.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adodatalinks.cxx | 48 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dsselect.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/odbcconfig.cxx | 6 |
5 files changed, 38 insertions, 43 deletions
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 3a16604e8544..5911c6e0eb88 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -60,14 +60,10 @@ #include <tools/diagnose_ex.h> #include <sfx2/docfilt.hxx> -#if defined(_WIN32) -#define _ADO_DATALINK_BROWSE_ -#endif - -#ifdef _ADO_DATALINK_BROWSE_ +#if defined _WIN32 #include <vcl/sysdata.hxx> #include "adodatalinks.hxx" -#endif //_ADO_DATALINK_BROWSE_ +#endif #include <com/sun/star/mozilla/XMozillaBootstrap.hpp> #include <comphelper/processfactory.hxx> @@ -266,17 +262,17 @@ namespace dbaui return; } break; -#ifdef _ADO_DATALINK_BROWSE_ +#if defined _WIN32 case ::dbaccess::DST_ADO: { OUString sOldDataSource=getURLNoPrefix(); OUString sNewDataSource; HWND hWnd = GetParent()->GetSystemData()->hWnd; - sNewDataSource = getAdoDatalink((LONG_PTR)hWnd,sOldDataSource); + sNewDataSource = getAdoDatalink(reinterpret_cast<LONG_PTR>(hWnd),sOldDataSource); if ( !sNewDataSource.isEmpty() ) { setURLNoPrefix(sNewDataSource); - SetRoadmapStateValue(sal_True); + SetRoadmapStateValue(true); callModifiedHdl(); } else diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 7bef896839f6..fa8d31fbfcd3 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -59,15 +59,11 @@ #include <connectivity/CommonTools.hxx> #include <sfx2/docfilt.hxx> #include "dsnItem.hxx" -#if defined(_WIN32) -#define _ADO_DATALINK_BROWSE_ -#endif -#ifdef _ADO_DATALINK_BROWSE_ +#if defined _WIN32 #include <vcl/sysdata.hxx> #include "adodatalinks.hxx" -#endif //_ADO_DATALINK_BROWSE_ - +#endif namespace dbaui { diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx index 37a3bc30f108..b945c434d2aa 100644 --- a/dbaccess/source/ui/dlg/adodatalinks.cxx +++ b/dbaccess/source/ui/dlg/adodatalinks.cxx @@ -43,7 +43,7 @@ const CLSID CLSID_DataLinks = { 0x2206CDB2, 0x19C1, 0x11D1, { 0x89, 0xE0, 0x00, #endif -BSTR PromptEdit(long hWnd,BSTR connstr); +OLECHAR const * PromptEdit(long hWnd,OLECHAR const * connstr); BSTR PromptNew(long hWnd); OUString getAdoDatalink(long hWnd,OUString& oldLink) @@ -51,7 +51,7 @@ OUString getAdoDatalink(long hWnd,OUString& oldLink) OUString dataLink; if (!oldLink.isEmpty()) { - dataLink=reinterpret_cast<sal_Unicode *>(PromptEdit(hWnd,(BSTR)oldLink.getStr())); + dataLink=PromptEdit(hWnd,oldLink.getStr()); } else dataLink=reinterpret_cast<sal_Unicode *>(PromptNew(hWnd)); @@ -60,22 +60,22 @@ OUString getAdoDatalink(long hWnd,OUString& oldLink) BSTR PromptNew(long hWnd) { - BSTR connstr=NULL; + BSTR connstr=nullptr; HRESULT hr; - IDataSourceLocator* dlPrompt = NULL; - ADOConnection* piTmpConnection = NULL; - BSTR _result=NULL; + IDataSourceLocator* dlPrompt = nullptr; + ADOConnection* piTmpConnection = nullptr; + BSTR _result=nullptr; // Initialize COM - ::CoInitialize( NULL ); + ::CoInitialize( nullptr ); // Instantiate DataLinks object. hr = CoCreateInstance( CLSID_DataLinks, //clsid -- Data Links UI - NULL, //pUnkOuter + nullptr, //pUnkOuter CLSCTX_INPROC_SERVER, //dwClsContext IID_IDataSourceLocator, //riid - (void**)&dlPrompt //ppvObj + reinterpret_cast<void**>(&dlPrompt) //ppvObj ); if( FAILED( hr ) ) { @@ -90,7 +90,7 @@ BSTR PromptNew(long hWnd) } // Prompt for connection information. - hr = dlPrompt->PromptNew((IDispatch **)&piTmpConnection); + hr = dlPrompt->PromptNew(reinterpret_cast<IDispatch **>(&piTmpConnection)); if( FAILED( hr ) || !piTmpConnection ) { @@ -112,21 +112,21 @@ BSTR PromptNew(long hWnd) return _result; } -BSTR PromptEdit(long hWnd,BSTR connstr) +OLECHAR const * PromptEdit(long hWnd,OLECHAR const * connstr) { HRESULT hr; - IDataSourceLocator* dlPrompt = NULL; - ADOConnection* piTmpConnection = NULL; - BSTR _result=NULL; + IDataSourceLocator* dlPrompt = nullptr; + ADOConnection* piTmpConnection = nullptr; + BSTR _result=nullptr; // Initialize COM - ::CoInitialize( NULL ); + ::CoInitialize( nullptr ); hr = CoCreateInstance(CLSID_CADOConnection, - NULL, + nullptr, CLSCTX_INPROC_SERVER, IID_IADOConnection, - (LPVOID *)&piTmpConnection); + reinterpret_cast<LPVOID *>(&piTmpConnection)); if( FAILED( hr ) ) { piTmpConnection->Release( ); @@ -134,7 +134,7 @@ BSTR PromptEdit(long hWnd,BSTR connstr) } - hr = piTmpConnection->put_ConnectionString(connstr); + hr = piTmpConnection->put_ConnectionString(const_cast<BSTR>(connstr)); if( FAILED( hr ) ) { piTmpConnection->Release( ); @@ -144,10 +144,10 @@ BSTR PromptEdit(long hWnd,BSTR connstr) // Instantiate DataLinks object. hr = CoCreateInstance( CLSID_DataLinks, //clsid -- Data Links UI - NULL, //pUnkOuter + nullptr, //pUnkOuter CLSCTX_INPROC_SERVER, //dwClsContext IID_IDataSourceLocator, //riid - (void**)&dlPrompt //ppvObj + reinterpret_cast<void**>(&dlPrompt) //ppvObj ); if( FAILED( hr ) ) { @@ -167,8 +167,8 @@ BSTR PromptEdit(long hWnd,BSTR connstr) VARIANT_BOOL pbSuccess; // Prompt for connection information. - hr = dlPrompt->PromptEdit((IDispatch **)&piTmpConnection,&pbSuccess); - if( SUCCEEDED( hr ) && sal_False == pbSuccess ) //if user press cancel then sal_False == pbSuccess + hr = dlPrompt->PromptEdit(reinterpret_cast<IDispatch **>(&piTmpConnection),&pbSuccess); + if( SUCCEEDED( hr ) && !pbSuccess ) //if user press cancel then sal_False == pbSuccess { piTmpConnection->Release( ); dlPrompt->Release( ); @@ -179,8 +179,8 @@ BSTR PromptEdit(long hWnd,BSTR connstr) { // Prompt for new connection information. piTmpConnection->Release( ); - piTmpConnection = NULL; - hr = dlPrompt->PromptNew((IDispatch **)&piTmpConnection); + piTmpConnection = nullptr; + hr = dlPrompt->PromptNew(reinterpret_cast<IDispatch **>(&piTmpConnection)); if( FAILED( hr ) || !piTmpConnection ) { dlPrompt->Release( ); diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index 4042b4635f71..29c5a9314ef8 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -79,6 +79,9 @@ void ODatasourceSelectDialog::dispose() m_pDatasource.clear(); m_pOk.clear(); m_pCancel.clear(); +#if defined HAVE_ODBC_ADMINISTRATION + m_pManageDatasources.clear(); +#endif ModalDialog::dispose(); } @@ -93,7 +96,7 @@ bool ODatasourceSelectDialog::Close() { #ifdef HAVE_ODBC_ADMINISTRATION if ( m_pODBCManagement.get() && m_pODBCManagement->isRunning() ) - return sal_False; + return false; #endif return ModalDialog::Close(); diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx index cd90b3a1b24c..cd1b583e1840 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.cxx +++ b/dbaccess/source/ui/dlg/odbcconfig.cxx @@ -238,7 +238,7 @@ public: } protected: - virtual void SAL_CALL run() + virtual void SAL_CALL run() override { osl_setThreadName("dbaui::ProcessTerminationWait"); @@ -271,8 +271,8 @@ bool OOdbcManagement::manageDataSources_async() // (and note this whole functionality is supported on Windows only, ATM) OUString sExecutableName( "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/odbcconfig.exe" ); ::rtl::Bootstrap::expandMacros( sExecutableName ); //TODO: detect failure - oslProcess hProcessHandle(0); - oslProcessError eError = osl_executeProcess( sExecutableName.pData, NULL, 0, 0, NULL, NULL, NULL, 0, &hProcessHandle ); + oslProcess hProcessHandle(nullptr); + oslProcessError eError = osl_executeProcess( sExecutableName.pData, nullptr, 0, 0, nullptr, nullptr, nullptr, 0, &hProcessHandle ); if ( eError != osl_Process_E_None ) return false; |