summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-05 12:42:10 +0200
committerNoel Grandin <noel@peralex.com>2015-11-05 12:42:42 +0200
commit94268513eeded3952972d7efe0a9bc689605421b (patch)
tree5994adbdba4ca18b8c326e70db2a73a18527caa0 /unotools
parentc89ba1dedc511ec17df1e35f8e0696bc20121491 (diff)
use uno::Reference::set method instead of assignment
Change-Id: Id57ccff7ea6cf5c7053b51268b1190f5459bb357
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/configitem.cxx28
-rw-r--r--unotools/source/config/confignode.cxx8
-rw-r--r--unotools/source/config/historyoptions.cxx22
-rw-r--r--unotools/source/config/lingucfg.cxx2
-rw-r--r--unotools/source/config/moduleoptions.cxx4
-rw-r--r--unotools/source/config/useroptions.cxx4
-rw-r--r--unotools/source/config/viewoptions.cxx5
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx18
8 files changed, 44 insertions, 47 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index a830e8d249e6..9b4ed5f8ef1e 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -392,20 +392,20 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se
}
else
{
- xNode = Reference<XInterface>( xHierarchyAccess, UNO_QUERY );
+ xNode.set( xHierarchyAccess, UNO_QUERY );
}
- xSet = Reference< XPropertySet >(xNode, UNO_QUERY);
+ xSet.set(xNode, UNO_QUERY);
if (xSet.is())
- {
- xInfo = xSet->getPropertySetInfo();
+ {
+ xInfo = xSet->getPropertySetInfo();
OSL_ENSURE(xInfo.is(), "ConfigItem::IsReadonly()\ngetPropertySetInfo failed ...\n");
- }
+ }
else
- {
- xInfo = Reference< XPropertySetInfo >(xNode, UNO_QUERY);
+ {
+ xInfo.set(xNode, UNO_QUERY);
OSL_ENSURE(xInfo.is(), "ConfigItem::IsReadonly()\nUNO_QUERY failed ...\n");
- }
+ }
if (!xInfo.is())
{
@@ -680,7 +680,7 @@ Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode, ConfigNameF
aNode >>= xCont;
}
else
- xCont = Reference<XNameAccess> (xHierarchyAccess, UNO_QUERY);
+ xCont.set(xHierarchyAccess, UNO_QUERY);
if(xCont.is())
{
aRet = xCont->getElementNames();
@@ -709,7 +709,7 @@ bool ConfigItem::ClearNodeSet(const OUString& rNode)
aNode >>= xCont;
}
else
- xCont = Reference<XNameContainer> (xHierarchyAccess, UNO_QUERY);
+ xCont.set(xHierarchyAccess, UNO_QUERY);
if(!xCont.is())
return false;
Sequence< OUString > aNames = xCont->getElementNames();
@@ -748,7 +748,7 @@ bool ConfigItem::ClearNodeElements(const OUString& rNode, Sequence< OUString >&
aNode >>= xCont;
}
else
- xCont = Reference<XNameContainer> (xHierarchyAccess, UNO_QUERY);
+ xCont.set(xHierarchyAccess, UNO_QUERY);
if(!xCont.is())
return false;
try
@@ -822,7 +822,7 @@ bool ConfigItem::SetSetProperties(
aNode >>= xCont;
}
else
- xCont = Reference<XNameContainer> (xHierarchyAccess, UNO_QUERY);
+ xCont.set(xHierarchyAccess, UNO_QUERY);
if(!xCont.is())
return false;
@@ -921,7 +921,7 @@ bool ConfigItem::ReplaceSetProperties(
aNode >>= xCont;
}
else
- xCont = Reference<XNameContainer> (xHierarchyAccess, UNO_QUERY);
+ xCont.set(xHierarchyAccess, UNO_QUERY);
if(!xCont.is())
return false;
@@ -1058,7 +1058,7 @@ bool ConfigItem::AddNode(const OUString& rNode, const OUString& rNewNode)
aNode >>= xCont;
}
else
- xCont = Reference<XNameContainer> (xHierarchyAccess, UNO_QUERY);
+ xCont.set(xHierarchyAccess, UNO_QUERY);
if(!xCont.is())
return false;
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index dfd10cb1c031..3e521acaf6b1 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -54,8 +54,8 @@ namespace utl
if (_rxNode.is())
{
// collect all interfaces necessary
- m_xHierarchyAccess = Reference< XHierarchicalNameAccess >(_rxNode, UNO_QUERY);
- m_xDirectAccess = Reference< XNameAccess >(_rxNode, UNO_QUERY);
+ m_xHierarchyAccess.set(_rxNode, UNO_QUERY);
+ m_xDirectAccess.set(_rxNode, UNO_QUERY);
// reset _all_ interfaces if _one_ of them is not supported
if (!m_xHierarchyAccess.is() || !m_xDirectAccess.is())
@@ -65,8 +65,8 @@ namespace utl
}
// now for the non-critical interfaces
- m_xReplaceAccess = Reference< XNameReplace >(_rxNode, UNO_QUERY);
- m_xContainerAccess = Reference< XNameContainer >(_rxNode, UNO_QUERY);
+ m_xReplaceAccess.set(_rxNode, UNO_QUERY);
+ m_xContainerAccess.set(_rxNode, UNO_QUERY);
}
Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index 86da95611e08..0b2e12c825c8 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -106,18 +106,18 @@ SvtHistoryOptions_Impl::SvtHistoryOptions_Impl()
{
try
{
- m_xCfg = Reference<container::XNameAccess> (
+ m_xCfg.set(
::comphelper::ConfigurationHelper::openConfig(
- ::comphelper::getProcessComponentContext(),
- s_sHistories,
- ::comphelper::ConfigurationHelper::E_STANDARD),
+ ::comphelper::getProcessComponentContext(),
+ s_sHistories,
+ ::comphelper::ConfigurationHelper::E_STANDARD),
uno::UNO_QUERY);
- m_xCommonXCU = Reference<container::XNameAccess> (
+ m_xCommonXCU.set(
::comphelper::ConfigurationHelper::openConfig(
- ::comphelper::getProcessComponentContext(),
- s_sCommonHistory,
- ::comphelper::ConfigurationHelper::E_STANDARD),
+ ::comphelper::getProcessComponentContext(),
+ s_sCommonHistory,
+ ::comphelper::ConfigurationHelper::E_STANDARD),
uno::UNO_QUERY);
}
catch(const uno::Exception& ex)
@@ -444,7 +444,7 @@ void SvtHistoryOptions_Impl::AppendItem(EHistoryType eHistory,
}
if (nLength != nMaxSize)
{
- xFac = uno::Reference<lang::XSingleServiceFactory>(xOrderList, uno::UNO_QUERY);
+ xFac.set(xOrderList, uno::UNO_QUERY);
xInst = xFac->createInstance();
OUString sPush = OUString::number(nLength++);
xOrderList->insertByName(sPush, uno::makeAny(xInst));
@@ -461,11 +461,11 @@ void SvtHistoryOptions_Impl::AppendItem(EHistoryType eHistory,
xSet->setPropertyValue(s_sHistoryItemRef, uno::makeAny(sURL));
// Append the item to ItemList.
- xFac = uno::Reference<lang::XSingleServiceFactory>(xItemList, uno::UNO_QUERY);
+ xFac.set(xItemList, uno::UNO_QUERY);
xInst = xFac->createInstance();
xItemList->insertByName(sURL, uno::makeAny(xInst));
- xSet = uno::Reference<beans::XPropertySet>(xInst, uno::UNO_QUERY);
+ xSet.set(xInst, uno::UNO_QUERY);
xSet->setPropertyValue(s_sFilter, uno::makeAny(sFilter));
xSet->setPropertyValue(s_sTitle, uno::makeAny(sTitle));
xSet->setPropertyValue(s_sPassword, uno::makeAny(sPassword));
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index 6d0e8b1b603c..2b28b2e44761 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -1076,7 +1076,7 @@ uno::Reference< util::XChangesBatch > SvtLinguConfig::GetMainUpdateAccess() cons
aValue.Value = uno::makeAny(OUString("org.openoffice.Office.Linguistic"));
uno::Sequence< uno::Any > aProps(1);
aProps[0] <<= aValue;
- m_xMainUpdateAccess = uno::Reference< util::XChangesBatch >(
+ m_xMainUpdateAccess.set(
xConfigurationProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess", aProps),
uno::UNO_QUERY_THROW );
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx
index 5677fb25f0b5..828e15935d6d 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -1078,9 +1078,9 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByURL(const OUString
css::uno::Reference< css::container::XNameAccess > xTypeCfg;
try
{
- xFilterCfg = css::uno::Reference< css::container::XNameAccess >(
+ xFilterCfg.set(
xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.FilterFactory", xContext), css::uno::UNO_QUERY);
- xTypeCfg = css::uno::Reference< css::container::XNameAccess >(
+ xTypeCfg.set(
xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", xContext), css::uno::UNO_QUERY);
}
catch(const css::uno::RuntimeException&)
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index 3dbd034a9077..a4d2afee4075 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -126,7 +126,7 @@ SvtUserOptions::Impl::Impl() :
{
try
{
- m_xCfg = uno::Reference<container::XNameAccess>(
+ m_xCfg.set(
comphelper::ConfigurationHelper::openConfig(
comphelper::getProcessComponentContext(),
"org.openoffice.UserProfile/Data",
@@ -135,7 +135,7 @@ SvtUserOptions::Impl::Impl() :
uno::UNO_QUERY
);
- m_xData = uno::Reference<beans::XPropertySet>(m_xCfg, uno::UNO_QUERY);
+ m_xData.set(m_xCfg, uno::UNO_QUERY);
uno::Reference<util::XChangesNotifier> xChgNot(m_xCfg, uno::UNO_QUERY);
try
{
diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx
index 83e2d04b111c..77e294191e84 100644
--- a/unotools/source/config/viewoptions.cxx
+++ b/unotools/source/config/viewoptions.cxx
@@ -154,12 +154,11 @@ SvtViewOptionsBase_Impl::SvtViewOptionsBase_Impl( const OUString& sList )
try
{
- m_xRoot = css::uno::Reference< css::container::XNameAccess >(
- ::comphelper::ConfigurationHelper::openConfig(
+ m_xRoot.set( ::comphelper::ConfigurationHelper::openConfig(
::comphelper::getProcessComponentContext(),
PACKAGE_VIEWS,
::comphelper::ConfigurationHelper::E_STANDARD),
- css::uno::UNO_QUERY);
+ css::uno::UNO_QUERY);
if (m_xRoot.is())
m_xRoot->getByName(sList) >>= m_xSet;
}
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 140a902db303..be0e71c13ac3 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -544,13 +544,11 @@ Moderator::Moderator(
Reference < XActiveDataSink > xActiveSink(*pxSink,UNO_QUERY);
if(xActiveSink.is())
- *pxSink = Reference<XInterface>(
- static_cast<cppu::OWeakObject*>(new ModeratorsActiveDataSink(*this)));
+ pxSink->set( static_cast<cppu::OWeakObject*>(new ModeratorsActiveDataSink(*this)));
Reference<XActiveDataStreamer> xStreamer( *pxSink, UNO_QUERY );
if ( xStreamer.is() )
- *pxSink = Reference<XInterface>(
- static_cast<cppu::OWeakObject*>(new ModeratorsActiveDataStreamer(*this)));
+ pxSink->set( static_cast<cppu::OWeakObject*>(new ModeratorsActiveDataStreamer(*this)));
if(dec == 0)
m_aArg.Argument <<= aPostArg;
@@ -860,7 +858,7 @@ static bool UCBOpenContentSync(
= ir->getSelection();
if(ref.is()) {
Reference<XInterface> xInt(ref.get());
- xRet = Reference<XInteractionRetry>(xInt,UNO_QUERY);
+ xRet.set(xInt,UNO_QUERY);
}
}
@@ -1103,7 +1101,7 @@ bool UcbLockBytes::setStream_Impl( const Reference<XStream>& aStream )
{
m_xOutputStream = aStream->getOutputStream();
setInputStream_Impl( aStream->getInputStream(), false );
- m_xSeekable = Reference < XSeekable > ( aStream, UNO_QUERY );
+ m_xSeekable.set( aStream, UNO_QUERY );
}
else
{
@@ -1129,15 +1127,15 @@ bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInputSt
if( bSetXSeekable )
{
- m_xSeekable = Reference < XSeekable > ( rxInputStream, UNO_QUERY );
+ m_xSeekable.set( rxInputStream, UNO_QUERY );
if( !m_xSeekable.is() && rxInputStream.is() )
{
Reference < XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- Reference< XOutputStream > rxTempOut = Reference < XOutputStream > ( TempFile::create(xContext), UNO_QUERY_THROW );
+ Reference< XOutputStream > rxTempOut( TempFile::create(xContext), UNO_QUERY_THROW );
::comphelper::OStorageHelper::CopyInputToOutput( rxInputStream, rxTempOut );
- m_xInputStream = Reference< XInputStream >( rxTempOut, UNO_QUERY );
- m_xSeekable = Reference < XSeekable > ( rxTempOut, UNO_QUERY );
+ m_xInputStream.set( rxTempOut, UNO_QUERY );
+ m_xSeekable.set( rxTempOut, UNO_QUERY );
}
}