From ea2aeb6917a04401f95bab7aac37f4d070e07128 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 1 Dec 2019 19:27:47 +0000 Subject: use weld::WaitObject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib2ad0f0fe17c4db66693ef91e3cdbc8511eb8314 Reviewed-on: https://gerrit.libreoffice.org/84166 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- dbaccess/source/ui/app/AppControllerDnD.cxx | 5 ++--- dbaccess/source/ui/app/AppControllerGen.cxx | 5 ++--- dbaccess/source/ui/app/AppDetailPageHelper.cxx | 7 +++---- dbaccess/source/ui/app/AppView.cxx | 3 +-- dbaccess/source/ui/browser/brwctrlr.cxx | 3 +-- dbaccess/source/ui/browser/genericcontroller.cxx | 5 ++--- dbaccess/source/ui/browser/sbagrid.cxx | 1 - dbaccess/source/ui/browser/unodatbr.cxx | 5 ++--- dbaccess/source/ui/inc/RelationController.hxx | 8 ++++++-- dbaccess/source/ui/inc/linkeddocuments.hxx | 7 +++---- dbaccess/source/ui/misc/TableCopyHelper.cxx | 1 - dbaccess/source/ui/misc/linkeddocuments.cxx | 15 +++++++-------- dbaccess/source/ui/querydesign/JoinController.cxx | 1 - dbaccess/source/ui/relationdesign/RelationController.cxx | 5 ++--- 14 files changed, 31 insertions(+), 40 deletions(-) (limited to 'dbaccess/source/ui') diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 52bcae8d53bd..f7dc6d0bfad9 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include "AppView.hxx" @@ -332,7 +331,7 @@ const SharedConnection& OApplicationController::ensureConnection( ::dbtools::SQL return m_xDataSourceConnection; } - WaitObject aWO(getView()); + weld::WaitObject aWO(getFrameWeld()); Reference conn; { SolarMutexGuard aSolarGuard; @@ -499,7 +498,7 @@ std::unique_ptr< OLinkedDocumentsAccess > OApplicationController::getDocumentsAc } std::unique_ptr< OLinkedDocumentsAccess > pDocuments( new OLinkedDocumentsAccess( - getView(), this, getORB(), xDocContainer, xConnection, getDatabaseName() + getFrameWeld(), this, getORB(), xDocContainer, xConnection, getDatabaseName() ) ); return pDocuments; } diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 9c2ad5dbb748..db32b9a15d8e 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -65,7 +65,6 @@ #include #include #include -#include #include namespace dbaui @@ -162,7 +161,7 @@ void OApplicationController::openDialog( const OUString& _sServiceName ) { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); - WaitObject aWO(getView()); + weld::WaitObject aWO(getFrameWeld()); Sequence< Any > aArgs(3); sal_Int32 nArgPos = 0; @@ -220,7 +219,7 @@ void OApplicationController::refreshTables() { if ( getContainer() && getContainer()->getDetailView() ) { - WaitObject aWO(getView()); + weld::WaitObject aWO(getFrameWeld()); OSL_ENSURE(getContainer()->getElementType() == E_TABLE,"Only allowed when the tables container is selected!"); try { diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 9e3f52215737..92edb0825656 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -727,7 +726,7 @@ DBTreeListBox* OAppDetailPageHelper::createSimpleTree( const OString& _sHelpId, DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, const Image& _rImage ) { - WaitObject aWaitCursor(this); + weld::WaitObject aWaitCursor(GetFrameWeld()); _pTreeView->SetStyle(_pTreeView->GetStyle() | WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); _pTreeView->GetModel()->SetSortMode(SortAscending); @@ -1004,7 +1003,7 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent) { m_pTablePreview->Hide(); - WaitObject aWaitCursor( this ); + weld::WaitObject aWaitCursor(GetFrameWeld()); try { Reference xContent(_xContent,UNO_QUERY); @@ -1065,7 +1064,7 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName, { if ( isPreviewEnabled() ) { - WaitObject aWaitCursor( this ); + weld::WaitObject aWaitCursor(GetFrameWeld()); m_aPreview->Hide(); m_aDocumentInfo->Hide(); m_pTablePreview->Show(); diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index 00cbb0e4ef65..bbd9891683c3 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -434,7 +433,7 @@ void OApplicationView::clearPages() void OApplicationView::selectContainer(ElementType _eType) { OSL_ENSURE(m_pWin && getPanel(),"Detail view is NULL! -> GPF"); - WaitObject aWO(this); + weld::WaitObject aWO(GetFrameWeld()); getPanel()->selectContainer(_eType); } diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 818b423a205b..4c74fad173d6 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -89,7 +89,6 @@ #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -634,7 +633,7 @@ void SbaXDataBrowserController::impl_checkForCannotSelectUnfiltered( const SQLEx bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _rxLoadable ) { - WaitObject aWO(getBrowserView()); + weld::WaitObject aWO(getFrameWeld()); onStartLoading( _rxLoadable ); diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index a5dc5e061720..81dfef0f840c 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -47,7 +47,6 @@ #include #include -#include #include #include #include @@ -899,7 +898,7 @@ void OGenericUnoController::stopConnectionListening(const Reference< XConnection Reference< XConnection > OGenericUnoController::connect( const Reference< XDataSource>& _xDataSource ) { - WaitObject aWaitCursor( getView() ); + weld::WaitObject aWaitCursor(getFrameWeld()); ODatasourceConnector aConnector( getORB(), getFrameWeld(), OUString() ); Reference< XConnection > xConnection = aConnector.connect( _xDataSource, nullptr ); @@ -911,7 +910,7 @@ Reference< XConnection > OGenericUnoController::connect( const Reference< XDataS Reference< XConnection > OGenericUnoController::connect( const OUString& _rDataSourceName, const OUString& _rContextInformation, ::dbtools::SQLExceptionInfo* _pErrorInfo ) { - WaitObject aWaitCursor( getView() ); + weld::WaitObject aWaitCursor(getFrameWeld()); ODatasourceConnector aConnector( getORB(), getFrameWeld(), _rContextInformation ); Reference xConnection = aConnector.connect( _rDataSourceName, _pErrorInfo ); diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 43655259bc06..a47db2b688e9 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -63,7 +63,6 @@ #include #include -#include #include #include diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 2b33bd6ded7b..baf3d3cd2719 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -127,7 +127,6 @@ #include #include #include -#include #include #include @@ -2131,7 +2130,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvTreeListEntry*, _pParent, bool) if (etTableContainer == pData->eType) { - WaitObject aWaitCursor(getBrowserView()); + weld::WaitObject aWaitCursor(getFrameWeld()); // it could be that we already have a connection SharedConnection xConnection; @@ -2534,7 +2533,7 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry ) { try { - WaitObject aWaitCursor(getBrowserView()); + weld::WaitObject aWaitCursor(getFrameWeld()); // tell the old entry it has been deselected selectPath(m_pCurrentlyDisplayed, false); diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx index 35ab382c40fa..39f57338f48f 100644 --- a/dbaccess/source/ui/inc/RelationController.hxx +++ b/dbaccess/source/ui/inc/RelationController.hxx @@ -24,13 +24,17 @@ #include "RelationDesignView.hxx" #include -class WaitObject; +namespace weld +{ + class WaitObject; +} + namespace dbaui { class ORelationController : public OJoinController { css::uno::Reference< css::container::XNameAccess > m_xTables; - std::unique_ptr m_pWaitObject; + std::unique_ptr m_xWaitObject; sal_uLong m_nThreadEvent; bool m_bRelationsPossible; protected: diff --git a/dbaccess/source/ui/inc/linkeddocuments.hxx b/dbaccess/source/ui/inc/linkeddocuments.hxx index 697dacb33ac9..0e1ca710429b 100644 --- a/dbaccess/source/ui/inc/linkeddocuments.hxx +++ b/dbaccess/source/ui/inc/linkeddocuments.hxx @@ -30,9 +30,8 @@ #include #include #include -#include -namespace vcl { class Window; } +namespace weld { class Window; } namespace dbaui { @@ -47,12 +46,12 @@ namespace dbaui m_xConnection; css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > m_xDocumentUI; - VclPtr m_pDialogParent; + weld::Window* m_pDialogParent; OUString m_sDataSourceName; public: OLinkedDocumentsAccess( - vcl::Window* _pDialogParent, + weld::Window* pDialogParent, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& i_rDocumentUI, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const css::uno::Reference< css::container::XNameAccess >& _rxContainer, diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx index 135632e0c698..d3848766916a 100644 --- a/dbaccess/source/ui/misc/TableCopyHelper.cxx +++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index 6c0ba95365e1..1e3a97193fc1 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -47,7 +47,6 @@ #include #include #include -#include #include #include @@ -100,18 +99,18 @@ namespace dbaui } // OLinkedDocumentsAccess - OLinkedDocumentsAccess::OLinkedDocumentsAccess( vcl::Window* _pDialogParent, const Reference< XDatabaseDocumentUI >& i_rDocumentUI, + OLinkedDocumentsAccess::OLinkedDocumentsAccess( weld::Window* pDialogParent, const Reference< XDatabaseDocumentUI >& i_rDocumentUI, const Reference< XComponentContext >& _rxContext, const Reference< XNameAccess >& _rxContainer, const Reference< XConnection>& _xConnection, const OUString& _sDataSourceName ) :m_xContext(_rxContext) ,m_xDocumentContainer(_rxContainer) ,m_xConnection(_xConnection) ,m_xDocumentUI( i_rDocumentUI ) - ,m_pDialogParent(_pDialogParent) + ,m_pDialogParent(pDialogParent) ,m_sDataSourceName(_sDataSourceName) { OSL_ENSURE(m_xContext.is(), "OLinkedDocumentsAccess::OLinkedDocumentsAccess: invalid service factory!"); - OSL_ENSURE(m_pDialogParent, "OLinkedDocumentsAccess::OLinkedDocumentsAccess: really need a dialog parent!"); + assert(m_pDialogParent && "OLinkedDocumentsAccess::OLinkedDocumentsAccess: really need a dialog parent!"); } OLinkedDocumentsAccess::~OLinkedDocumentsAccess() { @@ -125,7 +124,7 @@ namespace dbaui if ( !xComponentLoader.is() ) return xRet; - WaitObject aWaitCursor( m_pDialogParent ); + weld::WaitObject aWaitCursor(m_pDialogParent); ::comphelper::NamedValueCollection aArguments; OUString sOpenMode; @@ -184,7 +183,7 @@ namespace dbaui Reference< XJobExecutor > xWizard; { - WaitObject aWaitCursor( m_pDialogParent ); + weld::WaitObject aWaitCursor(m_pDialogParent); xWizard.set( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( OUString::createFromAscii( _pWizardService ), aArgs.getWrappedPropertyValues(), @@ -291,7 +290,7 @@ namespace dbaui Command aCommand; aCommand.Name = "openDesign"; aCommand.Argument <<= aCommandArgs.getPropertyValues(); - WaitObject aWaitCursor( m_pDialogParent ); + weld::WaitObject aWaitCursor(m_pDialogParent); xNewDocument.set( xContent->execute( aCommand, xContent->createCommandIdentifier(), nullptr ), UNO_QUERY ); } } @@ -359,7 +358,7 @@ namespace dbaui } if (aInfo.isValid()) { - showError(aInfo, VCLUnoHelper::GetInterface(m_pDialogParent), m_xContext ); + showError(aInfo, m_pDialogParent->GetXWindow(), m_xContext); } return xRet; } diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index eae59834ce58..b2a5184ffc7c 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index e3ec54717b89..530598ad09f5 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -63,7 +63,6 @@ #include #include #include -#include #include #include @@ -477,12 +476,12 @@ IMPL_LINK_NOARG( ORelationController, OnThreadFinished, void*, void ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); } - m_pWaitObject.reset(); + m_xWaitObject.reset(); } void ORelationController::loadData() { - m_pWaitObject.reset( new WaitObject(getView()) ); + m_xWaitObject.reset(new weld::WaitObject(getFrameWeld())); try { if ( !m_xTables.is() ) -- cgit v1.2.3