summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-30 07:59:06 +0200
committerNoel Grandin <noel@peralex.com>2015-10-30 11:08:36 +0200
commitcb4fa1d1e2e61b686442a9d26220c0f1a6e1d4e7 (patch)
tree2d819dbc32230f7af209b59a5c1f262f4964fa84 /comphelper
parent3bc5df7f32501075149e4b41f6e98ea8dd2cfcbd (diff)
use uno::Reference::set method instead of assignment
Change-Id: I080668f86f0ab8b3bba857ee21411f907ae285c4
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/container.cxx2
-rw-r--r--comphelper/source/container/embeddedobjectcontainer.cxx21
-rw-r--r--comphelper/source/eventattachermgr/eventattachermgr.cxx2
-rw-r--r--comphelper/source/misc/dispatchcommand.cxx2
-rw-r--r--comphelper/source/misc/instancelocker.cxx6
-rw-r--r--comphelper/source/misc/logging.cxx2
-rw-r--r--comphelper/source/misc/mimeconfighelper.cxx9
-rw-r--r--comphelper/source/streaming/seekableinput.cxx8
-rw-r--r--comphelper/source/streaming/seqinputstreamserv.cxx4
-rw-r--r--comphelper/source/streaming/seqoutputstreamserv.cxx2
10 files changed, 27 insertions, 31 deletions
diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx
index 9bd468e9d450..a8bd89639451 100644
--- a/comphelper/source/container/container.cxx
+++ b/comphelper/source/container/container.cxx
@@ -79,7 +79,7 @@ css::uno::Reference< css::uno::XInterface> IndexAccessIterator::Next()
OSL_ENSURE(xChild.is(), "IndexAccessIterator::Next : a content has no appropriate interface !");
css::uno::Reference< css::uno::XInterface> xParent( xChild->getParent());
- xContainerAccess = css::uno::Reference< css::container::XIndexAccess>(xParent, css::uno::UNO_QUERY);
+ xContainerAccess.set(xParent, css::uno::UNO_QUERY);
OSL_ENSURE(xContainerAccess.is(), "IndexAccessIterator::Next : a content has an invalid parent !");
// Remove the index that SearchLoop had within this parent from my stack
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index caa2d251b124..fa86241957ec 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -174,7 +174,7 @@ void EmbeddedObjectContainer::ReleaseImageSubStorage()
try
{
pImpl->mxImageStorage->dispose();
- pImpl->mxImageStorage = uno::Reference< embed::XStorage >();
+ pImpl->mxImageStorage.clear();
}
catch (const uno::Exception&)
{
@@ -346,7 +346,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::Get_Impl( con
uno::Sequence< beans::PropertyValue > aMediaDescr( 1 );
aMediaDescr[0].Name = "ReadOnly";
aMediaDescr[0].Value <<= bReadOnlyMode;
- xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitFromEntry(
+ xObj.set( xFactory->createInstanceInitFromEntry(
pImpl->mxStorage, rName,
aMediaDescr, aObjDescr ), uno::UNO_QUERY );
@@ -379,7 +379,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde
aObjDescr[0].Name = "Parent";
aObjDescr[0].Value <<= pImpl->m_xModel.get();
::std::copy( rArgs.begin(), rArgs.end(), aObjDescr.getArray() + 1 );
- xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
+ xObj.set( xFactory->createInstanceInitNew(
rClassId, OUString(), pImpl->mxStorage, rNewName,
aObjDescr ), uno::UNO_QUERY );
@@ -595,7 +595,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = "Parent";
aObjDescr[0].Value <<= pImpl->m_xModel.get();
- xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitFromMediaDescriptor(
+ xObj.set( xFactory->createInstanceInitFromMediaDescriptor(
pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY );
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
@@ -627,8 +627,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = "Parent";
aObjDescr[0].Value <<= pImpl->m_xModel.get();
- xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceLink(
- pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY );
+ xObj.set( xFactory->createInstanceLink( pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY );
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
@@ -716,8 +715,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = "Parent";
aObjDescr[0].Value <<= pImpl->m_xModel.get();
- xResult = uno::Reference < embed::XEmbeddedObject >(
- xCreator->createInstanceLink(
+ xResult.set(xCreator->createInstanceLink(
pImpl->mxStorage,
rName,
aMediaDescr,
@@ -740,8 +738,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
aObjDescr[0].Name = "Parent";
aObjDescr[0].Value <<= pImpl->m_xModel.get();
- xResult = uno::Reference < embed::XEmbeddedObject >(
- xCreator->createInstanceInitNew(
+ xResult.set(xCreator->createInstanceInitNew(
xObj->getClassID(),
xObj->getClassName(),
pImpl->mxStorage,
@@ -791,7 +788,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
catch (const uno::Exception&)
{
}
- xResult = uno::Reference< embed::XEmbeddedObject >();
+ xResult.clear();
}
}
}
@@ -996,7 +993,7 @@ bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < embed
xPersist->storeAsEntry( pImpl->mxTempStorage, aTmpPersistName, aSeq, aSeq );
xPersist->saveCompleted( sal_True );
- pImpl->maTempObjectContainer[ aTmpPersistName ] = uno::Reference < embed::XEmbeddedObject >();
+ pImpl->maTempObjectContainer[ aTmpPersistName ].clear();
*/
if ( !pImpl->mpTempObjectContainer )
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index 6140d5c294e4..12101471bc97 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -369,7 +369,7 @@ ImplEventAttacherManager::ImplEventAttacherManager( const Reference< XIntrospect
"com.sun.star.script.EventAttacher", rContext) );
if ( xIFace.is() )
{
- xAttacher = Reference< XEventAttacher2 >::query( xIFace );
+ xAttacher.set( xIFace, UNO_QUERY );
}
xConverter = Converter::create(rContext);
}
diff --git a/comphelper/source/misc/dispatchcommand.cxx b/comphelper/source/misc/dispatchcommand.cxx
index 5de05542dbb4..160c08a930c7 100644
--- a/comphelper/source/misc/dispatchcommand.cxx
+++ b/comphelper/source/misc/dispatchcommand.cxx
@@ -38,7 +38,7 @@ bool dispatchCommand(const OUString& rCommand, const css::uno::Sequence<css::bea
uno::Reference<frame::XFrame> xFrame(xDesktop->getActiveFrame());
if (!xFrame.is())
- xFrame = uno::Reference<frame::XFrame>(xDesktop, uno::UNO_QUERY);
+ xFrame.set(xDesktop, uno::UNO_QUERY);
uno::Reference<frame::XDispatchProvider> xDispatchProvider(xFrame, uno::UNO_QUERY);
if (!xDispatchProvider.is())
diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx
index 204d1a9baca3..d43ecf606923 100644
--- a/comphelper/source/misc/instancelocker.cxx
+++ b/comphelper/source/misc/instancelocker.cxx
@@ -90,7 +90,7 @@ void SAL_CALL OInstanceLocker::dispose()
m_pLockListener->Dispose();
m_pLockListener = NULL;
}
- m_xLockListener = uno::Reference< uno::XInterface >();
+ m_xLockListener.clear();
}
m_bDisposed = true;
@@ -177,7 +177,7 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg
xInstance,
nModes,
xApproval );
- m_xLockListener = uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( m_pLockListener ) );
+ m_xLockListener.set( static_cast< OWeakObject* >( m_pLockListener ) );
m_pLockListener->Init();
}
catch( uno::Exception& )
@@ -289,7 +289,7 @@ void OLockListener::Dispose()
{}
}
- m_xInstance = uno::Reference< uno::XInterface >();
+ m_xInstance.clear();
m_bDisposed = true;
}
diff --git a/comphelper/source/misc/logging.cxx b/comphelper/source/misc/logging.cxx
index e6cef1d74454..0790567c212a 100644
--- a/comphelper/source/misc/logging.cxx
+++ b/comphelper/source/misc/logging.cxx
@@ -214,7 +214,7 @@ namespace comphelper
Reference< XResourceBundleLoader > xLoader(
css::resource::OfficeResourceLoader::get(
_rContext ) );
- _rLoggerData.xBundle = Reference< XResourceBundle >( xLoader->loadBundle_Default( _rLoggerData.sBundleBaseName ), UNO_QUERY_THROW );
+ _rLoggerData.xBundle.set( xLoader->loadBundle_Default( _rLoggerData.sBundleBaseName ), UNO_QUERY_THROW );
}
catch( const Exception& e )
{
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index d17d650a8e5c..6dc3e21d332e 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -132,11 +132,10 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurati
aPathProp.Value <<= aPath;
aArgs[0] <<= aPathProp;
- xConfig = uno::Reference< container::XNameAccess >(
- m_xConfigProvider->createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess",
- aArgs ),
- uno::UNO_QUERY );
+ xConfig.set( m_xConfigProvider->createInstanceWithArguments(
+ "com.sun.star.configuration.ConfigurationAccess",
+ aArgs ),
+ uno::UNO_QUERY );
}
catch( uno::Exception& )
{}
diff --git a/comphelper/source/streaming/seekableinput.cxx b/comphelper/source/streaming/seekableinput.cxx
index da3b3690516f..7a39696f0497 100644
--- a/comphelper/source/streaming/seekableinput.cxx
+++ b/comphelper/source/streaming/seekableinput.cxx
@@ -103,7 +103,7 @@ void OSeekableInputWrapper::PrepareCopy_Impl()
if ( xTempSeek.is() )
{
xTempSeek->seek( 0 );
- m_xCopyInput = uno::Reference< io::XInputStream >( xTempOut, uno::UNO_QUERY );
+ m_xCopyInput.set( xTempOut, uno::UNO_QUERY );
if ( m_xCopyInput.is() )
m_xCopySeek = xTempSeek;
}
@@ -193,15 +193,15 @@ void SAL_CALL OSeekableInputWrapper::closeInput()
throw io::NotConnectedException();
m_xOriginalStream->closeInput();
- m_xOriginalStream = uno::Reference< io::XInputStream >();
+ m_xOriginalStream.clear();
if ( m_xCopyInput.is() )
{
m_xCopyInput->closeInput();
- m_xCopyInput = uno::Reference< io::XInputStream >();
+ m_xCopyInput.clear();
}
- m_xCopySeek = uno::Reference< io::XSeekable >();
+ m_xCopySeek.clear();
}
diff --git a/comphelper/source/streaming/seqinputstreamserv.cxx b/comphelper/source/streaming/seqinputstreamserv.cxx
index c795a48b15b3..306a5e68d283 100644
--- a/comphelper/source/streaming/seqinputstreamserv.cxx
+++ b/comphelper/source/streaming/seqinputstreamserv.cxx
@@ -167,8 +167,8 @@ void SAL_CALL SequenceInputStreamService::closeInput() throw ( uno::RuntimeExcep
throw io::NotConnectedException();
m_xInputStream->closeInput();
- m_xInputStream = uno::Reference< io::XInputStream >();
- m_xSeekable = uno::Reference< io::XSeekable >();
+ m_xInputStream.clear();
+ m_xSeekable.clear();
}
// css::io::XSeekable:
diff --git a/comphelper/source/streaming/seqoutputstreamserv.cxx b/comphelper/source/streaming/seqoutputstreamserv.cxx
index 33b8c9c2602d..65f2fa75b891 100644
--- a/comphelper/source/streaming/seqoutputstreamserv.cxx
+++ b/comphelper/source/streaming/seqoutputstreamserv.cxx
@@ -137,7 +137,7 @@ void SAL_CALL SequenceOutputStreamService::closeOutput() throw ( uno::RuntimeExc
throw io::NotConnectedException();
m_xOutputStream->closeOutput();
- m_xOutputStream = uno::Reference< io::XOutputStream >();
+ m_xOutputStream.clear();
}
// css::io::XSequenceOutputStream: