summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-23 17:23:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-08-27 15:40:08 +0200
commit206c70eef30f7b6f538b88f7fb9505f397bef073 (patch)
treed311561f2eb90b57aeed5c1642882a90ddbd4c6a /oox
parent7634d064adc2c773288cec751674ff691de20b2b (diff)
fdo#46808, Adapt TempFile UNO service to new style
Change-Id: Ia448d6d74201e2be487c6d8317f94be3745808aa
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/filterdetect.cxx4
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx6
-rw-r--r--oox/source/ole/olestorage.cxx10
3 files changed, 9 insertions, 11 deletions
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 464bf51c18a8..0e2a1cb64f32 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -19,6 +19,7 @@
#include "oox/core/filterdetect.hxx"
+#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <comphelper/docpasswordhelper.hxx>
#include <comphelper/mediadescriptor.hxx>
@@ -574,8 +575,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
else
{
// create temporary file for unencrypted package
- Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW );
- Reference< XStream > xTempFile( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( TempFile::create(mxContext), UNO_QUERY_THROW );
Reference< XOutputStream > xDecryptedPackage( xTempFile->getOutputStream(), UNO_SET_THROW );
BinaryXOutputStream aDecryptedPackage( xDecryptedPackage, true );
BinaryXInputStream aEncryptedPackage( xEncryptedPackage, true );
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index 8c340b183bc0..1b13420f866b 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/io/XTempFile.hpp>
+#include <com/sun/star/io/TempFile.hpp>
#include "oox/drawingml/graphicshapecontext.hxx"
#include <osl/diagnose.h>
@@ -76,9 +76,9 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa
getEmbeddedWAVAudioFile( getRelations(), xAttribs, mpShapePtr->getGraphicProperties().maAudio );
if( !mpShapePtr->getGraphicProperties().maAudio.msEmbed.isEmpty() )
{
- Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
Reference< XInputStream > xInStrm( getFilter().openInputStream( mpShapePtr->getGraphicProperties().maAudio.msEmbed ), UNO_SET_THROW );
- Reference< XTempFile > xTempFile( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
+ Reference< XTempFile > xTempFile( TempFile::create(xContext) );
Reference< XOutputStream > xOutStrm( xTempFile->getOutputStream(), UNO_SET_THROW );
BinaryXOutputStream aOutStrm( xOutStrm, false );
BinaryXInputStream aInStrm( xInStrm, false );
diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx
index fdd6c8de2a95..3b71dda8068c 100644
--- a/oox/source/ole/olestorage.cxx
+++ b/oox/source/ole/olestorage.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XSeekable.hpp>
@@ -95,8 +96,7 @@ OleOutputStream::OleOutputStream( const Reference< XComponentContext >& rxContex
{
try
{
- Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW );
- mxTempFile.set( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
+ mxTempFile.set( TempFile::create(rxContext), UNO_QUERY_THROW );
mxOutStrm = mxTempFile->getOutputStream();
mxSeekable.set( mxOutStrm, UNO_QUERY );
}
@@ -224,8 +224,7 @@ void OleStorage::initStorage( const Reference< XInputStream >& rxInStream )
Reference< XInputStream > xInStrm = rxInStream;
if( !Reference< XSeekable >( xInStrm, UNO_QUERY ).is() ) try
{
- Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW );
- Reference< XStream > xTempFile( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( TempFile::create(mxContext), UNO_QUERY_THROW );
{
Reference< XOutputStream > xOutStrm( xTempFile->getOutputStream(), UNO_SET_THROW );
/* Pass false to both binary stream objects to keep the UNO
@@ -335,8 +334,7 @@ StorageRef OleStorage::implOpenSubStorage( const OUString& rElementName, bool bC
if( !isReadOnly() && (bCreateMissing || xSubStorage.get()) ) try
{
// create new storage based on a temp file
- Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW );
- Reference< XStream > xTempFile( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( TempFile::create(mxContext), UNO_QUERY_THROW );
StorageRef xTempStorage( new OleStorage( *this, xTempFile, rElementName ) );
// copy existing substorage into temp storage
if( xSubStorage.get() )