summaryrefslogtreecommitdiff
path: root/embeddedobj/source/msole/olepersist.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'embeddedobj/source/msole/olepersist.cxx')
-rw-r--r--embeddedobj/source/msole/olepersist.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 2d74cb858f09..7939ad527499 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/io/XTruncate.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -91,11 +92,8 @@ sal_Bool KillFile_Impl( const ::rtl::OUString& aURL, const uno::Reference< lang:
::rtl::OUString aResult;
uno::Reference < beans::XPropertySet > xTempFile(
- xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
- uno::UNO_QUERY );
-
- if ( !xTempFile.is() )
- throw uno::RuntimeException(); // TODO
+ io::TempFile::create(comphelper::ComponentContext(xFactory).getUNOContext()),
+ uno::UNO_QUERY_THROW );
try {
xTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RemoveFile" )), uno::makeAny( sal_False ) );
@@ -172,7 +170,7 @@ sal_Bool KillFile_Impl( const ::rtl::OUString& aURL, const uno::Reference< lang:
try
{
uno::Reference < beans::XPropertySet > xTempFile(
- xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(xFactory).getUNOContext()),
uno::UNO_QUERY );
uno::Reference < io::XStream > xTempStream( xTempFile, uno::UNO_QUERY_THROW );
@@ -278,7 +276,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::GetNewFilledTempStream_Impl( co
OSL_ENSURE( xInStream.is(), "Wrong parameter is provided!\n" );
uno::Reference < io::XStream > xTempFile(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
uno::UNO_QUERY_THROW );
uno::Reference< io::XOutputStream > xTempOutStream = xTempFile->getOutputStream();
@@ -355,7 +353,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToGetAcceptableFormat_Impl(
{
// this is either a bitmap or a metafile clipboard format, retrieve the pure stream
uno::Reference < io::XStream > xResult(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
uno::UNO_QUERY_THROW );
uno::Reference < io::XSeekable > xResultSeek( xResult, uno::UNO_QUERY_THROW );
uno::Reference < io::XOutputStream > xResultOut = xResult->getOutputStream();
@@ -403,7 +401,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea
xCachedSeek->seek( 0 );
uno::Reference < io::XStream > xTempFile(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
uno::UNO_QUERY_THROW );
uno::Reference< io::XSeekable > xTempSeek( xTempFile, uno::UNO_QUERY_THROW );