diff options
Diffstat (limited to 'linguistic/source/dicimp.cxx')
-rw-r--r-- | linguistic/source/dicimp.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
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 &) |