diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-07 11:05:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-09 08:08:19 +0200 |
commit | 46fe5e5e06dba9a450f9339b0bf662547a6966e4 (patch) | |
tree | de0a5ecbd3b64aa111570285dbc282c369a4e8b7 /dbaccess | |
parent | 0b6a0657491fdd126541018ac32810f80698ebd0 (diff) |
fdo#46808, convert UnoControl and sub-classes to XComponentContext
Change-Id: I4ade267a44620f5a3af8009ac57a2456c62b83bc
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/uno/ColumnControl.cxx | 16 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/ColumnControl.hxx | 4 |
2 files changed, 15 insertions, 5 deletions
diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx index 2a71d359931d..7682a612250e 100644 --- a/dbaccess/source/ui/uno/ColumnControl.cxx +++ b/dbaccess/source/ui/uno/ColumnControl.cxx @@ -23,6 +23,7 @@ #include "apitools.hxx" #include <com/sun/star/awt/PosSize.hpp> #include "dbu_reghelper.hxx" +#include <comphelper/processfactory.hxx> extern "C" void SAL_CALL createRegistryInfo_OColumnControl() { @@ -38,12 +39,19 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdbc; -OColumnControl::OColumnControl(const Reference<XMultiServiceFactory>& _rxFactory) - :UnoControl( _rxFactory ) +OColumnControl::OColumnControl(const Reference<XComponentContext>& rxContext) + :UnoControl(), m_xContext(rxContext) { } // ----------------------------------------------------------------------------- -IMPLEMENT_SERVICE_INFO2_STATIC(OColumnControl,SERVICE_CONTROLDEFAULT.ascii,"com.sun.star.awt.UnoControl","com.sun.star.sdb.ColumnDescriptorControl") +IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(OColumnControl, SERVICE_CONTROLDEFAULT.ascii) +IMPLEMENT_SERVICE_INFO_SUPPORTS(OColumnControl) +IMPLEMENT_SERVICE_INFO_GETSUPPORTED2_STATIC(OColumnControl, "com.sun.star.awt.UnoControl","com.sun.star.sdb.ColumnDescriptorControl") + +Reference< XInterface > SAL_CALL OColumnControl::Create(const Reference< XMultiServiceFactory >& _rxORB) +{ + return static_cast< XServiceInfo* >(new OColumnControl(comphelper::getComponentContext(_rxORB))); +} // ----------------------------------------------------------------------------- ::rtl::OUString OColumnControl::GetComponentServiceName() { @@ -65,7 +73,7 @@ void SAL_CALL OColumnControl::createPeer(const Reference< XToolkit >& /*rToolkit pParentWin = pParent->GetWindow(); } - OColumnPeer* pPeer = new OColumnPeer( pParentWin, maContext.getUNOContext() ); + OColumnPeer* pPeer = new OColumnPeer( pParentWin, m_xContext ); OSL_ENSURE(pPeer != NULL, "FmXGridControl::createPeer : imp_CreatePeer didn't return a peer !"); setPeer( pPeer ); diff --git a/dbaccess/source/ui/uno/ColumnControl.hxx b/dbaccess/source/ui/uno/ColumnControl.hxx index 374dd0a7e723..02db6c2c2614 100644 --- a/dbaccess/source/ui/uno/ColumnControl.hxx +++ b/dbaccess/source/ui/uno/ColumnControl.hxx @@ -26,8 +26,10 @@ namespace dbaui { class OColumnControl : public UnoControl { + private: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext; public: - OColumnControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + OColumnControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& rxContext); // UnoControl virtual ::rtl::OUString GetComponentServiceName(); |