diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 13:30:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 17:59:32 +0200 |
commit | 586cfef1df9fb99aaf018029b7f06363e96bc72b (patch) | |
tree | dc4be0619ab5fccdf1e8e8780ddcdfa022e2f0eb /sw/source/ui/dbui | |
parent | f44bd7bb0ce23535f5e0ced7966677f4fff943fc (diff) |
loplugin:referencecasting in sw
Change-Id: Ib5de4377b22815ba718559ff6fcfd6ab5a0547a6
Reviewed-on: https://gerrit.libreoffice.org/75999
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r-- | sw/source/ui/dbui/addresslistdialog.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmdocselectpage.cxx | 5 |
3 files changed, 7 insertions, 11 deletions
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 21c2a19dfef1..fc1475647b82 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -295,8 +295,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, CreateHdl_Impl, weld::Button&, void) const OUString sURL = aDlg.GetURL(); try { - uno::Reference<XSingleServiceFactory> xFact( m_xDBContext, UNO_QUERY); - uno::Reference<XInterface> xNewInstance = xFact->createInstance(); + uno::Reference<XInterface> xNewInstance = m_xDBContext->createInstance(); INetURLObject aURL( sURL ); const OUString sNewName = aURL.getBase(); //find a unique name if sNewName already exists @@ -342,8 +341,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, CreateHdl_Impl, weld::Button&, void) } xStore->storeAsURL(sTmpName, Sequence< PropertyValue >()); - uno::Reference<XNamingService> xNaming(m_xDBContext, UNO_QUERY); - xNaming->registerObject( sFind, xNewInstance ); + m_xDBContext->registerObject( sFind, xNewInstance ); //now insert the new source into the ListBox m_xListLB->append(m_xIter.get()); m_xListLB->set_text(*m_xIter, sFind, 0); @@ -449,7 +447,7 @@ void SwAddressListDialog::DetectTablesAndQueries( pUserData->xSource.set(xComplConnection, UNO_QUERY); uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - uno::Reference< XInteractionHandler > xHandler( InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY ); + uno::Reference< XInteractionHandler > xHandler = InteractionHandler::createWithParent(xContext, nullptr); pUserData->xConnection = SharedConnection( xComplConnection->connectWithCompletion( xHandler ) ); } if(pUserData->xConnection.is()) diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 62b04be87fca..7edb7911cf88 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -421,9 +421,8 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl, weld::Button&, void) const OUString sPath( SvtPathOptions().SubstituteVariable("$(userurl)/database") ); aDlgHelper.SetDisplayDirectory( sPath ); - uno::Reference< XFilterManager > xFltMgr(xFP, uno::UNO_QUERY); - xFltMgr->appendFilter( m_sAddressListFilterName, "*.csv" ); - xFltMgr->setCurrentFilter( m_sAddressListFilterName ) ; + xFP->appendFilter( m_sAddressListFilterName, "*.csv" ); + xFP->setCurrentFilter( m_sAddressListFilterName ) ; if( ERRCODE_NONE == aDlgHelper.Execute() ) { diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index fd2e3544639c..fb3e05110330 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -133,18 +133,17 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, weld::Button&, rButton, void) SfxObjectFactory &rFact = m_pWizard->GetSwView()->GetDocShell()->GetFactory(); SfxFilterMatcher aMatcher( rFact.GetFactoryName() ); SfxFilterMatcherIter aIter( aMatcher ); - Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY); std::shared_ptr<const SfxFilter> pFlt = aIter.First(); while( pFlt ) { if( pFlt && pFlt->IsAllowedAsTemplate() ) { const OUString sWild = pFlt->GetWildcard().getGlob(); - xFltMgr->appendFilter( pFlt->GetUIName(), sWild ); + xFP->appendFilter( pFlt->GetUIName(), sWild ); // #i40125 if(pFlt->GetFilterFlags() & SfxFilterFlags::DEFAULT) - xFltMgr->setCurrentFilter( pFlt->GetUIName() ) ; + xFP->setCurrentFilter( pFlt->GetUIName() ) ; } pFlt = aIter.Next(); |