diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-02 07:38:44 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-02 06:17:21 +0000 |
commit | 1b41208608f472df8dd5879c27dca45cc2ea7740 (patch) | |
tree | b779c5d0da8994d6e838e1667f3f3d011be2e634 /filter | |
parent | 37d41674c2b1a706c95c2c326cbfbd06b0c1a655 (diff) |
use uno::Reference::set method instead of assignment
Change-Id: I3d94c94a9829161663a7ed18421ace38ce95a659
Reviewed-on: https://gerrit.libreoffice.org/19733
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/config/cache/filtercache.cxx | 8 | ||||
-rw-r--r-- | filter/source/config/cache/typedetection.cxx | 2 | ||||
-rw-r--r-- | filter/source/flash/swffilter.cxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/actimpr.cxx | 4 | ||||
-rw-r--r-- | filter/source/msfilter/eschesdo.cxx | 6 | ||||
-rw-r--r-- | filter/source/msfilter/msocximex.cxx | 3 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 2 | ||||
-rw-r--r-- | filter/source/svg/svgexport.cxx | 4 | ||||
-rw-r--r-- | filter/source/svg/svgimport.cxx | 4 | ||||
-rw-r--r-- | filter/source/svg/test/svg2odf.cxx | 3 | ||||
-rw-r--r-- | filter/source/t602/t602filter.cxx | 2 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 8 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltertestdialog.cxx | 4 |
13 files changed, 25 insertions, 27 deletions
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index 65cba521b004..f4b0874c91ac 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -497,14 +497,14 @@ void FilterCache::addStatePropsToItem( EItemType eType, { case E_TYPE : { - xPackage = css::uno::Reference< css::container::XNameAccess >(impl_openConfig(E_PROVIDER_TYPES), css::uno::UNO_QUERY_THROW); + xPackage.set(impl_openConfig(E_PROVIDER_TYPES), css::uno::UNO_QUERY_THROW); xPackage->getByName(CFGSET_TYPES) >>= xSet; } break; case E_FILTER : { - xPackage = css::uno::Reference< css::container::XNameAccess >(impl_openConfig(E_PROVIDER_FILTERS), css::uno::UNO_QUERY_THROW); + xPackage.set(impl_openConfig(E_PROVIDER_FILTERS), css::uno::UNO_QUERY_THROW); xPackage->getByName(CFGSET_FILTERS) >>= xSet; } break; @@ -532,14 +532,14 @@ void FilterCache::addStatePropsToItem( EItemType eType, } /* <-- HACK */ - xPackage = css::uno::Reference< css::container::XNameAccess >(impl_openConfig(E_PROVIDER_OTHERS), css::uno::UNO_QUERY_THROW); + xPackage.set(impl_openConfig(E_PROVIDER_OTHERS), css::uno::UNO_QUERY_THROW); xPackage->getByName(CFGSET_FRAMELOADERS) >>= xSet; } break; case E_CONTENTHANDLER : { - xPackage = css::uno::Reference< css::container::XNameAccess >(impl_openConfig(E_PROVIDER_OTHERS), css::uno::UNO_QUERY_THROW); + xPackage.set(impl_openConfig(E_PROVIDER_OTHERS), css::uno::UNO_QUERY_THROW); xPackage->getByName(CFGSET_CONTENTHANDLERS) >>= xSet; } break; diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index a637d0890f54..b25f1be2af87 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -1013,7 +1013,7 @@ OUString TypeDetection::impl_askDetectService(const OUString& sDet // third party components here, which can make trouble anyway. So we // should handle errors during creation of such services more // gracefully .-) - xDetector = css::uno::Reference< css::document::XExtendedFilterDetection >( + xDetector.set( xContext->getServiceManager()->createInstanceWithContext(sDetectService, xContext), css::uno::UNO_QUERY_THROW); } diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx index e866ef275bc5..c72256516e43 100644 --- a/filter/source/flash/swffilter.cxx +++ b/filter/source/flash/swffilter.cxx @@ -331,7 +331,7 @@ bool FlashExportFilter::ExportAsMultipleFiles(const Sequence< PropertyValue >& a Reference< XDrawPage > xDrawPage; Reference< XFrame > rFrame = rDesktop->getCurrentFrame(); - Reference< XDrawView > rDrawView = Reference< XDrawView >( rFrame->getController(), UNO_QUERY ); + Reference< XDrawView > rDrawView( rFrame->getController(), UNO_QUERY ); Reference< XDrawPage > rCurrentPage = rDrawView->getCurrentPage(); diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index 9f1bed809c41..2e0048dde16d 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -95,8 +95,8 @@ bool CGMImpressOutAct::ImplInitPage() bool CGMImpressOutAct::ImplCreateShape( const OUString& rType ) { uno::Reference< uno::XInterface > xNewShape( maXMultiServiceFactory->createInstance( rType ) ); - maXShape = uno::Reference< drawing::XShape >( xNewShape, uno::UNO_QUERY ); - maXPropSet = uno::Reference< beans::XPropertySet >( xNewShape, uno::UNO_QUERY ); + maXShape.set( xNewShape, uno::UNO_QUERY ); + maXPropSet.set( xNewShape, uno::UNO_QUERY ); if ( maXShape.is() && maXPropSet.is() ) { maXShapes->add( maXShape ); diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index 463838ea3e98..a453cacf00e2 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -882,7 +882,7 @@ bool ImplEscherExSdr::ImplInitPage( const SdrPage& rPage ) mpSdrPage = NULL; mXDrawPage = pSvxDrawPage = new SvxFmDrawPage( const_cast<SdrPage*>(&rPage) ); - mXShapes = Reference< XShapes >::query( mXDrawPage ); + mXShapes.set( mXDrawPage, UNO_QUERY ); if ( !mXShapes.is() ) break; if ( !ImplInitPageValues() ) // ImplEESdrWriter @@ -1035,7 +1035,7 @@ ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx, { // why not declare a const parameter if the object will // not be modified? - mXShape = uno::Reference< drawing::XShape >::query( const_cast<SdrObject*>(&rObj)->getUnoShape() ); + mXShape.set( const_cast<SdrObject*>(&rObj)->getUnoShape(), UNO_QUERY ); Init( rEx ); } } @@ -1164,7 +1164,7 @@ basegfx::B2DRange getUnrotatedGroupBoundRange(const Reference< XShape >& rxShape void ImplEESdrObject::Init( ImplEESdrWriter& rEx ) { - mXPropSet = Reference< XPropertySet >::query( mXShape ); + mXPropSet.set( mXShape, UNO_QUERY ); if( mXPropSet.is() ) { // detect name first to make below test (is group) work diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index a2c859827cb3..a796798317c5 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -78,8 +78,7 @@ const uno::Reference< drawing::XShapes >& SvxMSConvertOCXControls::GetShapes() if( xDrawPage.is() ) { - xShapes = uno::Reference< drawing::XShapes >(xDrawPage, - uno::UNO_QUERY); + xShapes.set(xDrawPage, uno::UNO_QUERY); OSL_ENSURE( xShapes.is(), "UNO_QUERY failed for XShapes from XDrawPage" ); } } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index fecff378afed..19c333f684cc 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1704,7 +1704,7 @@ bool PPTConvertOCXControls::InsertControl( ->createInstance( "com.sun.star.drawing.ControlShape" ); if( xCreate.is() ) { - xShape = css::uno::Reference< css::drawing::XShape >(xCreate, css::uno::UNO_QUERY); + xShape.set(xCreate, css::uno::UNO_QUERY); if ( xShape.is() ) { xShape->setSize(rSize); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index f04f169c8cb5..76e647923697 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -550,7 +550,7 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) pOStm.reset(::utl::UcbStreamHelper::CreateStream( aFileName, StreamMode::WRITE | StreamMode::TRUNC )); if( pOStm ) - xOStm = Reference< XOutputStream >( new ::utl::OOutputStreamWrapper ( *pOStm ) ); + xOStm.set( new ::utl::OOutputStreamWrapper ( *pOStm ) ); } else if ( pValue[ i ].Name == "FilterData" ) { @@ -1507,7 +1507,7 @@ bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rxPage } else { - xShapes = Reference< XShapes >( rxPages[i], UNO_QUERY ); + xShapes.set( rxPages[i], UNO_QUERY ); } if( xShapes.is() ) diff --git a/filter/source/svg/svgimport.cxx b/filter/source/svg/svgimport.cxx index 66c88c625eca..58bad3f72846 100644 --- a/filter/source/svg/svgimport.cxx +++ b/filter/source/svg/svgimport.cxx @@ -55,8 +55,8 @@ bool SVGFilter::implImport(const Sequence< PropertyValue >& rDescriptor) uno::Reference<io::XInputStream> xInputStream; uno::Reference<task::XStatusIndicator> xStatus; - xInputStream = uno::Reference<io::XInputStream>(aMediaDescriptor[utl::MediaDescriptor::PROP_INPUTSTREAM()], UNO_QUERY); - xStatus = uno::Reference<task::XStatusIndicator>(aMediaDescriptor[utl::MediaDescriptor::PROP_STATUSINDICATOR()], UNO_QUERY); + xInputStream.set(aMediaDescriptor[utl::MediaDescriptor::PROP_INPUTSTREAM()], UNO_QUERY); + xStatus.set(aMediaDescriptor[utl::MediaDescriptor::PROP_STATUSINDICATOR()], UNO_QUERY); if (isStreamGZip(xInputStream)) { diff --git a/filter/source/svg/test/svg2odf.cxx b/filter/source/svg/test/svg2odf.cxx index 46771bdce101..a8620b13d8a6 100644 --- a/filter/source/svg/test/svg2odf.cxx +++ b/filter/source/svg/test/svg2odf.cxx @@ -94,8 +94,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) try { xCtx = ::cppu::defaultBootstrap_InitialComponentContext(aIniUrl); - xFactory = uno::Reference< lang::XMultiServiceFactory >(xCtx->getServiceManager(), - uno::UNO_QUERY); + xFactory.set(xCtx->getServiceManager(), uno::UNO_QUERY); if (!xFactory.is()) { OSL_TRACE( "Could not bootstrap UNO, installation must be in disorder. Exiting." ); diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index a834e649ca1e..c689a2c1a633 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -270,7 +270,7 @@ bool SAL_CALL T602ImportFilter::importImpl( const Sequence< css::beans::Property // An XML import service: what we push sax messages to.. OUString sXMLImportService ( "com.sun.star.comp.Writer.XMLImporter" ); - mxHandler = Reference< XDocumentHandler >( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); + mxHandler.set( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); // The XImporter sets up an empty target document for XDocumentHandler to write to.. Reference < XImporter > xImporter(mxHandler, UNO_QUERY); diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index b82406e16256..f5e506b4e49b 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -92,9 +92,9 @@ XMLFilterSettingsDialog::XMLFilterSettingsDialog(vcl::Window* pParent, try { - mxFilterContainer = Reference< XNameContainer >::query( rxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.FilterFactory", rxContext ) ); - mxTypeDetection = Reference< XNameContainer >::query( rxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.TypeDetection", rxContext ) ); - mxExtendedTypeDetection = Reference< XNameContainer >::query( rxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.ExtendedTypeDetectionFactory", rxContext ) ); + mxFilterContainer.set( rxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.FilterFactory", rxContext ), UNO_QUERY ); + mxTypeDetection.set( rxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.TypeDetection", rxContext ), UNO_QUERY ); + mxExtendedTypeDetection.set( rxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.ExtendedTypeDetectionFactory", rxContext ), UNO_QUERY ); SvtPathOptions aOptions; m_sTemplatePath = aOptions.SubstituteVariable( m_sTemplatePath ); @@ -837,7 +837,7 @@ void XMLFilterSettingsDialog::onDelete() if( xFlushable.is() ) xFlushable->flush(); - xFlushable = Reference< XFlushable >::query( mxTypeDetection ); + xFlushable.set( mxTypeDetection, UNO_QUERY ); if( xFlushable.is() ) xFlushable->flush(); diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index eddaf829e023..2071a134ed20 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -494,8 +494,8 @@ void XMLFilterTestDialog::doExport( Reference< XComponent > xComp ) { try { - xGrfResolver = Reference< XGraphicObjectResolver >::query( xDocFac->createInstance("com.sun.star.document.ExportGraphicObjectResolver") ); - xObjectResolver = Reference< XEmbeddedObjectResolver >::query( xDocFac->createInstance("com.sun.star.document.ExportEmbeddedObjectResolver") ); + xGrfResolver.set( xDocFac->createInstance("com.sun.star.document.ExportGraphicObjectResolver"), UNO_QUERY ); + xObjectResolver.set( xDocFac->createInstance("com.sun.star.document.ExportEmbeddedObjectResolver"), UNO_QUERY ); } catch( const Exception& ) { |