summaryrefslogtreecommitdiff
path: root/dtrans/source/win32/ftransl
diff options
context:
space:
mode:
Diffstat (limited to 'dtrans/source/win32/ftransl')
-rw-r--r--dtrans/source/win32/ftransl/ftransl.cxx12
-rw-r--r--dtrans/source/win32/ftransl/ftransl.hxx5
-rw-r--r--dtrans/source/win32/ftransl/ftranslentry.cxx3
3 files changed, 10 insertions, 10 deletions
diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx
index 422ea63a79d4..53611cba47d4 100644
--- a/dtrans/source/win32/ftransl/ftransl.cxx
+++ b/dtrans/source/win32/ftransl/ftransl.cxx
@@ -21,6 +21,8 @@
#include "ftransl.hxx"
#include <com/sun/star/datatransfer/XMimeContentType.hpp>
+#include <com/sun/star/datatransfer/MimeContentTypeFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include "../misc/ImplHelper.hxx"
#if defined _MSC_VER
@@ -107,8 +109,8 @@ FormatEntry::FormatEntry(
// ctor
//------------------------------------------------------------------------
-CDataFormatTranslator::CDataFormatTranslator( const Reference< XMultiServiceFactory >& rSrvMgr ) :
- m_SrvMgr( rSrvMgr )
+CDataFormatTranslator::CDataFormatTranslator( const Reference< XComponentContext >& rxContext ) :
+ m_xContext( rxContext )
{
initTranslationTable( );
}
@@ -124,11 +126,7 @@ Any SAL_CALL CDataFormatTranslator::getSystemDataTypeFromDataFlavor( const DataF
try
{
- Reference< XMimeContentTypeFactory > refXMimeCntFactory( m_SrvMgr->createInstance(
- "com.sun.star.datatransfer.MimeContentTypeFactory" ), UNO_QUERY );
-
- if ( !refXMimeCntFactory.is( ) )
- throw RuntimeException( );
+ Reference< XMimeContentTypeFactory > refXMimeCntFactory = MimeContentTypeFactory::create( m_xContext );
Reference< XMimeContentType >
refXMimeCntType( refXMimeCntFactory->createMimeContentType( aDataFlavor.MimeType ) );
diff --git a/dtrans/source/win32/ftransl/ftransl.hxx b/dtrans/source/win32/ftransl/ftransl.hxx
index 195dc52cb8e4..4650fc06cd1c 100644
--- a/dtrans/source/win32/ftransl/ftransl.hxx
+++ b/dtrans/source/win32/ftransl/ftransl.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/datatransfer/XDataFormatTranslator.hpp>
#include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include "../misc/WinClip.hxx"
#include <vector>
@@ -66,7 +67,7 @@ class CDataFormatTranslator : public
{
public:
- CDataFormatTranslator( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSrvMgr );
+ CDataFormatTranslator( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
//------------------------------------------------
// XDataFormatTranslator
@@ -108,7 +109,7 @@ private:
private:
std::vector< FormatEntry > m_TranslTable;
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_SrvMgr;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
};
diff --git a/dtrans/source/win32/ftransl/ftranslentry.cxx b/dtrans/source/win32/ftransl/ftranslentry.cxx
index eecdb3c486f2..2b04e1877c29 100644
--- a/dtrans/source/win32/ftransl/ftranslentry.cxx
+++ b/dtrans/source/win32/ftransl/ftranslentry.cxx
@@ -18,6 +18,7 @@
*/
#include <cppuhelper/factory.hxx>
+#include <comphelper/processfactory.hxx>
#include <com/sun/star/container/XSet.hpp>
#include <osl/diagnose.h>
@@ -60,7 +61,7 @@ namespace
Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
{
- return Reference< XInterface >( static_cast< XDataFormatTranslator* >( new CDataFormatTranslator( rServiceManager ) ) );
+ return Reference< XInterface >( static_cast< XDataFormatTranslator* >( new CDataFormatTranslator( comphelper::getComponentContext(rServiceManager) ) ) );
}
}