diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-04 15:36:18 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-05 07:41:29 +0200 |
commit | 0eb9f56db5dad711f12283d097e1d56a801ba526 (patch) | |
tree | 5f3d939447347f8b44921ce23f8d0b261e64ead2 /scripting | |
parent | a17cfe9de14d83c28cae142a64782387dcaa4864 (diff) |
use uno::Reference::set method instead of assignment
Change-Id: I2b592fd3327f4bbe4685e84711dc9d6f19222a97
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/basprov/basprov.cxx | 2 | ||||
-rw-r--r-- | scripting/source/dlgprov/dlgevtatt.cxx | 6 | ||||
-rw-r--r-- | scripting/source/dlgprov/dlgprov.cxx | 15 | ||||
-rw-r--r-- | scripting/source/protocolhandler/scripthandler.cxx | 3 | ||||
-rw-r--r-- | scripting/source/provider/BrowseNodeFactoryImpl.cxx | 7 | ||||
-rw-r--r-- | scripting/source/provider/MasterScriptProvider.cxx | 4 | ||||
-rw-r--r-- | scripting/source/provider/ProviderCache.cxx | 2 | ||||
-rw-r--r-- | scripting/source/stringresource/stringresource.cxx | 4 | ||||
-rw-r--r-- | scripting/source/vbaevents/eventhelper.cxx | 2 |
9 files changed, 21 insertions, 24 deletions
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx index 594d7ded6bea..2816d85cf36f 100644 --- a/scripting/source/basprov/basprov.cxx +++ b/scripting/source/basprov/basprov.cxx @@ -274,7 +274,7 @@ namespace basprov m_pAppBasicManager = SfxApplication::GetBasicManager(); if ( !m_xLibContainerApp.is() ) - m_xLibContainerApp = Reference< script::XLibraryContainer >( SfxGetpApp()->GetBasicContainer(), UNO_QUERY ); + m_xLibContainerApp.set( SfxGetpApp()->GetBasicContainer(), UNO_QUERY ); } diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx index 1eb20b76b4c5..55666eea9461 100644 --- a/scripting/source/dlgprov/dlgevtatt.cxx +++ b/scripting/source/dlgprov/dlgevtatt.cxx @@ -111,7 +111,7 @@ namespace dlgprov if ( xSMgr.is() ) { args[0] <<= xModel; - mxListener = Reference< XScriptListener >( xSMgr->createInstanceWithArgumentsAndContext( "ooo.vba.EventListener", args, m_xContext ), UNO_QUERY ); + mxListener.set( xSMgr->createInstanceWithArgumentsAndContext( "ooo.vba.EventListener", args, m_xContext ), UNO_QUERY ); } if ( rxControl.is() ) { @@ -315,7 +315,7 @@ namespace dlgprov for ( sal_Int32 i2 = 0; i2 < nControlCount; ++i2 ) { - pObjects2[i2] = Reference< XInterface >( pControls[i2], UNO_QUERY ); + pObjects2[i2].set( pControls[i2], UNO_QUERY ); } nestedAttachEvents( aObjects, Helper, sDialogCodeName ); } @@ -341,7 +341,7 @@ namespace dlgprov Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager() ); if ( xSMgr.is() ) { - m_xEventAttacher = Reference< XEventAttacher >( xSMgr->createInstanceWithContext( + m_xEventAttacher.set( xSMgr->createInstanceWithContext( "com.sun.star.script.EventAttacher", m_xContext ), UNO_QUERY ); if ( !m_xEventAttacher.is() ) diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 1d51a3ae3fbc..545188613e94 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -284,7 +284,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver"; Reference< uri::XUriReference > uriRef; for (;;) { - uriRef = Reference< uri::XUriReference >( xFac->parse( aURL ), UNO_QUERY ); + uriRef.set( xFac->parse( aURL ), UNO_QUERY ); if ( !uriRef.is() ) { OUString errorMsg("DialogProviderImpl::getDialogModel: failed to parse URI: "); @@ -334,7 +334,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver"; if ( sLocation == "application" ) { - xLibContainer = Reference< XLibraryContainer >( SfxGetpApp()->GetDialogContainer(), UNO_QUERY ); + xLibContainer.set( SfxGetpApp()->GetDialogContainer(), UNO_QUERY ); } else if ( sLocation == "document" ) { @@ -447,7 +447,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver"; Reference< container::XNameContainer > xDialogModel( createDialogModel( xInput , xStringResourceManager, aDialogSourceURLAny ), UNO_QUERY_THROW); - xCtrlModel = Reference< XControlModel >( xDialogModel, UNO_QUERY ); + xCtrlModel.set( xDialogModel, UNO_QUERY ); } return xCtrlModel; } @@ -485,7 +485,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver"; { Reference< frame::XFrame > xFrame( xController->getFrame(), UNO_QUERY ); if ( xFrame.is() ) - xPeer = Reference< XWindowPeer>( xFrame->getContainerWindow(), UNO_QUERY ); + xPeer.set( xFrame->getContainerWindow(), UNO_QUERY ); } } @@ -519,11 +519,11 @@ static const char aResourceResolverPropName[] = "ResourceResolver"; Reference< XInterface >* pObjects = aObjects.getArray(); for ( sal_Int32 i = 0; i < nControlCount; ++i ) { - pObjects[i] = Reference<XInterface>( pControls[i], UNO_QUERY ); + pObjects[i].set( pControls[i], UNO_QUERY ); } // also add the dialog control itself to the sequence - pObjects[nControlCount] = Reference<XInterface>( rxControl, UNO_QUERY ); + pObjects[nControlCount].set( rxControl, UNO_QUERY ); Reference< XScriptEventsAttacher > xScriptEventsAttacher = new DialogEventsAttacherImpl ( m_xContext, m_xModel, rxControl, rxHandler, rxIntrospectionAccess, @@ -684,10 +684,9 @@ static const char aResourceResolverPropName[] = "ResourceResolver"; } } - xCtrl = Reference< XControl >( createDialogControl( xCtrlMod, xParent ) ); + xCtrl.set( createDialogControl( xCtrlMod, xParent ) ); if ( xCtrl.is() ) { - //xDialog = Reference< XDialog >( xCtrl, UNO_QUERY ); Reference< XIntrospectionAccess > xIntrospectionAccess = inspectHandler( xHandler ); attachControlEvents( xCtrl, xHandler, xIntrospectionAccess, bDialogProviderMode ); } diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index 1f5ef05a3d1b..32792d7b142a 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -420,8 +420,7 @@ void ScriptProtocolHandler::createScriptProvider() Any aContext; if ( getScriptInvocation() ) aContext = makeAny( m_xScriptInvocation ); - m_xScriptProvider = Reference< provider::XScriptProvider > ( - xFac->createScriptProvider( aContext ), UNO_QUERY_THROW ); + m_xScriptProvider.set( xFac->createScriptProvider( aContext ), UNO_QUERY_THROW ); } } catch ( const RuntimeException & e ) diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx index 74a6abfe5d6f..75072a244a3c 100644 --- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx +++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx @@ -308,8 +308,8 @@ Sequence< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Reference< { xFac = provider::theMasterScriptProviderFactory::get( xCtx ); - locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( OUString("user") ) ), UNO_QUERY_THROW ); - locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( OUString("share") ) ), UNO_QUERY_THROW ); + locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( makeAny( OUString("user") ) ), UNO_QUERY_THROW ); + locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( makeAny( OUString("share") ) ), UNO_QUERY_THROW ); } // TODO proper exception handling, should throw catch( const Exception& e ) @@ -339,8 +339,7 @@ Sequence< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Reference< { Reference< document::XEmbeddedScripts > xScripts( model, UNO_QUERY ); if ( xScripts.is() ) - locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( - xFac->createScriptProvider( makeAny( model ) ), UNO_QUERY_THROW ); + locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( makeAny( model ) ), UNO_QUERY_THROW ); } } } diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index b1934e01354c..1b6fea093de0 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -436,12 +436,12 @@ MasterScriptProvider::getChildNodes() sal_Int32 provIndex = 0; for ( ; provIndex < providers.getLength(); provIndex++ ) { - children[ provIndex ] = Reference< browse::XBrowseNode >( providers[ provIndex ], UNO_QUERY ); + children[ provIndex ].set( providers[ provIndex ], UNO_QUERY ); } if ( hasPkgs ) { - children[ provIndex ] = Reference< browse::XBrowseNode >( pkgProv, UNO_QUERY ); + children[ provIndex ].set( pkgProv, UNO_QUERY ); } diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx index 6a133e15de6b..854b8235163f 100644 --- a/scripting/source/provider/ProviderCache.cxx +++ b/scripting/source/provider/ProviderCache.cxx @@ -140,7 +140,7 @@ ProviderCache::populateCache() throw ( RuntimeException ) { OUString languageProviderName( "com.sun.star.script.provider.LanguageScriptProvider" ); - Reference< container::XContentEnumerationAccess > xEnumAccess = Reference< container::XContentEnumerationAccess >( m_xMgr, UNO_QUERY_THROW ); + Reference< container::XContentEnumerationAccess > xEnumAccess( m_xMgr, UNO_QUERY_THROW ); Reference< container::XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( languageProviderName ); while ( xEnum->hasMoreElements() ) diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 95ac7bedf04d..11ef0be74de7 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -1277,7 +1277,7 @@ BinaryOutput::BinaryOutput( Reference< XMultiComponentFactory > xMCF, , m_xContext( xContext ) { m_xTempFile = io::TempFile::create( m_xContext ); - m_xOutputStream = Reference< io::XOutputStream >( m_xTempFile, UNO_QUERY_THROW ); + m_xOutputStream.set( m_xTempFile, UNO_QUERY_THROW ); } template< class T > @@ -1510,7 +1510,7 @@ Reference< io::XInputStream > BinaryInput::getInputStreamForSection( sal_Int32 n if( xSeekable.is() ) xSeekable->seek( 0 ); - xIn = Reference< io::XInputStream>( xTempOut, UNO_QUERY ); + xIn.set( xTempOut, UNO_QUERY ); } else OSL_FAIL( "BinaryInput::getInputStreamForSection(): Read past end" ); diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx index ac6a5c06b4e8..0f8f582a3e6b 100644 --- a/scripting/source/vbaevents/eventhelper.cxx +++ b/scripting/source/vbaevents/eventhelper.cxx @@ -604,7 +604,7 @@ public: xCloseBroadcaster->removeCloseListener( this ); } // Add the listener into the new XCloseBroadcaster. - xCloseBroadcaster = uno::Reference< util::XCloseBroadcaster >( xModel, uno::UNO_QUERY ); + xCloseBroadcaster.set( xModel, uno::UNO_QUERY ); if (xCloseBroadcaster.is()) { xCloseBroadcaster->addCloseListener( this ); |