summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/macab
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-14 12:58:00 +0200
committerNoel Grandin <noel@peralex.com>2012-12-21 10:57:09 +0200
commitbb121c864cc3c101ef733a4088c7ba3e36eced14 (patch)
tree2d528ca830aace6e563b7cdc93eb8f8d6c4f70cf /connectivity/source/drivers/macab
parent6d818ed651aaafcfb12ebc21449d35947d2e85a9 (diff)
fdo#46808, Convert frame::Desktop to new style service.
I had to drop XEventBroadcaster from the merged interface because it introduced method name conflicts (addEventListener). Shouldn't be an issue since it was scheduled to be dropped anyhow, and the service implementation still implements it, so existing clients will be fine. I dropped the interface XPropertySet from the combined IDL because nobody seems to be using it, and it's primary purpose appears to be to set weird flags. I dropped the optional interfaces XStatusIndicatorFactory XDispatchInformationProvider from the combined IDL because the service does not implement them, and nobody seems to be using them. I suspect they were mistakenly copied from XFrame. I also did not convert the Title, UserDefinedAttributes and LayoutManager properties to attributes, again because no-one is using them. Change-Id: I678a00006ed2cca2d6c37c4e39465811442c33af
Diffstat (limited to 'connectivity/source/drivers/macab')
-rw-r--r--connectivity/source/drivers/macab/MacabDriver.cxx20
-rw-r--r--connectivity/source/drivers/macab/MacabDriver.hxx14
2 files changed, 13 insertions, 21 deletions
diff --git a/connectivity/source/drivers/macab/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx
index ea60ded3156c..a2adc78d11b2 100644
--- a/connectivity/source/drivers/macab/MacabDriver.cxx
+++ b/connectivity/source/drivers/macab/MacabDriver.cxx
@@ -27,6 +27,7 @@
#include <rtl/ustrbuf.hxx>
#include <tools/diagnose_ex.h>
#include "resource/macab_res.hrc"
+#include <comphelper/processfactory.hxx>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -40,14 +41,11 @@ using namespace connectivity::macab;
// = MacabImplModule
// =======================================================================
// --------------------------------------------------------------------------------
-MacabImplModule::MacabImplModule( const Reference< XMultiServiceFactory >& _rxFactory )
- :m_xORB(_rxFactory)
- ,m_bAttemptedLoadModule(false)
+MacabImplModule::MacabImplModule( const Reference< XMultiServiceFactory >& _rxContext )
+ :m_bAttemptedLoadModule(false)
,m_hConnectorModule(NULL)
,m_pConnectionFactoryFunc(NULL)
{
- if ( !m_xORB.is() )
- throw NullPointerException();
}
// --------------------------------------------------------------------------------
@@ -172,20 +170,18 @@ void MacabImplModule::shutdown()
// = MacabDriver
// =======================================================================
MacabDriver::MacabDriver(
- const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
+ const Reference< ::com::sun::star::uno::XComponentContext >& _rxContext)
: MacabDriver_BASE(m_aMutex),
- m_xMSFactory(_rxFactory),
+ m_xContext(_rxContext),
m_aImplModule(_rxFactory)
{
- if ( !m_xMSFactory.is() )
+ if ( !m_xContext.is() )
throw NullPointerException();
osl_atomic_increment( &m_refCount );
try
{
- Reference< XDesktop > xDesktop(
- m_xMSFactory->createInstance( ::rtl::OUString( "com.sun.star.frame.Desktop" ) ),
- UNO_QUERY_THROW );
+ Reference< XDesktop2 > xDesktop = frame::Desktop::create( m_xContext );
xDesktop->addTerminateListener( this );
}
catch( const Exception& )
@@ -331,7 +327,7 @@ const sal_Char* MacabDriver::impl_getAsciiImplementationName()
// --------------------------------------------------------------------------------
Reference< XInterface > SAL_CALL MacabDriver::Create( const Reference< XMultiServiceFactory >& _rxFactory ) throw( Exception )
{
- return *(new MacabDriver(_rxFactory));
+ return *(new MacabDriver(comphelper::getComponentContext(_rxFactory)));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabDriver.hxx b/connectivity/source/drivers/macab/MacabDriver.hxx
index cbfe0c035bdc..d1d6fe24515b 100644
--- a/connectivity/source/drivers/macab/MacabDriver.hxx
+++ b/connectivity/source/drivers/macab/MacabDriver.hxx
@@ -23,7 +23,6 @@
#include <com/sun/star/sdbc/XDriver.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
-#include <comphelper/processfactory.hxx>
#include <cppuhelper/compbase3.hxx>
#include <osl/module.h>
@@ -49,16 +48,13 @@ namespace connectivity
class MacabImplModule
{
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB;
-
/// Did we already attempt to load the module and to retrieve the symbols?
bool m_bAttemptedLoadModule;
oslModule m_hConnectorModule;
ConnectionFactoryFunction m_pConnectionFactoryFunc;
public:
- MacabImplModule( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory );
+ MacabImplModule();
/** determines whether there is a mac OS present in the environment
*/
@@ -124,8 +120,8 @@ namespace connectivity
::osl::Mutex m_aMutex; // mutex is need to control member access
OWeakRefArray m_xConnections; // vector containing a list of all the
// MacabConnection objects for this Driver
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xMSFactory; // the multi-service factory
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xContext; // the multi-service factory
MacabImplModule m_aImplModule;
public:
@@ -136,7 +132,7 @@ namespace connectivity
static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
- getComponentContext() const { return comphelper::getComponentContext(m_xMSFactory); }
+ getComponentContext() const { return m_xContext; }
/** returns the driver's implementation name (being pure ASCII) for reference in various places
*/
@@ -147,7 +143,7 @@ namespace connectivity
static ::rtl::OUString impl_getConfigurationSettingsPath();
protected:
- MacabDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
+ MacabDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext);
// OComponentHelper
virtual void SAL_CALL disposing(void);