From 6595240f39c34fa9ae5cd1bb319f6287206e4b92 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 19 Jul 2019 15:32:58 +0200 Subject: loplugin:referencecasting in forms..fpicker Change-Id: I0aa040b6d3264d2efde5797f79994d3d65ceaddf Reviewed-on: https://gerrit.libreoffice.org/75957 Tested-by: Jenkins Reviewed-by: Noel Grandin --- fpicker/source/office/RemoteFilesDialog.cxx | 15 ++++++--------- fpicker/source/office/commonpicker.cxx | 14 ++++++-------- 2 files changed, 12 insertions(+), 17 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index c22ebcbf9b3f..d9145866d6d5 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -719,9 +719,8 @@ void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUse && m_xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) ) { - Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( m_xContext, nullptr ), - UNO_QUERY ); + Reference< XInteractionHandler > xInteractionHandler = + InteractionHandler::createWithParent( m_xContext, nullptr ); Sequence aPasswd { rPassword }; @@ -866,9 +865,8 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, void ) { OUString sUrl( m_aServices[nPos]->GetUrl() ); - Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( m_xContext, nullptr ), - UNO_QUERY ); + Reference< XInteractionHandler > xInteractionHandler = + InteractionHandler::createWithParent( m_xContext, nullptr ); UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler ); @@ -908,9 +906,8 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, void ) { OUString sUrl( m_aServices[nPos]->GetUrl() ); - Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( m_xContext, nullptr ), - UNO_QUERY ); + Reference< XInteractionHandler > xInteractionHandler = + InteractionHandler::createWithParent( m_xContext, nullptr ); UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler ); diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx index 34fe024ee07a..e87d58fb739d 100644 --- a/fpicker/source/office/commonpicker.cxx +++ b/fpicker/source/office/commonpicker.cxx @@ -218,22 +218,20 @@ namespace svt m_xWindow = VCLUnoHelper::GetInterface( m_pDlg ); // add as event listener to the window - Reference< XComponent > xWindowComp( m_xWindow, UNO_QUERY ); - OSL_ENSURE( xWindowComp.is(), "OCommonPicker::createFileDialog: invalid window component!" ); - if ( xWindowComp.is() ) + OSL_ENSURE( m_xWindow.is(), "OCommonPicker::createFileDialog: invalid window component!" ); + if ( m_xWindow.is() ) { - m_xWindowListenerAdapter = new OWeakEventListenerAdapter( this, xWindowComp ); + m_xWindowListenerAdapter = new OWeakEventListenerAdapter( this, m_xWindow ); // the adapter will add itself as listener, and forward notifications } // _and_ add as event listener to the parent - in case the parent is destroyed // before we are disposed, our disposal would access dead VCL windows then .... m_xDialogParent = VCLUnoHelper::GetInterface( m_pDlg->GetParent() ); - xWindowComp.set(m_xDialogParent, css::uno::UNO_QUERY); - OSL_ENSURE( xWindowComp.is() || !m_pDlg->GetParent(), "OCommonPicker::createFileDialog: invalid window component (the parent this time)!" ); - if ( xWindowComp.is() ) + OSL_ENSURE( m_xDialogParent.is() || !m_pDlg->GetParent(), "OCommonPicker::createFileDialog: invalid window component (the parent this time)!" ); + if ( m_xDialogParent.is() ) { - m_xParentListenerAdapter = new OWeakEventListenerAdapter( this, xWindowComp ); + m_xParentListenerAdapter = new OWeakEventListenerAdapter( this, m_xDialogParent ); // the adapter will add itself as listener, and forward notifications } } -- cgit