diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 15:32:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 18:29:34 +0200 |
commit | 6595240f39c34fa9ae5cd1bb319f6287206e4b92 (patch) | |
tree | 64f7bde04c093e1cf8ee2f20081a60826881fe7f /fpicker | |
parent | c3741a89a99fcd58824d5137054b96b01bc32a11 (diff) |
loplugin:referencecasting in forms..fpicker
Change-Id: I0aa040b6d3264d2efde5797f79994d3d65ceaddf
Reviewed-on: https://gerrit.libreoffice.org/75957
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 15 | ||||
-rw-r--r-- | fpicker/source/office/commonpicker.cxx | 14 |
2 files changed, 12 insertions, 17 deletions
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<OUString> 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 } } |