summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-03-20 09:29:30 +0200
committerNoel Grandin <noel@peralex.com>2013-04-08 13:53:03 +0200
commit86fdce60115014ddfae05993ef43686c9dbd6004 (patch)
treed50705d5f93fec079e4d676cd2a5a9c50783c6f3 /dbaccess
parent34da7fbcc643ad209290c6da456dbfb17aeb9ac0 (diff)
fdo#46808, Convert svt::ToolboxController to XComponentContext
.. and all of it's friends Change-Id: I408d9308d1d1a4f8ed0055ac5f4042d729c44d1e
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/control/toolboxcontroller.cxx21
-rw-r--r--dbaccess/source/ui/inc/toolboxcontroller.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/limitboxcontroller.cxx15
-rw-r--r--dbaccess/source/ui/querydesign/limitboxcontroller.hxx2
4 files changed, 29 insertions, 11 deletions
diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx
index 0bbae366ef9f..57e3b0054ab8 100644
--- a/dbaccess/source/ui/control/toolboxcontroller.cxx
+++ b/dbaccess/source/ui/control/toolboxcontroller.cxx
@@ -68,16 +68,26 @@ namespace dbaui
}
}
- OToolboxController::OToolboxController(const Reference< XMultiServiceFactory >& _rxORB)
+ OToolboxController::OToolboxController(const Reference< XComponentContext >& _rxORB)
: m_nToolBoxId(1)
{
osl_atomic_increment(&m_refCount);
- m_xServiceManager = _rxORB;
+ m_xContext = _rxORB;
osl_atomic_decrement(&m_refCount);
}
// -----------------------------------------------------------------------------
- IMPLEMENT_SERVICE_INFO1_STATIC(OToolboxController,"com.sun.star.sdb.ApplicationToolboxController","com.sun.star.frame.ToolboxController")
+ IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(OToolboxController, "com.sun.star.sdb.ApplicationToolboxController")
+ IMPLEMENT_SERVICE_INFO_SUPPORTS(OToolboxController)
+ IMPLEMENT_SERVICE_INFO_GETSUPPORTED1_STATIC(OToolboxController, "com.sun.star.frame.ToolboxController")
+
+ Reference< XInterface >
+ SAL_CALL OToolboxController::Create(const Reference< XMultiServiceFactory >& _rxORB)
+ {
+ return static_cast< XServiceInfo* >(new OToolboxController( comphelper::getComponentContext(_rxORB) ));
+ }
+
+
// -----------------------------------------------------------------------------
// XInterface
Any SAL_CALL OToolboxController::queryInterface( const Type& _rType ) throw (RuntimeException)
@@ -186,11 +196,10 @@ namespace dbaui
try
{
- Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgMgrSupplier(ModuleUIConfigurationManagerSupplier::create(comphelper::getComponentContext(getServiceManager())));
- Reference<XUIConfigurationManager> xUIConfigMgr = xModuleCfgMgrSupplier->getUIConfigurationManager(OUString("com.sun.star.sdb.OfficeDatabaseDocument"));
+ Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgMgrSupplier = ModuleUIConfigurationManagerSupplier::create( getContext() );
+ Reference<XUIConfigurationManager> xUIConfigMgr = xModuleCfgMgrSupplier->getUIConfigurationManager( OUString("com.sun.star.sdb.OfficeDatabaseDocument") );
Reference<XImageManager> xImageMgr(xUIConfigMgr->getImageManager(),UNO_QUERY);
-
short nImageType = hasBigImages() ? ImageType::SIZE_LARGE : ImageType::SIZE_DEFAULT;
Sequence< OUString> aSeq(1);
diff --git a/dbaccess/source/ui/inc/toolboxcontroller.hxx b/dbaccess/source/ui/inc/toolboxcontroller.hxx
index c0673ad4d5fe..f360731da0c7 100644
--- a/dbaccess/source/ui/inc/toolboxcontroller.hxx
+++ b/dbaccess/source/ui/inc/toolboxcontroller.hxx
@@ -42,7 +42,7 @@ namespace dbaui
::std::auto_ptr<PopupMenu> getMenu();
public:
- OToolboxController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+ OToolboxController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB);
// XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
index 3804f864ed9f..04451593383a 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
@@ -16,6 +16,7 @@
#include <vcl/window.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <osl/mutex.hxx>
+#include <comphelper/processfactory.hxx>
#include "LimitBox.hxx"
#include "dbu_reghelper.hxx"
@@ -91,8 +92,8 @@ long LimitBoxImpl::Notify( NotifyEvent& rNEvt )
LimitBoxController::LimitBoxController(
- const uno::Reference< lang::XMultiServiceFactory >& rServiceManager ) :
- svt::ToolboxController( rServiceManager,
+ const uno::Reference< uno::XComponentContext >& rxContext ) :
+ svt::ToolboxController( rxContext,
uno::Reference< frame::XFrame >(),
OUString( ".uno:DBLimit" ) ),
m_pLimitBox( NULL )
@@ -126,7 +127,15 @@ void SAL_CALL LimitBoxController::release() throw ()
/// XServiceInfo
-IMPLEMENT_SERVICE_INFO1_STATIC(LimitBoxController,"org.libreoffice.comp.dbu.LimitBoxController","com.sun.star.frame.ToolboxController")
+IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(LimitBoxController, "org.libreoffice.comp.dbu.LimitBoxController")
+IMPLEMENT_SERVICE_INFO_SUPPORTS(LimitBoxController)
+IMPLEMENT_SERVICE_INFO_GETSUPPORTED1_STATIC(LimitBoxController, "com.sun.star.frame.ToolboxController")
+
+uno::Reference< uno::XInterface >
+ SAL_CALL LimitBoxController::Create(const uno::Reference< css::lang::XMultiServiceFactory >& _rxORB)
+{
+ return static_cast< XServiceInfo* >(new LimitBoxController( comphelper::getComponentContext(_rxORB) ));
+}
/// XComponent
void SAL_CALL LimitBoxController::dispose()
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
index 64bab94a870c..701b5070f8e3 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
@@ -31,7 +31,7 @@ class LimitBoxController: public svt::ToolboxController,
{
public:
LimitBoxController(
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
+ const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
~LimitBoxController();
/// XInterface