diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-09-15 20:26:13 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-09-16 12:26:41 +0200 |
commit | d7db9cf313c3e86f9ab48163509f17edfd9d3d0b (patch) | |
tree | 4cde81857a8ef44bac3440092027896f9415d327 /dbaccess | |
parent | 6d15dcd1298d29c479b9bd8759ba91241d1c23b8 (diff) |
make ODatasourceConnector take weld::Window
Change-Id: I4c0299904f26fdda26e65018d0ed4001e60258a4
Reviewed-on: https://gerrit.libreoffice.org/78968
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/app/AppControllerDnD.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/genericcontroller.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/UITools.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/datasourceconnector.hxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/datasourceconnector.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/unoDirectSql.cxx | 3 |
8 files changed, 18 insertions, 17 deletions
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 6df3b51b7022..4051a29245b9 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -635,7 +635,7 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe { // the concrete query Reference< XQueryDefinitionsSupplier > xSourceQuerySup( - getDataSourceByName( sDataSourceName, getView(), getORB(), nullptr ), + getDataSourceByName( sDataSourceName, getFrameWeld(), getORB(), nullptr ), UNO_QUERY_THROW ); Reference< XNameAccess > xQueries( xSourceQuerySup->getQueryDefinitions(), UNO_SET_THROW ); if ( xQueries->hasByName( sCommand ) ) diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 394f0d8211f6..0989a2c03727 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -897,7 +897,7 @@ Reference< XConnection > OGenericUnoController::connect( const Reference< XDataS { WaitObject aWaitCursor( getView() ); - ODatasourceConnector aConnector( getORB(), getView(), OUString() ); + ODatasourceConnector aConnector( getORB(), getFrameWeld(), OUString() ); Reference< XConnection > xConnection = aConnector.connect( _xDataSource, nullptr ); startConnectionListening( xConnection ); @@ -909,7 +909,7 @@ Reference< XConnection > OGenericUnoController::connect( const OUString& _rDataS { WaitObject aWaitCursor( getView() ); - ODatasourceConnector aConnector( getORB(), getView(), _rContextInformation ); + ODatasourceConnector aConnector( getORB(), getFrameWeld(), _rContextInformation ); Reference<XConnection> xConnection = aConnector.connect( _rDataSourceName, _pErrorInfo ); startConnectionListening( xConnection ); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index a07fd94c8a88..e11f3dbd5969 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -3393,7 +3393,7 @@ void SbaTableQueryBrowser::implAdministrate( SvTreeListEntry* _pApplyTo ) if (pTopLevelSelected) sInitialSelection = getDataSourceAccessor( pTopLevelSelected ); - Reference< XDataSource > xDataSource( getDataSourceByName( sInitialSelection, getView(), getORB(), nullptr ) ); + Reference< XDataSource > xDataSource( getDataSourceByName( sInitialSelection, getFrameWeld(), getORB(), nullptr ) ); Reference< XModel > xDocumentModel( getDataSourceOrModel( xDataSource ), UNO_QUERY ); if ( xDocumentModel.is() ) diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 41ac1ab170b2..cf14f3a97ef6 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -159,7 +159,7 @@ namespace dbaui css::uno::Reference< css::sdbc::XDataSource > getDataSourceByName( const OUString& _rDataSourceName, - vcl::Window* _pErrorMessageParent, + weld::Window* _pErrorMessageParent, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, ::dbtools::SQLExceptionInfo* _pErrorInfo ); diff --git a/dbaccess/source/ui/inc/datasourceconnector.hxx b/dbaccess/source/ui/inc/datasourceconnector.hxx index 39c81a2f8738..9144667ff1f8 100644 --- a/dbaccess/source/ui/inc/datasourceconnector.hxx +++ b/dbaccess/source/ui/inc/datasourceconnector.hxx @@ -24,21 +24,20 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> -#include <vcl/vclptr.hxx> namespace dbtools { class SQLExceptionInfo; } -namespace vcl { class Window; } +namespace weld { class Window; } namespace dbaui { // ODatasourceConnector class ODatasourceConnector final { - VclPtr<vcl::Window> m_pErrorMessageParent; + weld::Window* m_pErrorMessageParent; css::uno::Reference< css::uno::XComponentContext > m_xContext; OUString m_sContextInformation; @@ -46,11 +45,11 @@ namespace dbaui public: ODatasourceConnector( const css::uno::Reference< css::uno::XComponentContext >& _rxContext, - vcl::Window* _pMessageParent + weld::Window* _pMessageParent ); ODatasourceConnector( const css::uno::Reference< css::uno::XComponentContext >& _rxContext, - vcl::Window* _pMessageParent, + weld::Window* _pMessageParent, const OUString& _rContextInformation ); diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 83c0cb49b894..31decd181fe3 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -212,7 +212,7 @@ SQLExceptionInfo createConnection( const Reference< css::beans::XPropertySet>& } Reference< XDataSource > getDataSourceByName( const OUString& _rDataSourceName, - vcl::Window* _pErrorMessageParent, const Reference< XComponentContext >& _rxContext, ::dbtools::SQLExceptionInfo* _pErrorInfo ) + weld::Window* _pErrorMessageParent, const Reference< XComponentContext >& _rxContext, ::dbtools::SQLExceptionInfo* _pErrorInfo ) { Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create(_rxContext); @@ -260,7 +260,7 @@ Reference< XDataSource > getDataSourceByName( const OUString& _rDataSourceName, } else { - showError( aSQLError, VCLUnoHelper::GetInterface(_pErrorMessageParent), _rxContext ); + showError( aSQLError, _pErrorMessageParent ? _pErrorMessageParent->GetXWindow() : nullptr, _rxContext ); } } diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index a7cd4359dfd6..67da61ad905b 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -35,6 +35,7 @@ #include <UITools.hxx> #include <vcl/stdtext.hxx> #include <vcl/button.hxx> +#include <vcl/weld.hxx> #include <svl/filenotation.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> @@ -56,13 +57,13 @@ namespace dbaui using namespace ::dbtools; // ODatasourceConnector - ODatasourceConnector::ODatasourceConnector(const Reference< XComponentContext >& _rxContext, vcl::Window* _pMessageParent) + ODatasourceConnector::ODatasourceConnector(const Reference< XComponentContext >& _rxContext, weld::Window* _pMessageParent) :m_pErrorMessageParent(_pMessageParent) ,m_xContext(_rxContext) { } - ODatasourceConnector::ODatasourceConnector( const Reference< XComponentContext >& _rxContext, vcl::Window* _pMessageParent, + ODatasourceConnector::ODatasourceConnector( const Reference< XComponentContext >& _rxContext, weld::Window* _pMessageParent, const OUString& _rContextInformation ) :m_pErrorMessageParent(_pMessageParent) ,m_xContext(_rxContext) @@ -127,7 +128,7 @@ namespace dbaui if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler = InteractionHandler::createWithParent(m_xContext, VCLUnoHelper::GetInterface(m_pErrorMessageParent)); + xHandler = InteractionHandler::createWithParent(m_xContext, m_pErrorMessageParent ? m_pErrorMessageParent->GetXWindow() : nullptr); } xConnection = xConnectionCompletion->connectWithCompletion(xHandler); @@ -195,7 +196,7 @@ namespace dbaui } else { - showError(aInfo, VCLUnoHelper::GetInterface(m_pErrorMessageParent), m_xContext); + showError(aInfo, m_pErrorMessageParent ? m_pErrorMessageParent->GetXWindow() : nullptr, m_xContext); } } return xConnection; diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx index 859e6760f22a..c696bb26e442 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.cxx +++ b/dbaccess/source/ui/uno/unoDirectSql.cxx @@ -32,6 +32,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> #include <comphelper/processfactory.hxx> +#include <vcl/svapp.hxx> extern "C" void createRegistryInfo_ODirectSQLDialog() { @@ -88,7 +89,7 @@ namespace dbaui try { // the connection the row set is working with - ODatasourceConnector aDSConnector(m_aContext, _pParent); + ODatasourceConnector aDSConnector(m_aContext, Application::GetFrameWeld(rParent)); xConnection = aDSConnector.connect( m_sInitialSelection, nullptr ); } catch( const Exception& ) |