diff options
Diffstat (limited to 'dbaccess/source/ui/dlg/adodatalinks.cxx')
-rw-r--r-- | dbaccess/source/ui/dlg/adodatalinks.cxx | 48 |
1 files changed, 24 insertions, 24 deletions
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( ); |