summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-03 16:33:30 +0200
committerNoel Grandin <noel@peralex.com>2012-12-10 08:05:53 +0200
commit24f0aa76c005d1506a6d13945c39dafc6e9b8d91 (patch)
treede84b05444d3436ed107bc4fb7d3522284e69529 /embeddedobj
parentb9a4a0b9658015a0d55c42de1f5e56941e20d268 (diff)
fdo#46808, use service constructor for embed::StorageFactory
Change-Id: I26cd1cf86118122f392f16801a646df753a7df26
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/commonembedding/persistence.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index a54f3a9f3bd0..abb841813765 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/embed/XOptimizedStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/EmbedUpdateModes.hpp>
+#include <com/sun/star/embed/StorageFactory.hpp>
#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XStorable.hpp>
@@ -119,18 +120,15 @@ uno::Sequence< beans::PropertyValue > addAsTemplate( const uno::Sequence< beans:
//------------------------------------------------------
uno::Reference< io::XInputStream > createTempInpStreamFromStor(
const uno::Reference< embed::XStorage >& xStorage,
- const uno::Reference< lang::XMultiServiceFactory >& xFactory )
+ const uno::Reference< uno::XComponentContext >& xContext )
{
OSL_ENSURE( xStorage.is(), "The storage can not be empty!" );
uno::Reference< io::XInputStream > xResult;
- uno::Reference < io::XStream > xTempStream( io::TempFile::create(comphelper::getComponentContext(xFactory)),
- uno::UNO_QUERY_THROW );
+ uno::Reference < io::XStream > xTempStream( io::TempFile::create(xContext), uno::UNO_QUERY_THROW );
- uno::Reference < lang::XSingleServiceFactory > xStorageFactory(
- xFactory->createInstance ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.StorageFactory" )) ),
- uno::UNO_QUERY );
+ uno::Reference < lang::XSingleServiceFactory > xStorageFactory( embed::StorageFactory::create(xContext) );
uno::Sequence< uno::Any > aArgs( 2 );
aArgs[0] <<= xTempStream;
@@ -509,7 +507,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
uno::Reference< io::XInputStream > xTempInpStream;
if ( !xDoc.is() )
{
- xTempInpStream = createTempInpStreamFromStor( xSourceStorage, m_xFactory );
+ xTempInpStream = createTempInpStreamFromStor( xSourceStorage, comphelper::getComponentContext(m_xFactory) );
if ( !xTempInpStream.is() )
throw uno::RuntimeException();