summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-05 13:26:24 +0200
committerNoel Grandin <noel@peralex.com>2015-11-05 13:32:17 +0200
commit9e8ff13eb2405f7e3dcb4f90cb38e9e4b1da2bd5 (patch)
treeea4cd1922080d73b82a5b4bd4796d6190430f3fa /xmloff
parent281296330735158d6265e0b146b5d5301f6e610e (diff)
use uno::Reference::set method instead of assignment
Change-Id: I60e52ef2abc3107ba77e81811dfe1bffbfd77218
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLAxisContext.cxx4
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx4
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx2
-rw-r--r--xmloff/source/chart/SchXMLSeriesHelper.cxx6
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx3
-rw-r--r--xmloff/source/core/XMLEmbeddedObjectImportContext.cxx2
-rw-r--r--xmloff/source/core/xmlexp.cxx14
-rw-r--r--xmloff/source/core/xmlimp.cxx34
-rw-r--r--xmloff/source/core/xmluconv.cxx2
-rw-r--r--xmloff/source/draw/animationimport.cxx4
-rw-r--r--xmloff/source/draw/animimp.cxx2
-rw-r--r--xmloff/source/draw/layerimp.cxx2
-rw-r--r--xmloff/source/draw/ximp3dscene.cxx2
-rw-r--r--xmloff/source/draw/ximpgrp.cxx2
-rw-r--r--xmloff/source/draw/ximppage.cxx5
-rw-r--r--xmloff/source/draw/ximpshap.cxx16
-rw-r--r--xmloff/source/draw/ximpshow.cxx6
-rw-r--r--xmloff/source/forms/elementimport.cxx4
-rw-r--r--xmloff/source/forms/elementimport_impl.hxx2
-rw-r--r--xmloff/source/forms/layerexport.cxx2
-rw-r--r--xmloff/source/meta/MetaExportComponent.cxx2
-rw-r--r--xmloff/source/meta/MetaImportComponent.cxx2
-rw-r--r--xmloff/source/meta/xmlversion.cxx2
-rw-r--r--xmloff/source/style/prstylei.cxx2
-rw-r--r--xmloff/source/style/styleexp.cxx4
-rw-r--r--xmloff/source/style/xmlnumi.cxx2
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextMasterPageContext.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx2
-rw-r--r--xmloff/source/text/txtimp.cxx7
-rw-r--r--xmloff/source/transform/OOo2Oasis.cxx2
32 files changed, 70 insertions, 79 deletions
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx
index 7bae970a6ba2..c480081568f3 100644
--- a/xmloff/source/chart/SchXMLAxisContext.cxx
+++ b/xmloff/source/chart/SchXMLAxisContext.cxx
@@ -169,7 +169,7 @@ Reference< drawing::XShape > SchXMLAxisContext::getTitleShape()
break;
}
xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) );
- xResult = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ xResult.set( xAxis->getAxisTitle(), uno::UNO_QUERY );
return xResult;
}
@@ -433,7 +433,7 @@ void SchXMLAxisContext::CreateAxis()
return;
}
- m_xAxisProps = Reference<beans::XPropertySet>( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ), uno::UNO_QUERY );
+ m_xAxisProps.set( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ), uno::UNO_QUERY );
if( m_bAddMissingXAxisForNetCharts && m_aCurrentAxis.eDimension==SCH_XML_AXIS_Y && m_aCurrentAxis.nAxisIndex==0 )
{
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 08c05e842a97..b33438aa6c1c 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -1080,7 +1080,7 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext(
{
uno::Reference< drawing::XDrawPageSupplier > xSupp( xDoc, uno::UNO_QUERY );
if( xSupp.is())
- mxDrawPage = uno::Reference< drawing::XShapes >( xSupp->getDrawPage(), uno::UNO_QUERY );
+ mxDrawPage.set( xSupp->getDrawPage(), uno::UNO_QUERY );
SAL_WARN_IF( !mxDrawPage.is(), "xmloff.chart", "Invalid Chart Page" );
}
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 9ecdffe70b40..527be5994144 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -1586,7 +1586,7 @@ void SchXMLExportHelper_Impl::exportTable()
{
Reference< chart::XChartDocument > xChartDoc( mrExport.GetModel(), uno::UNO_QUERY );
if( xChartDoc.is() )
- xAnyDescriptionAccess = Reference< chart2::XAnyDescriptionAccess >( xChartDoc->getData(), uno::UNO_QUERY );
+ xAnyDescriptionAccess.set( xChartDoc->getData(), uno::UNO_QUERY );
}
if( bHasOwnData )
@@ -1856,7 +1856,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
std::unique_ptr<SvXMLElementExport> xElPlotArea;
// get property states for autostyles
- xPropSet = Reference< beans::XPropertySet >( xDiagram, uno::UNO_QUERY );
+ xPropSet.set( xDiagram, uno::UNO_QUERY );
if( xPropSet.is())
{
if( mxExpPropMapper.is())
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index fae7430bb3d3..fcb0a910ca26 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -229,7 +229,7 @@ Reference< chart2::data::XLabeledDataSequence2 > lcl_createAndAddSequenceToSerie
Sequence< Reference< chart2::data::XLabeledDataSequence > > aOldSeq( xSeriesSource->getDataSequences());
sal_Int32 nOldCount = aOldSeq.getLength();
Sequence< Reference< chart2::data::XLabeledDataSequence > > aNewSeq( nOldCount + 1 );
- aNewSeq[0] = Reference< chart2::data::XLabeledDataSequence >(xLabeledSeq, uno::UNO_QUERY_THROW);
+ aNewSeq[0].set(xLabeledSeq, uno::UNO_QUERY_THROW);
for( sal_Int32 nN=0; nN<nOldCount; nN++ )
aNewSeq[nN+1] = aOldSeq[nN];
xSeriesSink->setData( aNewSeq );
diff --git a/xmloff/source/chart/SchXMLSeriesHelper.cxx b/xmloff/source/chart/SchXMLSeriesHelper.cxx
index 610a69ab04c2..b2024ff90ed2 100644
--- a/xmloff/source/chart/SchXMLSeriesHelper.cxx
+++ b/xmloff/source/chart/SchXMLSeriesHelper.cxx
@@ -180,8 +180,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPISeriesProp
uno::Reference< lang::XMultiServiceFactory > xFactory( xChartModel, uno::UNO_QUERY );
if( xFactory.is() )
{
- xRet = uno::Reference< beans::XPropertySet >( xFactory->createInstance(
- "com.sun.star.comp.chart2.DataSeriesWrapper" ), uno::UNO_QUERY );
+ xRet.set( xFactory->createInstance( "com.sun.star.comp.chart2.DataSeriesWrapper" ), uno::UNO_QUERY );
Reference< lang::XInitialization > xInit( xRet, uno::UNO_QUERY );
if(xInit.is())
{
@@ -215,8 +214,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPIDataPointP
uno::Reference< lang::XMultiServiceFactory > xFactory( xChartModel, uno::UNO_QUERY );
if( xFactory.is() )
{
- xRet = uno::Reference< beans::XPropertySet >( xFactory->createInstance(
- "com.sun.star.comp.chart2.DataSeriesWrapper" ), uno::UNO_QUERY );
+ xRet.set( xFactory->createInstance( "com.sun.star.comp.chart2.DataSeriesWrapper" ), uno::UNO_QUERY );
Reference< lang::XInitialization > xInit( xRet, uno::UNO_QUERY );
if(xInit.is())
{
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index 64304271ca04..0f1650595ae6 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -859,8 +859,7 @@ Reference< chart2::data::XDataProvider > getDataProviderFromParent( const Refere
const OUString * pEnd = pBegin + aServiceNames.getLength();
if( ::std::find( pBegin, pEnd, aDataProviderServiceName ) != pEnd )
{
- xRet = Reference< chart2::data::XDataProvider >(
- xFact->createInstance( aDataProviderServiceName ), uno::UNO_QUERY );
+ xRet.set( xFact->createInstance( aDataProviderServiceName ), uno::UNO_QUERY );
}
}
}
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index 10a4eda39e60..8b597d5bfa3b 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -150,7 +150,7 @@ bool XMLEmbeddedObjectImportContext::SetComponent(
Reference< XComponentContext > xContext( GetImport().GetComponentContext() );
- xHandler = Reference < XDocumentHandler >(
+ xHandler.set(
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(sFilterService, aArgs, xContext),
UNO_QUERY);
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 1bbbb98dceae..70d392db1678 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -302,7 +302,7 @@ SvXMLExport_Impl::SvXMLExport_Impl()
void SvXMLExport::SetDocHandler( const uno::Reference< xml::sax::XDocumentHandler > &rHandler )
{
mxHandler = rHandler;
- mxExtHandler = uno::Reference<xml::sax::XExtendedDocumentHandler>( mxHandler, UNO_QUERY );
+ mxExtHandler.set( mxHandler, UNO_QUERY );
}
void SvXMLExport::_InitCtor()
@@ -599,7 +599,7 @@ SvXMLExport::~SvXMLExport()
void SAL_CALL SvXMLExport::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
throw(lang::IllegalArgumentException, uno::RuntimeException, std::exception)
{
- mxModel = uno::Reference< frame::XModel >::query( xDoc );
+ mxModel.set( xDoc, UNO_QUERY );
if( !mxModel.is() )
throw lang::IllegalArgumentException();
if (mxModel.is() && ! mxEventListener.is())
@@ -1336,15 +1336,15 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
{
if( !mxGraphicResolver.is() )
{
- mxGraphicResolver = Reference< XGraphicObjectResolver >::query(
- xFactory->createInstance( "com.sun.star.document.ExportGraphicObjectResolver" ));
+ mxGraphicResolver.set(
+ xFactory->createInstance( "com.sun.star.document.ExportGraphicObjectResolver" ), UNO_QUERY);
bOwnGraphicResolver = mxGraphicResolver.is();
}
if( !mxEmbeddedResolver.is() )
{
- mxEmbeddedResolver = Reference< XEmbeddedObjectResolver >::query(
- xFactory->createInstance( "com.sun.star.document.ExportEmbeddedObjectResolver" ));
+ mxEmbeddedResolver.set(
+ xFactory->createInstance( "com.sun.star.document.ExportEmbeddedObjectResolver" ), UNO_QUERY);
bOwnEmbeddedResolver = mxEmbeddedResolver.is();
}
}
@@ -1391,7 +1391,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
if( xTmpDocHandler.is() )
{
mxHandler = xTmpDocHandler;
- mxExtHandler = uno::Reference<xml::sax::XExtendedDocumentHandler>( mxHandler, UNO_QUERY );
+ mxExtHandler.set( mxHandler, UNO_QUERY );
}
}
catch(const com::sun::star::uno::Exception&)
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 88579a8bfe01..7b7c36cae79c 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -508,19 +508,19 @@ void SAL_CALL SvXMLImport::startDocument()
{
if( !mxGraphicResolver.is() )
{
- mxGraphicResolver = Reference< XGraphicObjectResolver >::query(
- xFactory->createInstance(
- // #99870# Import... instead of Export...
- "com.sun.star.document.ImportGraphicObjectResolver"));
+ // #99870# Import... instead of Export...
+ mxGraphicResolver.set(
+ xFactory->createInstance("com.sun.star.document.ImportGraphicObjectResolver"),
+ UNO_QUERY);
mpImpl->mbOwnGraphicResolver = mxGraphicResolver.is();
}
if( !mxEmbeddedResolver.is() )
{
- mxEmbeddedResolver = Reference< XEmbeddedObjectResolver >::query(
- xFactory->createInstance(
- // #99870# Import... instead of Export...
- "com.sun.star.document.ImportEmbeddedObjectResolver"));
+ // #99870# Import... instead of Export...
+ mxEmbeddedResolver.set(
+ xFactory->createInstance("com.sun.star.document.ImportEmbeddedObjectResolver"),
+ UNO_QUERY);
mpImpl->mbOwnEmbeddedResolver = mxEmbeddedResolver.is();
}
}
@@ -910,7 +910,7 @@ void SvXMLImport::SetStatistics(const uno::Sequence< beans::NamedValue> &)
void SAL_CALL SvXMLImport::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc )
throw(lang::IllegalArgumentException, uno::RuntimeException, std::exception)
{
- mxModel = uno::Reference< frame::XModel >::query( xDoc );
+ mxModel.set( xDoc, UNO_QUERY );
if( !mxModel.is() )
throw lang::IllegalArgumentException();
@@ -1122,7 +1122,7 @@ const Reference< container::XNameContainer > & SvXMLImport::GetGradientHelper()
{
try
{
- mxGradientHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
+ mxGradientHelper.set( xServiceFact->createInstance(
"com.sun.star.drawing.GradientTable" ), UNO_QUERY);
}
catch( lang::ServiceNotRegisteredException& )
@@ -1145,7 +1145,7 @@ const Reference< container::XNameContainer > & SvXMLImport::GetHatchHelper()
{
try
{
- mxHatchHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
+ mxHatchHelper.set( xServiceFact->createInstance(
"com.sun.star.drawing.HatchTable" ), UNO_QUERY);
}
catch( lang::ServiceNotRegisteredException& )
@@ -1168,7 +1168,7 @@ const Reference< container::XNameContainer > & SvXMLImport::GetBitmapHelper()
{
try
{
- mxBitmapHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
+ mxBitmapHelper.set( xServiceFact->createInstance(
"com.sun.star.drawing.BitmapTable" ), UNO_QUERY);
}
catch( lang::ServiceNotRegisteredException& )
@@ -1191,7 +1191,7 @@ const Reference< container::XNameContainer > & SvXMLImport::GetTransGradientHelp
{
try
{
- mxTransGradientHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
+ mxTransGradientHelper.set( xServiceFact->createInstance(
"com.sun.star.drawing.TransparencyGradientTable" ), UNO_QUERY);
}
catch( lang::ServiceNotRegisteredException& )
@@ -1214,8 +1214,7 @@ const Reference< container::XNameContainer > & SvXMLImport::GetMarkerHelper()
{
try
{
- mxMarkerHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
- "com.sun.star.drawing.MarkerTable" ), UNO_QUERY);
+ mxMarkerHelper.set( xServiceFact->createInstance( "com.sun.star.drawing.MarkerTable" ), UNO_QUERY);
}
catch( lang::ServiceNotRegisteredException& )
{}
@@ -1237,8 +1236,7 @@ const Reference< container::XNameContainer > & SvXMLImport::GetDashHelper()
{
try
{
- mxDashHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
- "com.sun.star.drawing.DashTable" ), UNO_QUERY);
+ mxDashHelper.set( xServiceFact->createInstance( "com.sun.star.drawing.DashTable" ), UNO_QUERY);
}
catch( lang::ServiceNotRegisteredException& )
{}
@@ -1518,7 +1516,7 @@ ProgressBarHelper* SvXMLImport::GetProgressBarHelper()
void SvXMLImport::AddNumberStyle(sal_Int32 nKey, const OUString& rName)
{
if (!mxNumberStyles.is())
- mxNumberStyles = uno::Reference< container::XNameContainer >( comphelper::NameContainer_createInstance( ::cppu::UnoType<sal_Int32>::get()) );
+ mxNumberStyles.set( comphelper::NameContainer_createInstance( ::cppu::UnoType<sal_Int32>::get()) );
if (mxNumberStyles.is())
{
uno::Any aAny;
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index eaded066044b..e0652bbdbb12 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -85,7 +85,7 @@ struct SvXMLUnitConverter::Impl
void SvXMLUnitConverter::Impl::createNumTypeInfo() const
{
Reference<XDefaultNumberingProvider> xDefNum = DefaultNumberingProvider::create(m_xContext);
- m_xNumTypeInfo = Reference<XNumberingTypeInfo>(xDefNum, uno::UNO_QUERY);
+ m_xNumTypeInfo.set(xDefNum, uno::UNO_QUERY);
}
const uno::Reference< text::XNumberingTypeInfo >&
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index fece4ddaac9e..becd54016286 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -701,7 +701,7 @@ AnimationNodeContext::AnimationNodeContext(
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
- mxNode = Reference< XAnimationNode >(
+ mxNode.set(
xContext->getServiceManager()->createInstanceWithContext(OUString::createFromAscii(pServiceName), xContext),
UNO_QUERY_THROW );
@@ -1296,7 +1296,7 @@ AnimationsImport::AnimationsImport( const Reference< XComponentContext > & rxCon
GetXMLToken(XML_N_ANIMATION),
XML_NAMESPACE_ANIMATION);
- mxRootNode = Reference<XAnimationNode>( SequenceTimeContainer::create(rxContext), UNO_QUERY_THROW );
+ mxRootNode.set( SequenceTimeContainer::create(rxContext), UNO_QUERY_THROW );
}
AnimationsImport::~AnimationsImport() throw ()
diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx
index 4226e69a4dd6..04e910e30972 100644
--- a/xmloff/source/draw/animimp.cxx
+++ b/xmloff/source/draw/animimp.cxx
@@ -563,7 +563,7 @@ void XMLAnimationsEffectContext::EndElement()
Reference< XPropertySet > xSet;
if( mpImpl->maLastShapeId != maShapeId )
{
- xSet = Reference< XPropertySet >::query( GetImport().getInterfaceToIdentifierMapper().getReference( maShapeId ) );
+ xSet.set( GetImport().getInterfaceToIdentifierMapper().getReference( maShapeId ), UNO_QUERY );
if( xSet.is() )
{
// check for presentation shape service
diff --git a/xmloff/source/draw/layerimp.cxx b/xmloff/source/draw/layerimp.cxx
index ea4547f3bd0d..13241312d7bd 100644
--- a/xmloff/source/draw/layerimp.cxx
+++ b/xmloff/source/draw/layerimp.cxx
@@ -122,7 +122,7 @@ void SdXMLLayerContext::EndElement()
{
Reference< XLayerManager > xLayerManager( mxLayerManager, UNO_QUERY );
if( xLayerManager.is() )
- xLayer = Reference< XPropertySet >::query( xLayerManager->insertNewByIndex( xLayerManager->getCount() ) );
+ xLayer.set( xLayerManager->insertNewByIndex( xLayerManager->getCount() ), UNO_QUERY );
DBG_ASSERT( xLayer.is(), "xmloff::SdXMLLayerContext::EndElement(), failed to create new XLayer!" );
if( xLayer.is() )
diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx
index 15b7fb98fd28..2bb82e0b1631 100644
--- a/xmloff/source/draw/ximp3dscene.cxx
+++ b/xmloff/source/draw/ximp3dscene.cxx
@@ -111,7 +111,7 @@ void SdXML3DSceneShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
{
SetStyle();
- mxChildren = uno::Reference< drawing::XShapes >::query( mxShape );
+ mxChildren.set( mxShape, uno::UNO_QUERY );
if( mxChildren.is() )
GetImport().GetShapeImport()->pushGroupForSorting( mxChildren );
diff --git a/xmloff/source/draw/ximpgrp.cxx b/xmloff/source/draw/ximpgrp.cxx
index d97d3499eed6..4d62c92cf2c6 100644
--- a/xmloff/source/draw/ximpgrp.cxx
+++ b/xmloff/source/draw/ximpgrp.cxx
@@ -88,7 +88,7 @@ void SdXMLGroupShapeContext::StartElement(const uno::Reference< xml::sax::XAttri
{
SetStyle( false );
- mxChildren = uno::Reference< drawing::XShapes >::query( mxShape );
+ mxChildren.set( mxShape, uno::UNO_QUERY );
if( mxChildren.is() )
GetImport().GetShapeImport()->pushGroupForSorting( mxChildren );
}
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 678109e099d1..3d33780220cf 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -382,8 +382,7 @@ void SdXMLGenericPageContext::SetStyle( OUString& rStyleName )
Reference< lang::XMultiServiceFactory > xServiceFact(GetSdImport().GetModel(), uno::UNO_QUERY);
if(xServiceFact.is())
{
- xBackgroundSet = Reference< beans::XPropertySet >::query(
- xServiceFact->createInstance("com.sun.star.drawing.Background"));
+ xBackgroundSet.set(xServiceFact->createInstance("com.sun.star.drawing.Background"), UNO_QUERY);
}
}
@@ -595,7 +594,7 @@ void SdXMLGenericPageContext::SetNavigationOrder()
if( !aEnumerator.getNextToken(sId) )
break;
- aShapes[nIndex] = Reference< XShape >( rIdMapper.getReference( sId ), UNO_QUERY );
+ aShapes[nIndex].set( rIdMapper.getReference( sId ), UNO_QUERY );
}
for( nIndex = 0; nIndex < nCount; ++nIndex )
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index bf05af377a0b..57edea2ea5bd 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -259,7 +259,7 @@ void SdXMLShapeContext::addGluePoint( const uno::Reference< xml::sax::XAttribute
if( !xSupplier.is() )
return;
- mxGluePoints = uno::Reference< container::XIdentifierContainer >::query( xSupplier->getGluePoints() );
+ mxGluePoints.set( xSupplier->getGluePoints(), UNO_QUERY );
if( !mxGluePoints.is() )
return;
@@ -479,7 +479,7 @@ void SdXMLShapeContext::AddShape(uno::Reference< drawing::XShape >& xShape)
}
}
- mxLockable = uno::Reference< document::XActionLockable >::query( xShape );
+ mxLockable.set( xShape, UNO_QUERY );
if( mxLockable.is() )
mxLockable->addActionLock();
@@ -503,7 +503,7 @@ void SdXMLShapeContext::AddShape(OUString const & serviceName)
if ( serviceName == "com.sun.star.drawing.OLE2Shape" &&
uno::Reference< text::XTextDocument >(GetImport().GetModel(), uno::UNO_QUERY).is() )
{
- xShape = uno::Reference< drawing::XShape >(xServiceFact->createInstance("com.sun.star.drawing.temporaryForXMLImportOLE2Shape"), uno::UNO_QUERY);
+ xShape.set(xServiceFact->createInstance("com.sun.star.drawing.temporaryForXMLImportOLE2Shape"), uno::UNO_QUERY);
}
else if (serviceName == "com.sun.star.drawing.GraphicObjectShape"
|| serviceName == "com.sun.star.drawing.MediaShape"
@@ -511,14 +511,12 @@ void SdXMLShapeContext::AddShape(OUString const & serviceName)
{
css::uno::Sequence<css::uno::Any> args(1);
args[0] <<= GetImport().GetDocumentBase();
- xShape = css::uno::Reference<css::drawing::XShape>(
- xServiceFact->createInstanceWithArguments(
- serviceName, args),
- css::uno::UNO_QUERY);
+ xShape.set( xServiceFact->createInstanceWithArguments(serviceName, args),
+ css::uno::UNO_QUERY);
}
else
{
- xShape = uno::Reference< drawing::XShape >(xServiceFact->createInstance(serviceName), uno::UNO_QUERY);
+ xShape.set(xServiceFact->createInstance(serviceName), uno::UNO_QUERY);
}
if( xShape.is() )
AddShape( xShape );
@@ -970,7 +968,7 @@ void SdXMLShapeContext::onDemandRescueUsefulDataFromTemporary( const SvXMLImport
if( !xSupplier.is() )
return;
- mxGluePoints = uno::Reference< container::XIdentifierContainer >::query( xSupplier->getGluePoints() );
+ mxGluePoints.set( xSupplier->getGluePoints(), UNO_QUERY );
if( !mxGluePoints.is() )
return;
diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx
index 3e154ec507bf..2ecde45c2f2c 100644
--- a/xmloff/source/draw/ximpshow.cxx
+++ b/xmloff/source/draw/ximpshow.cxx
@@ -72,16 +72,16 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, c
if( xShowsSupplier.is() )
{
mpImpl->mxShows = xShowsSupplier->getCustomPresentations();
- mpImpl->mxShowFactory = Reference< XSingleServiceFactory >::query( mpImpl->mxShows );
+ mpImpl->mxShowFactory.set( mpImpl->mxShows, UNO_QUERY );
}
Reference< XDrawPagesSupplier > xDrawPagesSupplier( rImport.GetModel(), UNO_QUERY );
if( xDrawPagesSupplier.is() )
- mpImpl->mxPages = Reference< XNameAccess >::query( xDrawPagesSupplier->getDrawPages() );
+ mpImpl->mxPages.set( xDrawPagesSupplier->getDrawPages(), UNO_QUERY );
Reference< XPresentationSupplier > xPresentationSupplier( rImport.GetModel(), UNO_QUERY );
if( xPresentationSupplier.is() )
- mpImpl->mxPresProps = Reference< XPropertySet >::query( xPresentationSupplier->getPresentation() );
+ mpImpl->mxPresProps.set( xPresentationSupplier->getPresentation(), UNO_QUERY );
if( mpImpl->mxPresProps.is() )
{
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index fec7bd238e51..cd10c3215559 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -619,7 +619,7 @@ namespace xmloff
Reference< XInterface > xPure = xContext->getServiceManager()->createInstanceWithContext(m_sServiceName, xContext);
OSL_ENSURE(xPure.is(),
OStringBuffer("OElementImport::createElement: service factory gave me no object (service name: ").append(OUStringToOString(m_sServiceName, RTL_TEXTENCODING_ASCII_US)).append(")!").getStr());
- xReturn = Reference< XPropertySet >(xPure, UNO_QUERY);
+ xReturn.set(xPure, UNO_QUERY);
}
else
OSL_FAIL("OElementImport::createElement: no service name to create an element!");
@@ -1853,7 +1853,7 @@ namespace xmloff
Reference< XCloneable > xCloneList(_rxAttrList, UNO_QUERY);
OSL_ENSURE(xCloneList.is(), "OColumnWrapperImport::StartElement: AttributeList not cloneable!");
if ( xCloneList.is() )
- m_xOwnAttributes = Reference< XAttributeList >(xCloneList->createClone(), UNO_QUERY);
+ m_xOwnAttributes.set(xCloneList->createClone(), UNO_QUERY);
OSL_ENSURE(m_xOwnAttributes.is(), "OColumnWrapperImport::StartElement: no cloned list!");
}
diff --git a/xmloff/source/forms/elementimport_impl.hxx b/xmloff/source/forms/elementimport_impl.hxx
index a9cfc99aa9c2..d49859453bae 100644
--- a/xmloff/source/forms/elementimport_impl.hxx
+++ b/xmloff/source/forms/elementimport_impl.hxx
@@ -59,7 +59,7 @@ inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
return xReturn;
// ensure that the object is a XNameContainer (we strongly need this for inserting child elements)
- m_xMeAsContainer = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >(xReturn, ::com::sun::star::uno::UNO_QUERY);
+ m_xMeAsContainer.set(xReturn, ::com::sun::star::uno::UNO_QUERY);
if (!m_xMeAsContainer.is())
{
OSL_FAIL("OContainerImport::createElement: invalid element (no XNameContainer) created!");
diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx
index 3a487a41abc7..f0145f1d60d7 100644
--- a/xmloff/source/forms/layerexport.cxx
+++ b/xmloff/source/forms/layerexport.cxx
@@ -113,7 +113,7 @@ namespace xmloff
// nothing to do at all
return false;
- _rxForms = Reference< XIndexAccess >(xFormsSupp->getForms(), UNO_QUERY);
+ _rxForms.set(xFormsSupp->getForms(), UNO_QUERY);
Reference< XServiceInfo > xSI(_rxForms, UNO_QUERY); // order is important!
OSL_ENSURE(xSI.is(), "OFormLayerXMLExport_Impl::impl_isFormPageContainingForms: invalid collection (must not be NULL and must have a ServiceInfo)!");
if (!xSI.is())
diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx
index a9e0b3e89270..3f9d0eb71ca1 100644
--- a/xmloff/source/meta/MetaExportComponent.cxx
+++ b/xmloff/source/meta/MetaExportComponent.cxx
@@ -106,7 +106,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
aArgs[2] <<= GetModel();
// get filter component
- xDocHandler = uno::Reference< xml::sax::XDocumentHandler >(
+ xDocHandler.set(
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
"com.sun.star.comp.Oasis2OOoTransformer", aArgs, xContext),
uno::UNO_QUERY_THROW );
diff --git a/xmloff/source/meta/MetaImportComponent.cxx b/xmloff/source/meta/MetaImportComponent.cxx
index 0ffcc128d3f4..326b84a1fd9b 100644
--- a/xmloff/source/meta/MetaImportComponent.cxx
+++ b/xmloff/source/meta/MetaImportComponent.cxx
@@ -103,7 +103,7 @@ void SAL_CALL XMLMetaImportComponent::setTargetDocument(
const uno::Reference< lang::XComponent >& xDoc )
throw(lang::IllegalArgumentException, uno::RuntimeException, std::exception)
{
- mxDocProps = uno::Reference< document::XDocumentProperties >::query( xDoc );
+ mxDocProps.set( xDoc, uno::UNO_QUERY );
if( !mxDocProps.is() )
throw lang::IllegalArgumentException(OUString(
"XMLMetaImportComponent::setTargetDocument: argument is no "
diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx
index 8812f8e7041b..236d03fa8ee6 100644
--- a/xmloff/source/meta/xmlversion.cxx
+++ b/xmloff/source/meta/xmlversion.cxx
@@ -354,7 +354,7 @@ void SAL_CALL XMLVersionListPersistence::store( const uno::Reference< embed::XSt
xExp->exportDoc( ::xmloff::token::XML_VERSION );
- xVerStream = uno::Reference< io::XStream >(); // use refcounting for now to dispose
+ xVerStream.clear(); // use refcounting for now to dispose
}
catch( uno::Exception& )
{
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index da1cfbf5ea2b..45723a99d87e 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -241,7 +241,7 @@ Reference < XStyle > XMLPropStyleContext::Create()
Reference < XInterface > xIfc =
xFactory->createInstance( sServiceName );
if( xIfc.is() )
- xNewStyle = Reference < XStyle >( xIfc, UNO_QUERY );
+ xNewStyle.set( xIfc, UNO_QUERY );
}
}
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 7ea0ba1e23c2..0625ce210eb8 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -275,7 +275,7 @@ bool XMLStyleExport::exportStyle(
}
else
{
- xPropState = Reference< XPropertyState >( xStyles->getByName( aParentStyle ), UNO_QUERY );
+ xPropState.set( xStyles->getByName( aParentStyle ), UNO_QUERY );
if ( !xPropState.is() )
{
break;
@@ -287,7 +287,7 @@ bool XMLStyleExport::exportStyle(
}
else
{
- xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
+ xStyle.set( xPropState, UNO_QUERY );
}
}
}
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index a99ef11f2de0..107fba272ec8 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -1252,7 +1252,7 @@ Reference < XIndexReplace > SvxXMLListStyleContext::CreateNumRule(
if( !xIfc.is() )
return xNumRule;
- xNumRule = Reference<XIndexReplace>( xIfc, UNO_QUERY );
+ xNumRule.set( xIfc, UNO_QUERY );
DBG_ASSERT( xNumRule.is(), "go no numbering rule" );
return xNumRule;
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 8a012eab72af..7680d1b5248d 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -571,7 +571,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
Reference<XInterface> xIfc = xFactory->createInstance( sServiceName );
DBG_ASSERT( xIfc.is(), "couldn't create frame" );
if( xIfc.is() )
- xPropSet = Reference < XPropertySet >( xIfc, UNO_QUERY );
+ xPropSet.set( xIfc, UNO_QUERY );
}
}
}
diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx
index 21eafe49df49..9d7290a3879e 100644
--- a/xmloff/source/text/XMLTextMasterPageContext.cxx
+++ b/xmloff/source/text/XMLTextMasterPageContext.cxx
@@ -53,7 +53,7 @@ Reference < XStyle > XMLTextMasterPageContext::Create()
Reference < XInterface > xIfc =
xFactory->createInstance("com.sun.star.style.PageStyle");
if( xIfc.is() )
- xNewStyle = Reference < XStyle >( xIfc, UNO_QUERY );
+ xNewStyle.set( xIfc, UNO_QUERY );
}
return xNewStyle;
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 43478b03bdc9..0e96c953ff77 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -2935,7 +2935,7 @@ bool XMLTextFieldExport::GetDependentFieldPropertySet(
{
// get first one and return
Reference<XDependentTextField> xTField = aFields[0];
- xField = Reference<XPropertySet>(xTField, UNO_QUERY);
+ xField.set(xTField, UNO_QUERY);
DBG_ASSERT(xField.is(),
"Surprisinlgy, this TextField refuses to be a PropertySet!");
return true;
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 2374feec9f8e..2fe66284aee6 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1338,9 +1338,8 @@ static bool lcl_HasListStyle( const OUString& sStyleName,
}
else
{
- xPropState = Reference< XPropertyState >(
- xParaStyles->getByName( aParentStyle ),
- UNO_QUERY );
+ xPropState.set( xParaStyles->getByName( aParentStyle ),
+ UNO_QUERY );
if ( !xPropState.is() )
{
// error case
@@ -1379,7 +1378,7 @@ static bool lcl_HasListStyle( const OUString& sStyleName,
else
{
// search list style at parent
- xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
+ xStyle.set( xPropState, UNO_QUERY );
}
}
}
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 52100214c4d3..3c222215f79a 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -1942,7 +1942,7 @@ void SAL_CALL OOo2OasisTransformer::Initialize(
try
{
// get filter component
- xDocHandler = Reference< XDocumentHandler >(
+ xDocHandler.set(
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(m_aSubServiceName, rArguments, xContext),
UNO_QUERY);
}