diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-21 12:02:40 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-21 13:53:20 +0200 |
commit | d4d16d8a27517930bdc9e9a308da287d367dd622 (patch) | |
tree | 5c37e8317dd85c2a9d93eab152133512d9c1408e /oox | |
parent | 823377b707fda94222a99b6710363f392fd9e4dd (diff) |
fdo#46808, Remove unnecessary XMultiServiceFactory member
.. and associated methods
Change-Id: Iec01b4615decc1616e405166088d7d1d844ac0ae
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/filterbase.cxx | 11 | ||||
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 14 | ||||
-rw-r--r-- | oox/source/drawingml/chart/converterbase.cxx | 6 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/pptimport.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/timenode.cxx | 2 |
6 files changed, 13 insertions, 24 deletions
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 13551fe495e5..6a6f73b1e386 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -144,7 +144,6 @@ struct FilterBaseImpl Reference< XComponentContext > mxComponentContext; Reference< XMultiComponentFactory > mxComponentFactory; - Reference< XMultiServiceFactory > mxServiceFactory; Reference< XModel > mxModel; Reference< XMultiServiceFactory > mxModelFactory; Reference< XFrame > mxTargetFrame; @@ -168,8 +167,7 @@ FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext meDirection( FILTERDIRECTION_UNKNOWN ), meVersion( ECMA_DIALECT ), mxComponentContext( rxContext, UNO_SET_THROW ), - mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW ), - mxServiceFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ) + mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW ) { } @@ -245,11 +243,6 @@ const Reference< XComponentContext >& FilterBase::getComponentContext() const return mxImpl->mxComponentContext; } -const Reference< XMultiServiceFactory >& FilterBase::getServiceFactory() const -{ - return mxImpl->mxServiceFactory; -} - const Reference< XModel >& FilterBase::getModel() const { return mxImpl->mxModel; @@ -561,7 +554,7 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc OUString sFilterName = mxImpl->maMediaDesc.getUnpackedValueOrDefault( "FilterName", OUString() ); try { - Reference< XNameAccess > xFilters( getServiceFactory()->createInstance("com.sun.star.document.FilterFactory" ), UNO_QUERY_THROW ); + Reference< XNameAccess > xFilters( Reference<XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance("com.sun.star.document.FilterFactory" ), UNO_QUERY_THROW ); Any aValues = xFilters->getByName( sFilterName ); Sequence<PropertyValue > aPropSeq; aValues >>= aPropSeq; diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index fe2055e6eda2..9a06b815f890 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -47,14 +47,10 @@ #include <comphelper/processfactory.hxx> #include <oox/core/filterdetect.hxx> #include <comphelper/storagehelper.hxx> -using ::com::sun::star::uno::XComponentContext; -using ::com::sun::star::document::XOOXMLDocumentPropertiesImporter; -using ::com::sun::star::document::XDocumentPropertiesSupplier; + using ::com::sun::star::xml::dom::DocumentBuilder; using ::com::sun::star::xml::dom::XDocument; using ::com::sun::star::xml::dom::XDocumentBuilder; -using ::com::sun::star::xml::sax::XFastSAXSerializable; -using ::com::sun::star::lang::XComponent; namespace oox { namespace core { @@ -204,10 +200,10 @@ XmlFilterBase::~XmlFilterBase() void XmlFilterBase::importDocumentProperties() { - Reference< XMultiServiceFactory > xFactory( getServiceFactory(), UNO_QUERY ); + Reference< XMultiServiceFactory > xFactory( getComponentContext()->getServiceManager(), UNO_QUERY ); MediaDescriptor aMediaDesc( getMediaDescriptor() ); Reference< XInputStream > xInputStream; - Reference< XComponentContext > xContext = comphelper::getComponentContext(getServiceFactory()); + Reference< XComponentContext > xContext = getComponentContext(); ::oox::core::FilterDetect aDetector( xContext ); xInputStream = aDetector.extractUnencryptedPackage( aMediaDesc ); Reference< XComponent > xModel( getModel(), UNO_QUERY ); @@ -330,9 +326,7 @@ Reference<XDocument> XmlFilterBase::importFragment( const OUString& aFragmentPat try { // create the dom parser - Reference< XComponentContext > xContext = - comphelper::getComponentContext(getServiceFactory()); - Reference<XDocumentBuilder> xDomBuilder( DocumentBuilder::create(xContext) ); + Reference<XDocumentBuilder> xDomBuilder( DocumentBuilder::create( getComponentContext() ) ); // create DOM from fragment xRet = xDomBuilder->parse(xInStrm); diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index 67f0a68a05d6..e36ecf1def58 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -231,7 +231,9 @@ Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceN Reference< XInterface > xInt; try { - xInt = mxData->mrFilter.getServiceFactory()->createInstance( rServiceName ); + Reference<XMultiServiceFactory> xMSF = Reference<XMultiServiceFactory>(getComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW); + + xInt = xMSF->createInstance( rServiceName ); } catch( Exception& ) { @@ -242,7 +244,7 @@ Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceN Reference< XComponentContext > ConverterRoot::getComponentContext() const { - return comphelper::getComponentContext(mxData->mrFilter.getServiceFactory()); + return mxData->mrFilter.getComponentContext(); } XmlFilterBase& ConverterRoot::getFilter() const diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 2f918c2460fc..2fc1133d7033 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1312,7 +1312,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) if( xSheetDoc.is() && mpFB) { Reference< XComponent > xDocument( mAny, UNO_QUERY ); - Reference< XExporter > xExporter( mpFB->getServiceFactory()->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY ); + Reference< XExporter > xExporter( Reference<css::lang::XMultiServiceFactory>(mpFB->getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY );; if( xDocument.is() && xExporter.is()) { Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index a7e992219f8d..285ac2a064bc 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -140,7 +140,7 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe return true; if( isExportFilter() ) { - Reference< XExporter > xExporter( getServiceFactory()->createInstance( "com.sun.star.comp.Impress.oox.PowerPointExport" ), UNO_QUERY ); + Reference< XExporter > xExporter( Reference<css::lang::XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.Impress.oox.PowerPointExport" ), UNO_QUERY );; if( xExporter.is() ) { Reference< XComponent > xDocument( getModel(), UNO_QUERY ); diff --git a/oox/source/ppt/timenode.cxx b/oox/source/ppt/timenode.cxx index 3248e41f40b1..309d3bf0b2fa 100644 --- a/oox/source/ppt/timenode.cxx +++ b/oox/source/ppt/timenode.cxx @@ -578,7 +578,7 @@ namespace oox { namespace ppt { const Reference< XAnimationNode >& rxNode ) { try { - Reference< XAnimationNode > xNode ( rFilter.getServiceFactory()->createInstance( rServiceName ), UNO_QUERY_THROW ); + Reference< XAnimationNode > xNode( Reference<css::lang::XMultiServiceFactory>(rFilter.getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( rServiceName ), UNO_QUERY_THROW );; Reference< XTimeContainer > xParentContainer( rxNode, UNO_QUERY_THROW ); xParentContainer->appendChild( xNode ); |