diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-03 16:33:30 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-10 08:05:53 +0200 |
commit | 24f0aa76c005d1506a6d13945c39dafc6e9b8d91 (patch) | |
tree | de84b05444d3436ed107bc4fb7d3522284e69529 /chart2 | |
parent | b9a4a0b9658015a0d55c42de1f5e56941e20d268 (diff) |
fdo#46808, use service constructor for embed::StorageFactory
Change-Id: I26cd1cf86118122f392f16801a646df753a7df26
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/model/filter/XMLFilter.cxx | 12 | ||||
-rw-r--r-- | chart2/source/model/main/ChartModel_Persistence.cxx | 16 |
2 files changed, 7 insertions, 21 deletions
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index 10a565a7338e..c832d4a41d6a 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/embed/StorageFactory.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> @@ -101,10 +102,7 @@ uno::Reference< embed::XStorage > lcl_getWriteStorage( } else { - Reference< lang::XSingleServiceFactory > xStorageFact( - xContext->getServiceManager()->createInstanceWithContext( - C2U("com.sun.star.embed.StorageFactory"), - xContext ), uno::UNO_QUERY_THROW ); + Reference< lang::XSingleServiceFactory > xStorageFact( embed::StorageFactory::create( xContext ) ); ::std::vector< beans::PropertyValue > aPropertiesForStorage; @@ -188,11 +186,7 @@ uno::Reference< embed::XStorage > lcl_getReadStorage( return xStorage; // convert XInputStream to XStorage via the storage factory - Reference< lang::XSingleServiceFactory > xStorageFact( - xContext->getServiceManager()->createInstanceWithContext( - C2U("com.sun.star.embed.StorageFactory"), - xContext ), - uno::UNO_QUERY_THROW ); + Reference< lang::XSingleServiceFactory > xStorageFact( embed::StorageFactory::create( xContext ) ); Sequence< uno::Any > aStorageArgs( 3 ); aStorageArgs[0] <<= xStream; aStorageArgs[1] <<= (embed::ElementModes::READ | embed::ElementModes::NOCREATE); diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx index 1e4d1f4264f5..0e638ece1c15 100644 --- a/chart2/source/model/main/ChartModel_Persistence.cxx +++ b/chart2/source/model/main/ChartModel_Persistence.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/drawing/ProjectionMode.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/embed/StorageFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/uno/XComponentContext.hpp> @@ -118,11 +119,7 @@ Reference< embed::XStorage > lcl_createStorage( ::ucbhelper::Content( rURL, Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext()).openStream(), uno::UNO_QUERY ); - Reference< lang::XSingleServiceFactory > xStorageFact( - xContext->getServiceManager()->createInstanceWithContext( - C2U("com.sun.star.embed.StorageFactory"), - xContext ), - uno::UNO_QUERY_THROW ); + Reference< lang::XSingleServiceFactory > xStorageFact( embed::StorageFactory::create( xContext ) ); Sequence< uno::Any > aStorageArgs( 3 ); aStorageArgs[0] <<= xStream; aStorageArgs[1] <<= embed::ElementModes::READWRITE; @@ -311,13 +308,12 @@ void SAL_CALL ChartModel::storeToURL( { if( m_xContext.is() && aMediaDescriptorHelper.ISSET_OutputStream ) { - Reference< lang::XMultiServiceFactory > xFact( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); Reference< io::XStream > xStream( io::TempFile::create(m_xContext), uno::UNO_QUERY_THROW ); Reference< io::XInputStream > xInputStream( xStream->getInputStream()); Reference< embed::XStorage > xStorage( - ::comphelper::OStorageHelper::GetStorageFromStream( xStream, embed::ElementModes::READWRITE, xFact )); + ::comphelper::OStorageHelper::GetStorageFromStream( xStream, embed::ElementModes::READWRITE, m_xContext )); if( xStorage.is()) { impl_store( aReducedMediaDescriptor, xStorage ); @@ -528,11 +524,7 @@ void SAL_CALL ChartModel::load( return; } - Reference< lang::XSingleServiceFactory > xStorageFact( - m_xContext->getServiceManager()->createInstanceWithContext( - C2U("com.sun.star.embed.StorageFactory"), - m_xContext ), - uno::UNO_QUERY_THROW ); + Reference< lang::XSingleServiceFactory > xStorageFact( embed::StorageFactory::create(m_xContext) ); if( aMDHelper.ISSET_Stream ) { |