summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-19 13:15:15 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-19 13:16:38 +0200
commit03a9f139bd9ea1a4f9096fc982e6b326def58532 (patch)
treebfb7a08bb4831a1a46b48c3bb49afa77ca436349 /package
parente8a169c93d7e2443a2e56afe7e99cd0721a2c27b (diff)
ComponentContext::getUnoContext -> getComponentContext simplification
...and some further clean-up. Change-Id: If5dce53e382b56390c502d0d0d93fc06cbfe33ea
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/owriteablestream.cxx4
-rw-r--r--package/source/xstor/selfterminatefilestream.cxx3
-rw-r--r--package/source/xstor/switchpersistencestream.cxx4
-rw-r--r--package/source/xstor/xfactory.cxx6
-rw-r--r--package/source/xstor/xstorage.cxx8
-rw-r--r--package/source/zippackage/ZipPackage.cxx14
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx8
-rw-r--r--package/source/zippackage/zipfileaccess.cxx4
8 files changed, 25 insertions, 26 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index ce8b36e2382b..88371544f4b4 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -237,7 +237,7 @@ const sal_Int32 n_ConstBufferSize = 32000;
::rtl::OUString aTempURL;
uno::Reference < beans::XPropertySet > xTempFile(
- io::TempFile::create(comphelper::ComponentContext(xFactory).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(xFactory)),
uno::UNO_QUERY_THROW );
try {
@@ -1511,7 +1511,7 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io:
uno::Reference < io::XStream > xTempFile;
if ( !xTargetStream.is() )
xTempFile = uno::Reference < io::XStream >(
- io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
uno::UNO_QUERY );
else
xTempFile = xTargetStream;
diff --git a/package/source/xstor/selfterminatefilestream.cxx b/package/source/xstor/selfterminatefilestream.cxx
index ee726ca691b5..f47e95b5a6f1 100644
--- a/package/source/xstor/selfterminatefilestream.cxx
+++ b/package/source/xstor/selfterminatefilestream.cxx
@@ -21,7 +21,6 @@
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include "selfterminatefilestream.hxx"
-#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
using namespace ::com::sun::star;
@@ -38,7 +37,7 @@ OSelfTerminateFileStream::OSelfTerminateFileStream( const uno::Reference< lang::
// otherwise an exception is thrown in constructor
m_xFileAccess.set( ucb::SimpleFileAccess::create(
- comphelper::ComponentContext(xOwnFactory).getUNOContext() ) );
+ comphelper::getComponentContext(xOwnFactory) ) );
m_xInputStream.set( m_xFileAccess->openFileRead( aURL ), uno::UNO_SET_THROW );
m_xSeekable.set( m_xInputStream, uno::UNO_QUERY_THROW );
diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx
index 359a65a0ac40..16581fa73ecf 100644
--- a/package/source/xstor/switchpersistencestream.cxx
+++ b/package/source/xstor/switchpersistencestream.cxx
@@ -20,7 +20,7 @@
#include <osl/diagnose.h>
#include <com/sun/star/io/TempFile.hpp>
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include <switchpersistencestream.hxx>
@@ -176,7 +176,7 @@ void SwitchablePersistenceStream::CopyAndSwitchPersistenceTo( const uno::Referen
if ( !xTargetStream.is() )
{
xTargetStream = uno::Reference < io::XStream >(
- io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
uno::UNO_QUERY_THROW );
xTargetSeek = uno::Reference< io::XSeekable >( xTargetStream, uno::UNO_QUERY_THROW );
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx
index 302334646d25..2faad113d31d 100644
--- a/package/source/xstor/xfactory.cxx
+++ b/package/source/xstor/xfactory.cxx
@@ -25,7 +25,7 @@
#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XSeekable.hpp>
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include "xfactory.hxx"
@@ -85,7 +85,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstance()
{
// TODO: reimplement TempStream service to support XStream interface
uno::Reference < io::XStream > xTempStream(
- io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
uno::UNO_QUERY_THROW );
return uno::Reference< uno::XInterface >(
@@ -155,7 +155,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
uno::Reference < ucb::XSimpleFileAccess2 > xTempAccess(
ucb::SimpleFileAccess::create(
- comphelper::ComponentContext(m_xFactory).getUNOContext() ) );
+ comphelper::getComponentContext(m_xFactory) ) );
if ( nStorageMode & embed::ElementModes::WRITE )
xStream = xTempAccess->openFileReadWrite( aURL );
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 9900cbc4dcad..3908e8acaf3d 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -145,7 +145,7 @@ uno::Reference< io::XInputStream > GetSeekableTempCopy( uno::Reference< io::XInp
uno::Reference< lang::XMultiServiceFactory > xFactory )
{
uno::Reference < io::XOutputStream > xTempOut(
- io::TempFile::create(comphelper::ComponentContext(xFactory).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(xFactory)),
uno::UNO_QUERY );
uno::Reference < io::XInputStream > xTempIn( xTempOut, uno::UNO_QUERY );
@@ -3801,7 +3801,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement(
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
uno::Reference < io::XOutputStream > xTempOut(
- io::TempFile::create(comphelper::ComponentContext(m_pImpl->GetServiceFactory()).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(m_pImpl->GetServiceFactory())),
uno::UNO_QUERY );
xTempIn = uno::Reference < io::XInputStream >( xTempOut, uno::UNO_QUERY );
uno::Reference < io::XSeekable > xSeek( xTempOut, uno::UNO_QUERY );
@@ -3913,7 +3913,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement(
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
uno::Reference < io::XOutputStream > xTempOut(
- io::TempFile::create(comphelper::ComponentContext(m_pImpl->GetServiceFactory()).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(m_pImpl->GetServiceFactory())),
uno::UNO_QUERY );
xTempIn = uno::Reference < io::XInputStream >( xTempOut, uno::UNO_QUERY );
uno::Reference < io::XSeekable > xSeek( xTempOut, uno::UNO_QUERY );
@@ -5948,7 +5948,7 @@ void SAL_CALL OStorage::attachToURL( const ::rtl::OUString& sURL,
uno::Reference < ucb::XSimpleFileAccess2 > xAccess(
ucb::SimpleFileAccess::create(
- comphelper::ComponentContext(m_pImpl->m_xFactory).getUNOContext() ) );
+ comphelper::getComponentContext(m_pImpl->m_xFactory) ) );
try
{
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index a9c4ba0db6fd..5e2b2cf2bc47 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -73,7 +73,7 @@
#include <vector>
#include <ucbhelper/fileidentifierconverter.hxx>
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/seekableinput.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/ofopxmlhelper.hxx>
@@ -177,7 +177,7 @@ sal_Bool ZipPackage::isLocalFile() const
OUString aSystemPath;
uno::Reference< XUniversalContentBroker > xUcb(
UniversalContentBroker::create(
- comphelper::ComponentContext( m_xFactory ).getUNOContext() ) );
+ comphelper::getComponentContext( m_xFactory ) ) );
try
{
aSystemPath = getSystemPathFromFileURL( xUcb, m_aURL );
@@ -633,7 +633,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
Content aContent(
m_aURL, uno::Reference< XCommandEnvironment >(),
- comphelper::ComponentContext( m_xFactory ).getUNOContext() );
+ comphelper::getComponentContext( m_xFactory ) );
Any aAny = aContent.getPropertyValue("Size");
sal_uInt64 aSize = 0;
// kind of optimisation: treat empty files as nonexistent files
@@ -1165,7 +1165,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
if( bUseTemp )
{
// create temporary file
- uno::Reference < io::XStream > xTempFile( io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()), UNO_QUERY_THROW );
+ uno::Reference < io::XStream > xTempFile( io::TempFile::create(comphelper::getComponentContext(m_xFactory)), UNO_QUERY_THROW );
xTempOut.set( xTempFile->getOutputStream(), UNO_SET_THROW );
xTempIn.set( xTempFile->getInputStream(), UNO_SET_THROW );
}
@@ -1320,7 +1320,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput()
// open and truncate the original file
Content aOriginalContent(
m_aURL, uno::Reference< XCommandEnvironment >(),
- comphelper::ComponentContext( m_xFactory ).getUNOContext() );
+ comphelper::getComponentContext( m_xFactory ) );
uno::Reference< XActiveDataStreamer > xSink = new ActiveDataStreamer;
if ( m_eMode == e_IMode_URL )
@@ -1455,7 +1455,7 @@ void SAL_CALL ZipPackage::commitChanges()
{
// write directly in case of local file
uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > xSimpleAccess(
- SimpleFileAccess::create( comphelper::ComponentContext(m_xFactory).getUNOContext() ) );
+ SimpleFileAccess::create( comphelper::getComponentContext(m_xFactory) ) );
OSL_ENSURE( xSimpleAccess.is(), "Can't instatiate SimpleFileAccess service!\n" );
uno::Reference< io::XTruncate > xOrigTruncate;
if ( xSimpleAccess.is() )
@@ -1503,7 +1503,7 @@ void SAL_CALL ZipPackage::commitChanges()
OUString sTargetFolder = m_aURL.copy ( 0, m_aURL.lastIndexOf ( static_cast < sal_Unicode > ( '/' ) ) );
Content aContent(
sTargetFolder, uno::Reference< XCommandEnvironment >(),
- comphelper::ComponentContext( m_xFactory ).getUNOContext() );
+ comphelper::getComponentContext( m_xFactory ) );
OUString sTempURL;
Any aAny = xPropSet->getPropertyValue ("Uri");
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 5c7feb7645ca..fa8b17dbdb73 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -38,7 +38,7 @@
#include <osl/diagnose.h>
#include "wrapstreamforshare.hxx"
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/seekableinput.hxx>
#include <comphelper/storagehelper.hxx>
@@ -177,7 +177,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCop
// create temporary stream
uno::Reference < io::XOutputStream > xTempOut(
- io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
uno::UNO_QUERY_THROW );
uno::Reference < io::XInputStream > xTempIn( xTempOut, UNO_QUERY_THROW );
uno::Reference < io::XSeekable > xTempSeek( xTempOut, UNO_QUERY_THROW );
@@ -282,7 +282,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream(
{
// create temporary file
uno::Reference < io::XStream > xTempStream(
- io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
uno::UNO_QUERY_THROW );
// create a package based on it
@@ -339,7 +339,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream(
// create another temporary file
uno::Reference < io::XOutputStream > xTempOut(
- io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
+ io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
uno::UNO_QUERY_THROW );
uno::Reference < io::XInputStream > xTempIn( xTempOut, UNO_QUERY_THROW );
uno::Reference < io::XSeekable > xTempSeek( xTempOut, UNO_QUERY_THROW );
diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx
index 64f244c9d69c..0ee088f6ffda 100644
--- a/package/source/zippackage/zipfileaccess.cxx
+++ b/package/source/zippackage/zipfileaccess.cxx
@@ -23,7 +23,7 @@
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XSeekable.hpp>
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <zipfileaccess.hxx>
#include <ZipEnumeration.hxx>
#include <ZipPackageSink.hxx>
@@ -188,7 +188,7 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu
::ucbhelper::Content aContent(
aParamURL,
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
- comphelper::ComponentContext( m_xFactory ).getUNOContext() );
+ comphelper::getComponentContext( m_xFactory ) );
uno::Reference < io::XActiveDataSink > xSink = new ZipPackageSink;
if ( aContent.openStream ( xSink ) )
{