summaryrefslogtreecommitdiff
path: root/linguistic/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-05-29 17:17:28 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-06-06 10:01:22 +0200
commitd08578912f2c9ef42d4349079422e25b951e544e (patch)
treed029b5a9110bcdc255e72ef9c98887f3f8521ea6 /linguistic/source
parent7d2a5b5114987f1ab415e32ebb5bb9a46b98dc17 (diff)
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new SimpleFileAccess::create method Change-Id: Ie5b0696fe2228a9033b19969245a53c21a61aa14 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'linguistic/source')
-rw-r--r--linguistic/source/convdic.cxx9
-rw-r--r--linguistic/source/dicimp.cxx13
-rw-r--r--linguistic/source/dlistimp.cxx8
3 files changed, 16 insertions, 14 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 5827d1f88985..71dd0167b43a 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -48,7 +48,8 @@
#include <com/sun/star/util/XFlushable.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/lang/EventObject.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/util/XFlushListener.hpp>
@@ -90,12 +91,13 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport )
DBG_ASSERT(!INetURLObject( rMainURL ).HasError(), "invalid URL");
uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
// get xInputStream stream
uno::Reference< io::XInputStream > xIn;
try
{
- uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( "com.sun.star.ucb.SimpleFileAccess" ), uno::UNO_QUERY_THROW );
+ uno::Reference< ucb::XSimpleFileAccess2 > xAccess( ucb::SimpleFileAccess::create(xContext) );
xIn = xAccess->openFileRead( rMainURL );
}
catch (const uno::Exception &)
@@ -261,13 +263,14 @@ void ConvDic::Save()
return;
DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL");
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
// get XOutputStream stream
uno::Reference< io::XStream > xStream;
try
{
- uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( "com.sun.star.ucb.SimpleFileAccess" ), uno::UNO_QUERY_THROW );
+ uno::Reference< ucb::XSimpleFileAccess2 > xAccess( ucb::SimpleFileAccess::create(xContext) );
xStream = xAccess->openFileReadWrite( aMainURL );
}
catch (const uno::Exception &)
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 85a25afa5ddb..42941cdbeda7 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -42,7 +42,8 @@
#include <comphelper/string.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/linguistic2/DictionaryType.hpp>
#include <com/sun/star/linguistic2/DictionaryEventFlags.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
@@ -275,14 +276,13 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL)
if (rMainURL.isEmpty())
return 0;
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
// get XInputStream stream
uno::Reference< io::XInputStream > xStream;
try
{
- uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance(
- A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< ucb::XSimpleFileAccess2 > xAccess( ucb::SimpleFileAccess::create(xContext) );
xStream = xAccess->openFileRead( rMainURL );
}
catch (const uno::Exception &)
@@ -416,14 +416,13 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL)
return 0;
DBG_ASSERT(!INetURLObject( rURL ).HasError(), "lng : invalid URL");
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
// get XOutputStream stream
uno::Reference< io::XStream > xStream;
try
{
- uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance(
- A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< ucb::XSimpleFileAccess2 > xAccess( ucb::SimpleFileAccess::create(xContext) );
xStream = xAccess->openFileReadWrite( rURL );
}
catch (const uno::Exception &)
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 316d86ddcc92..f5ac64054e0d 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -46,7 +46,8 @@
#include <com/sun/star/linguistic2/DictionaryEventFlags.hpp>
#include <com/sun/star/linguistic2/DictionaryListEventFlags.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include "defs.hxx"
#include "dlistimp.hxx"
@@ -899,14 +900,13 @@ static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bo
return sal_False;
// get stream to be used
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
// get XInputStream stream
uno::Reference< io::XInputStream > xStream;
try
{
- uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance(
- A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< ucb::XSimpleFileAccess2 > xAccess( ucb::SimpleFileAccess::create(xContext) );
xStream = xAccess->openFileRead( rFileURL );
}
catch (const uno::Exception &)