avmedia/source/viewer/mediawindow_impl.cxx                   |    8 --
 basctl/source/accessibility/accessibledialogcontrolshape.cxx |    2 
 basctl/source/basicide/baside3.cxx                           |    6 -
 basctl/source/basicide/bastype2.cxx                          |   40 ++++-------
 basctl/source/basicide/bastype3.cxx                          |    4 -
 basctl/source/basicide/iderdll.cxx                           |    2 
 basctl/source/basicide/moduldl2.cxx                          |   23 ++----
 basctl/source/basicide/moduldlg.cxx                          |    3 
 basctl/source/dlged/dlged.cxx                                |   37 +++-------
 basctl/source/dlged/dlgedobj.cxx                             |    6 -
 basegfx/source/tools/canvastools.cxx                         |   16 +---
 basic/source/classes/eventatt.cxx                            |    6 -
 basic/source/uno/dlgcont.cxx                                 |    3 
 basic/source/uno/modsizeexceeded.cxx                         |    4 -
 14 files changed, 62 insertions(+), 98 deletions(-)

New commits:
commit ee2bb231036b1d9d954dec369855948e6ea1f53a
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jul 19 09:49:23 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 19 12:22:43 2019 +0200

    loplugin:referencecasting in avmedia..basic
    
    Change-Id: I6790b2e3902d64fb6f714f031affa221dbaba014
    Reviewed-on: https://gerrit.libreoffice.org/75934
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/avmedia/source/viewer/mediawindow_impl.cxx 
b/avmedia/source/viewer/mediawindow_impl.cxx
index a7e053cb911a..4aae993d5541 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -152,11 +152,7 @@ void MediaWindowImpl::dispose()
         mxPlayerWindow->removeKeyListener( uno::Reference< awt::XKeyListener 
>( pEventsIf, uno::UNO_QUERY ) );
         mxPlayerWindow->removeMouseListener( uno::Reference< 
awt::XMouseListener >( pEventsIf, uno::UNO_QUERY ) );
         mxPlayerWindow->removeMouseMotionListener( uno::Reference< 
awt::XMouseMotionListener >( pEventsIf, uno::UNO_QUERY ) );
-
-        uno::Reference< lang::XComponent > xComponent( mxPlayerWindow, 
uno::UNO_QUERY );
-        if (xComponent.is())
-            xComponent->dispose();
-
+        mxPlayerWindow->dispose();
         mxPlayerWindow.clear();
     }
 
@@ -222,7 +218,7 @@ uno::Reference< media::XPlayer > 
MediaWindowImpl::createPlayer(
             
xContext->getServiceManager()->createInstanceWithContext(rManagerServName, 
xContext),
             uno::UNO_QUERY );
         if( xManager.is() )
-            xPlayer.set( xManager->createPlayer( rURL ), uno::UNO_QUERY );
+            xPlayer = xManager->createPlayer( rURL );
         else
             SAL_INFO( "avmedia", "failed to create media player service " << 
rManagerServName );
     } catch ( const uno::Exception & )
diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx 
b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
index 0eac8917ed00..11b9610375b7 100644
--- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx
+++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
@@ -169,7 +169,7 @@ vcl::Window* AccessibleDialogControlShape::GetWindow() const
     vcl::Window* pWindow = nullptr;
     if ( m_pDlgEdObj )
     {
-        Reference< awt::XControl > xControl( m_pDlgEdObj->GetControl(), 
UNO_QUERY );
+        Reference< awt::XControl > xControl = m_pDlgEdObj->GetControl();
         if ( xControl.is() )
             pWindow = VCLUnoHelper::GetWindow( xControl->getPeer() ).get();
     }
diff --git a/basctl/source/basicide/baside3.cxx 
b/basctl/source/basicide/baside3.cxx
index eda571040c6b..ab9bbe06f544 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -1034,16 +1034,14 @@ bool implImportDialog(weld::Window* pWin, const 
OUString& rCurPath, const Script
                 }
                 else if( !bLibLocalized )
                 {
-                    Reference< resource::XStringResourceManager > 
xImportStringResourceManager( xImportStringResource, UNO_QUERY );
-                    LocalizationMgr::resetResourceForDialog( xDialogModel, 
xImportStringResourceManager );
+                    LocalizationMgr::resetResourceForDialog( xDialogModel, 
xImportStringResource );
                     bCopyResourcesForDialog = false;
                 }
 
                 if( bCopyResourcesForDialog )
                 {
-                    Reference< resource::XStringResourceResolver > 
xImportStringResourceResolver( xImportStringResource, UNO_QUERY );
                     LocalizationMgr::copyResourceForDroppedDialog( 
xDialogModel, aXmlDlgName,
-                        xLibStringResourceManager, 
xImportStringResourceResolver );
+                        xLibStringResourceManager, xImportStringResource );
                 }
             }
             else if( bLibLocalized )
diff --git a/basctl/source/basicide/bastype2.cxx 
b/basctl/source/basicide/bastype2.cxx
index 2141278861b2..b63a2f889daf 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -696,20 +696,16 @@ void TreeListBox::GetRootEntryBitmaps( const 
ScriptDocument& rDocument, Image& r
         try
         {
             OUString sModule( xModuleManager->identify( 
rDocument.getDocument() ) );
-            Reference< container::XNameAccess > xModuleConfig( xModuleManager, 
UNO_QUERY );
-            if ( xModuleConfig.is() )
+            Sequence< beans::PropertyValue > aModuleDescr;
+            xModuleManager->getByName( sModule ) >>= aModuleDescr;
+            sal_Int32 nCount = aModuleDescr.getLength();
+            const beans::PropertyValue* pModuleDescr = 
aModuleDescr.getConstArray();
+            for ( sal_Int32 i = 0; i < nCount; ++i )
             {
-                Sequence< beans::PropertyValue > aModuleDescr;
-                xModuleConfig->getByName( sModule ) >>= aModuleDescr;
-                sal_Int32 nCount = aModuleDescr.getLength();
-                const beans::PropertyValue* pModuleDescr = 
aModuleDescr.getConstArray();
-                for ( sal_Int32 i = 0; i < nCount; ++i )
+                if ( pModuleDescr[ i ].Name == 
"ooSetupFactoryEmptyDocumentURL" )
                 {
-                    if ( pModuleDescr[ i ].Name == 
"ooSetupFactoryEmptyDocumentURL" )
-                    {
-                        pModuleDescr[ i ].Value >>= sFactoryURL;
-                        break;
-                    }
+                    pModuleDescr[ i ].Value >>= sFactoryURL;
+                    break;
                 }
             }
         }
@@ -1392,20 +1388,16 @@ OUString SbTreeListBox::GetRootEntryBitmaps(const 
ScriptDocument& rDocument)
         try
         {
             OUString sModule( xModuleManager->identify( 
rDocument.getDocument() ) );
-            Reference< container::XNameAccess > xModuleConfig( xModuleManager, 
UNO_QUERY );
-            if ( xModuleConfig.is() )
+            Sequence< beans::PropertyValue > aModuleDescr;
+            xModuleManager->getByName( sModule ) >>= aModuleDescr;
+            sal_Int32 nCount = aModuleDescr.getLength();
+            const beans::PropertyValue* pModuleDescr = 
aModuleDescr.getConstArray();
+            for ( sal_Int32 i = 0; i < nCount; ++i )
             {
-                Sequence< beans::PropertyValue > aModuleDescr;
-                xModuleConfig->getByName( sModule ) >>= aModuleDescr;
-                sal_Int32 nCount = aModuleDescr.getLength();
-                const beans::PropertyValue* pModuleDescr = 
aModuleDescr.getConstArray();
-                for ( sal_Int32 i = 0; i < nCount; ++i )
+                if ( pModuleDescr[ i ].Name == 
"ooSetupFactoryEmptyDocumentURL" )
                 {
-                    if ( pModuleDescr[ i ].Name == 
"ooSetupFactoryEmptyDocumentURL" )
-                    {
-                        pModuleDescr[ i ].Value >>= sFactoryURL;
-                        break;
-                    }
+                    pModuleDescr[ i ].Value >>= sFactoryURL;
+                    break;
                 }
             }
         }
diff --git a/basctl/source/basicide/bastype3.cxx 
b/basctl/source/basicide/bastype3.cxx
index 084b7def7345..e4944bda3f97 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -89,7 +89,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry 
)
 
             // load dialog library
             bool bDlgLibLoaded = false;
-            Reference< script::XLibraryContainer > xDlgLibContainer( 
aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
+            Reference< script::XLibraryContainer > xDlgLibContainer = 
aDocument.getLibraryContainer( E_DIALOGS );
             if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( 
aOULibName ) )
             {
                 if ( !xDlgLibContainer->isLibraryLoaded( aOULibName ) )
@@ -178,7 +178,7 @@ IMPL_LINK(SbTreeListBox, RequestingChildrenHdl, const 
weld::TreeIter&, rEntry, b
 
             // load dialog library
             bool bDlgLibLoaded = false;
-            Reference< script::XLibraryContainer > xDlgLibContainer( 
aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
+            Reference< script::XLibraryContainer > xDlgLibContainer = 
aDocument.getLibraryContainer( E_DIALOGS );
             if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( 
aOULibName ) )
             {
                 if ( !xDlgLibContainer->isLibraryLoaded( aOULibName ) )
diff --git a/basctl/source/basicide/iderdll.cxx 
b/basctl/source/basicide/iderdll.cxx
index 12b8c3f6a8a9..9f2f2dcf6315 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -179,7 +179,7 @@ IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC 
*, pBasic, BasicDebug
             if ( aDocument.isValid() )
             {
                 OUString aOULibName( pBasic->GetName() );
-                Reference< script::XLibraryContainer > xModLibContainer( 
aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
+                Reference< script::XLibraryContainer > xModLibContainer = 
aDocument.getLibraryContainer( E_SCRIPTS );
                 if ( xModLibContainer.is() && xModLibContainer->hasByName( 
aOULibName ) )
                 {
                     Reference< script::XLibraryContainerPassword > xPasswd( 
xModLibContainer, UNO_QUERY );
diff --git a/basctl/source/basicide/moduldl2.cxx 
b/basctl/source/basicide/moduldl2.cxx
index 37254f2c63ee..515cbc55aa67 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -271,8 +271,7 @@ IMPL_LINK(LibPage, EditingEntryHdl, const weld::TreeIter&, 
rIter, bool)
         if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) 
&& !xPasswd->isLibraryPasswordVerified( aLibName ) )
         {
             OUString aPassword;
-            Reference< script::XLibraryContainer > xModLibContainer1( 
xModLibContainer, UNO_QUERY );
-            bOK = QueryPassword( xModLibContainer1, aLibName, aPassword );
+            bOK = QueryPassword( xModLibContainer, aLibName, aPassword );
         }
         if ( !bOK )
             return false;
@@ -613,13 +612,13 @@ void LibPage::InsertLib()
     OUString aModURL( aModURLObj.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ) );
     if ( xSFA->exists( aModURL ) )
     {
-        xModLibContImport.set( 
script::DocumentScriptLibraryContainer::createWithURL(xContext, aModURL), 
UNO_QUERY );
+        xModLibContImport = 
script::DocumentScriptLibraryContainer::createWithURL(xContext, aModURL);
     }
 
     OUString aDlgURL( aDlgURLObj.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ) );
     if ( xSFA->exists( aDlgURL ) )
     {
-        xDlgLibContImport.set( 
script::DocumentDialogLibraryContainer::createWithURL(xContext, aDlgURL), 
UNO_QUERY );
+        xDlgLibContImport = 
script::DocumentDialogLibraryContainer::createWithURL(xContext, aDlgURL);
     }
 
     if ( !xModLibContImport.is() && !xDlgLibContImport.is() )
@@ -627,9 +626,7 @@ void LibPage::InsertLib()
 
     std::shared_ptr<LibDialog> xLibDlg;
 
-    Reference< script::XLibraryContainer > xModLibContImp( xModLibContImport, 
UNO_QUERY );
-    Reference< script::XLibraryContainer > xDlgLibContImp( xDlgLibContImport, 
UNO_QUERY );
-    Sequence< OUString > aLibNames = GetMergedLibraryNames( xModLibContImp, 
xDlgLibContImp );
+    Sequence< OUString > aLibNames = GetMergedLibraryNames( xModLibContImport, 
xDlgLibContImport );
     sal_Int32 nLibCount = aLibNames.getLength();
     const OUString* pLibNames = aLibNames.getConstArray();
     for ( sal_Int32 i = 0 ; i < nLibCount ; i++ )
@@ -672,7 +669,7 @@ void LibPage::InsertLib()
     if ( aExtension != aLibExtension && aExtension != aContExtension )
         xLibDlg->EnableReference(false);
 
-    weld::DialogController::runAsync(xLibDlg, [aContExtension, aDlgURLObj, 
aExtension, aLibExtension, aModURLObj, xLibDlg, xDlgLibContImport, 
xModLibContImp, xModLibContImport, this](sal_Int32 nResult)
+    weld::DialogController::runAsync(xLibDlg, [aContExtension, aDlgURLObj, 
aExtension, aLibExtension, aModURLObj, xLibDlg, xDlgLibContImport, 
xModLibContImport, this](sal_Int32 nResult)
         {
             if (!nResult )
                 return;
@@ -744,7 +741,7 @@ void LibPage::InsertLib()
                         Reference< script::XLibraryContainerPassword > 
xPasswd( xModLibContImport, UNO_QUERY );
                         if ( xPasswd.is() && 
xPasswd->isLibraryPasswordProtected( aLibName ) && 
!xPasswd->isLibraryPasswordVerified( aLibName ) && !bReference )
                         {
-                            bOK = QueryPassword( xModLibContImp, aLibName, 
aPassword, true, true );
+                            bOK = QueryPassword( xModLibContImport, aLibName, 
aPassword, true, true );
 
                             if ( !bOK )
                             {
@@ -928,8 +925,7 @@ void LibPage::Export()
         if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) 
&& !xPasswd->isLibraryPasswordVerified( aLibName ) )
         {
             OUString aPassword;
-            Reference< script::XLibraryContainer > xModLibContainer1( 
xModLibContainer, UNO_QUERY );
-            bOK = QueryPassword( xModLibContainer1, aLibName, aPassword );
+            bOK = QueryPassword( xModLibContainer, aLibName, aPassword );
         }
         if ( !bOK )
             return;
@@ -1052,10 +1048,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
         Reference< task::XInteractionHandler > xDummyHandler( new 
DummyInteractionHandler( xHandler ) );
         implExportLib( aLibName, aTmpPath, xDummyHandler );
 
-        Reference< XCommandEnvironment > xCmdEnv =
-                new OLibCommandEnvironment(
-                    Reference< task::XInteractionHandler >(
-                        xHandler, UNO_QUERY));
+        Reference< XCommandEnvironment > xCmdEnv = new 
OLibCommandEnvironment(xHandler);
 
         ::ucbhelper::Content sourceContent( aSourcePath, xCmdEnv, 
comphelper::getProcessComponentContext() );
 
diff --git a/basctl/source/basicide/moduldlg.cxx 
b/basctl/source/basicide/moduldlg.cxx
index 531fd7a00e0e..cf4ff447547f 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -165,8 +165,7 @@ void Shell::CopyDialogResources(
     {
         if( bSourceLocalized && bDestLocalized )
         {
-            Reference< resource::XStringResourceResolver > 
xSourceStringResolver( xSourceMgr, UNO_QUERY );
-            LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, 
rDlgName, xDestMgr, xSourceStringResolver );
+            LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, 
rDlgName, xDestMgr, xSourceMgr );
         }
         else if( bSourceLocalized )
         {
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 33d10a9ed7df..9d276a92ff7b 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -362,11 +362,10 @@ void DlgEditor::SetDialog( const uno::Reference< 
container::XNameContainer >& xU
     pDlgEdForm->StartListening();
 
     // create controls
-    Reference< css::container::XNameAccess > xNameAcc( 
m_xUnoControlDialogModel, UNO_QUERY );
-    if ( xNameAcc.is() )
+    if ( m_xUnoControlDialogModel.is() )
     {
         // get sequence of control names
-        Sequence< OUString > aNames = xNameAcc->getElementNames();
+        Sequence< OUString > aNames = 
m_xUnoControlDialogModel->getElementNames();
         const OUString* pNames = aNames.getConstArray();
         sal_Int32 nCtrls = aNames.getLength();
 
@@ -379,7 +378,7 @@ void DlgEditor::SetDialog( const uno::Reference< 
container::XNameContainer >& xU
 
             // get tab index
             sal_Int16 nTabIndex = -1;
-            Any aCtrl = xNameAcc->getByName( aName );
+            Any aCtrl = m_xUnoControlDialogModel->getByName( aName );
             Reference< css::beans::XPropertySet > xPSet;
             aCtrl >>= xPSet;
             if ( xPSet.is() )
@@ -392,7 +391,7 @@ void DlgEditor::SetDialog( const uno::Reference< 
container::XNameContainer >& xU
         // create controls and insert them into drawing page
         for (auto const& indexToName : aIndexToNameMap)
         {
-            Any aCtrl = xNameAcc->getByName( indexToName.second );
+            Any aCtrl = m_xUnoControlDialogModel->getByName( 
indexToName.second );
             Reference< css::awt::XControlModel > xCtrlModel;
             aCtrl >>= xCtrlModel;
             DlgEdObj* pCtrlObj = new DlgEdObj(*pDlgEdModel);
@@ -679,10 +678,9 @@ void DlgEditor::Copy()
     Reference< util::XCloneable > xNewClone = xClone->createClone();
     Reference< container::XNameContainer > xClipDialogModel( xNewClone, 
UNO_QUERY );
 
-    Reference< container::XNameAccess > xNAcc( xClipDialogModel, UNO_QUERY );
-    if ( xNAcc.is() )
+    if ( xClipDialogModel.is() )
     {
-        Sequence< OUString > aNames = xNAcc->getElementNames();
+        Sequence< OUString > aNames = xClipDialogModel->getElementNames();
         const OUString* pNames = aNames.getConstArray();
         sal_uInt32 nCtrls = aNames.getLength();
 
@@ -708,10 +706,9 @@ void DlgEditor::Copy()
                 xMarkPSet->getPropertyValue( DLGED_PROP_NAME ) >>= aName;
             }
 
-            Reference< container::XNameAccess > 
xNameAcc(m_xUnoControlDialogModel, UNO_QUERY );
-            if ( xNameAcc.is() && xNameAcc->hasByName(aName) )
+            if ( m_xUnoControlDialogModel.is() && 
m_xUnoControlDialogModel->hasByName(aName) )
             {
-                Any aCtrl = xNameAcc->getByName( aName );
+                Any aCtrl = m_xUnoControlDialogModel->getByName( aName );
 
                 // clone control model
                 Reference< util::XCloneable > xCtrl;
@@ -759,9 +756,7 @@ void DlgEditor::Copy()
             // With resource, support old and new format
 
             // Export xClipDialogModel another time with ids replaced by 
current language string
-            uno::Reference< resource::XStringResourceManager >
-                xStringResourceManager( xStringResourcePersistence, 
uno::UNO_QUERY );
-            LocalizationMgr::resetResourceForDialog( xClipDialogModel, 
xStringResourceManager );
+            LocalizationMgr::resetResourceForDialog( xClipDialogModel, 
xStringResourcePersistence );
             Reference< XInputStreamProvider > xISP2 = 
::xmlscript::exportDialogModel( xClipDialogModel, xContext, m_xDocument );
             Reference< XInputStream > xStream2( xISP2->createInputStream() );
             Sequence< sal_Int8 > NoResourceDialogModelBytes;
@@ -906,10 +901,9 @@ void DlgEditor::Paste()
                 }
 
                 // get control models from clipboard dialog model
-                Reference< css::container::XNameAccess > xNameAcc( 
xClipDialogModel, UNO_QUERY );
-                if ( xNameAcc.is() )
+                if ( xClipDialogModel.is() )
                 {
-                    Sequence< OUString > aNames = xNameAcc->getElementNames();
+                    Sequence< OUString > aNames = 
xClipDialogModel->getElementNames();
                     const OUString* pNames = aNames.getConstArray();
                     sal_uInt32 nCtrls = aNames.getLength();
 
@@ -921,7 +915,7 @@ void DlgEditor::Paste()
                     }
                     for( sal_uInt32 n = 0; n < nCtrls; n++ )
                     {
-                        Any aA = xNameAcc->getByName( pNames[n] );
+                        Any aA = xClipDialogModel->getByName( pNames[n] );
                         Reference< css::awt::XControlModel > xCM;
                         aA >>= xCM;
 
@@ -940,8 +934,7 @@ void DlgEditor::Paste()
                         xPSet->setPropertyValue( DLGED_PROP_NAME, 
Any(aOUniqueName) );
 
                         // set tabindex
-                        Reference< container::XNameAccess > xNA( 
m_xUnoControlDialogModel , UNO_QUERY );
-                        Sequence< OUString > aNames_ = xNA->getElementNames();
+                        Sequence< OUString > aNames_ = 
m_xUnoControlDialogModel->getElementNames();
                         xPSet->setPropertyValue( DLGED_PROP_TABINDEX, 
Any(static_cast<sal_Int16>(aNames_.getLength())) );
 
                         if( bLocalized )
@@ -950,10 +943,8 @@ void DlgEditor::Paste()
                             aControlAny <<= xCtrlModel;
                             if( bSourceIsLocalized && 
xStringResourcePersistence.is() )
                             {
-                                Reference< resource::XStringResourceResolver >
-                                    xSourceStringResolver( 
xStringResourcePersistence, UNO_QUERY );
                                 
LocalizationMgr::copyResourcesForPastedEditorObject( this,
-                                    aControlAny, aOUniqueName, 
xSourceStringResolver );
+                                    aControlAny, aOUniqueName, 
xStringResourcePersistence );
                             }
                             else
                             {
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 32ad92c98692..0d491bd303e0 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -464,7 +464,7 @@ void DlgEdObj::NameChange( const  
css::beans::PropertyChangeEvent& evt )
                 Reference< container::XNameContainer > xCont(xNameAcc, 
UNO_QUERY );
                 if ( xCont.is() )
                 {
-                    Reference< awt::XControlModel > 
xCtrl(GetUnoControlModel(), UNO_QUERY);
+                    Reference< awt::XControlModel > xCtrl = 
GetUnoControlModel();
                     Any aAny;
                     aAny <<= xCtrl;
                     xCont->removeByName( aOldName );
@@ -1521,7 +1521,7 @@ void DlgEdForm::UpdateGroups()
         sal_uInt32 nSize = aChildList.size();
         Sequence< Reference< awt::XControl > > aSeqControls( nSize );
         for ( sal_uInt32 i = 0; i < nSize; ++i )
-            aSeqControls.getArray()[i].set( aChildList[i]->GetControl(), 
UNO_QUERY );
+            aSeqControls.getArray()[i] = aChildList[i]->GetControl();
 
         sal_Int32 nGroupCount = xTabModel->getGroupCount();
         for ( sal_Int32 nGroup = 0; nGroup < nGroupCount; ++nGroup )
@@ -1557,7 +1557,7 @@ void DlgEdForm::UpdateGroups()
             }
 
             // set the group at the dialog peer
-            Reference< awt::XControl > xDlg( GetControl(), UNO_QUERY );
+            Reference< awt::XControl > xDlg = GetControl();
             if ( xDlg.is() )
             {
                 Reference< awt::XVclContainerPeer > xDlgPeer( xDlg->getPeer(), 
UNO_QUERY );
diff --git a/basegfx/source/tools/canvastools.cxx 
b/basegfx/source/tools/canvastools.cxx
index e91d0c636a22..3d87887e37ac 100644
--- a/basegfx/source/tools/canvastools.cxx
+++ b/basegfx/source/tools/canvastools.cxx
@@ -137,16 +137,14 @@ namespace basegfx
                 uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > 
> outputSequence( 1 );
                 outputSequence[0] = bezierSequenceFromB2DPolygon( rPoly );
 
-                xRes.set( xGraphicDevice->createCompatibleBezierPolyPolygon( 
outputSequence ),
-                          uno::UNO_QUERY );
+                xRes = xGraphicDevice->createCompatibleBezierPolyPolygon( 
outputSequence );
             }
             else
             {
                 uno::Sequence< uno::Sequence< geometry::RealPoint2D > > 
outputSequence( 1 );
                 outputSequence[0] = pointSequenceFromB2DPolygon( rPoly );
 
-                xRes.set( xGraphicDevice->createCompatibleLinePolyPolygon( 
outputSequence ),
-                          uno::UNO_QUERY );
+                xRes = xGraphicDevice->createCompatibleLinePolyPolygon( 
outputSequence );
             }
 
             if( xRes.is() && rPoly.isClosed() )
@@ -168,15 +166,13 @@ namespace basegfx
 
             if( rPolyPoly.areControlPointsUsed() )
             {
-                xRes.set( xGraphicDevice->createCompatibleBezierPolyPolygon(
-                              bezierSequenceSequenceFromB2DPolyPolygon( 
rPolyPoly ) ),
-                          uno::UNO_QUERY );
+                xRes = xGraphicDevice->createCompatibleBezierPolyPolygon(
+                              bezierSequenceSequenceFromB2DPolyPolygon( 
rPolyPoly ) );
             }
             else
             {
-                xRes.set( xGraphicDevice->createCompatibleLinePolyPolygon(
-                              pointSequenceSequenceFromB2DPolyPolygon( 
rPolyPoly ) ),
-                          uno::UNO_QUERY );
+                xRes = xGraphicDevice->createCompatibleLinePolyPolygon(
+                              pointSequenceSequenceFromB2DPolyPolygon( 
rPolyPoly ) );
             }
 
             for( i=0; i<nNumPolies; ++i )
diff --git a/basic/source/classes/eventatt.cxx 
b/basic/source/classes/eventatt.cxx
index 5df743ab4589..457a3d570378 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -90,7 +90,7 @@ void SFURL_firing_impl( const ScriptEvent& aScriptEvent, Any* 
pRet, const Refere
 
                 Any aCtx;
                 aCtx <<= OUString("user");
-                xScriptProvider.set( xFactory->createScriptProvider( aCtx ), 
UNO_QUERY );
+                xScriptProvider = xFactory->createScriptProvider( aCtx );
             }
 
             if ( !xScriptProvider.is() )
@@ -483,10 +483,10 @@ void RTL_Impl_CreateUnoDialog( SbxArray& rPar )
     {
         Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( 
xContext );
         Reference< container::XEnumeration > xModels;
-        Reference< container::XEnumerationAccess > xComponents( 
xDesktop->getComponents(), UNO_QUERY );
+        Reference< container::XEnumerationAccess > xComponents = 
xDesktop->getComponents();
         if ( xComponents.is() )
         {
-            xModels.set( xComponents->createEnumeration(), UNO_QUERY );
+            xModels = xComponents->createEnumeration();
         }
         if ( xModels.is() )
         {
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index f458e65df0e3..2d4c1f6e532c 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -560,8 +560,7 @@ Reference< resource::XStringResourceResolver >
     if( !m_xStringResourcePersistence.is() )
         m_xStringResourcePersistence = m_pParent->implCreateStringResource( 
this );
 
-    Reference< resource::XStringResourceResolver > xRet( 
m_xStringResourcePersistence, UNO_QUERY );
-    return xRet;
+    return m_xStringResourcePersistence;
 }
 
 bool SfxDialogLibrary::containsValidDialog( const css::uno::Any& aElement )
diff --git a/basic/source/uno/modsizeexceeded.cxx 
b/basic/source/uno/modsizeexceeded.cxx
index a4a0ce78e536..a54b426c719e 100644
--- a/basic/source/uno/modsizeexceeded.cxx
+++ b/basic/source/uno/modsizeexceeded.cxx
@@ -34,8 +34,8 @@ ModuleSizeExceeded::ModuleSizeExceeded( const std::vector< 
OUString >& sModules
 
     m_aRequest <<= aReq;
 
-    m_xAbort.set( uno::Reference< task::XInteractionAbort >(new 
comphelper::OInteractionAbort), uno::UNO_QUERY );
-    m_xApprove.set( uno::Reference< task::XInteractionApprove >(new 
comphelper::OInteractionApprove ), uno::UNO_QUERY );
+    m_xAbort = new comphelper::OInteractionAbort;
+    m_xApprove = new comphelper::OInteractionApprove;
     m_lContinuations.realloc( 2 );
     m_lContinuations[0] =  m_xApprove;
     m_lContinuations[1] = m_xAbort;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to