diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-26 14:58:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-04-23 16:05:55 +0200 |
commit | dbb4d4dd98c623c5c9309961ebb0548898b111e1 (patch) | |
tree | bfe8ebcabd010d3081235151fe6c3d5b08612bb7 /svx | |
parent | 6dd58cd811f888aa2158242f08bed5ce9e8fd340 (diff) |
fdo#46808, convert svx::FindTextFieldControl to XComponentContext
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/tbunosearchcontrollers.hxx | 7 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbunosearchcontrollers.cxx | 16 |
2 files changed, 10 insertions, 13 deletions
diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx index b15c2c5d0804..23eb22fd12b4 100644 --- a/svx/inc/tbunosearchcontrollers.hxx +++ b/svx/inc/tbunosearchcontrollers.hxx @@ -47,7 +47,7 @@ class FindTextFieldControl : public ComboBox public: FindTextFieldControl( Window* pParent, WinBits nStyle, css::uno::Reference< css::frame::XFrame >& xFrame, - const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~FindTextFieldControl(); virtual long PreNotify( NotifyEvent& rNEvt ); @@ -58,7 +58,7 @@ public: private: css::uno::Reference< css::frame::XFrame > m_xFrame; - css::uno::Reference< css::lang::XMultiServiceFactory > m_xServiceManager; + css::uno::Reference< css::uno::XComponentContext > m_xContext; }; class SearchToolbarControllersManager @@ -225,7 +225,7 @@ class FindbarDispatcher : public css::lang::XServiceInfo, { public: - FindbarDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + FindbarDispatcher(); virtual ~FindbarDispatcher(); // XInterface @@ -259,7 +259,6 @@ public: private: - css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; css::uno::Reference< css::frame::XFrame > m_xFrame; }; diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index cac328b34bbd..ad15872a8ec4 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -70,10 +70,10 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext FindTextFieldControl::FindTextFieldControl( Window* pParent, WinBits nStyle, css::uno::Reference< css::frame::XFrame >& xFrame, - const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager) : + const css::uno::Reference< css::uno::XComponentContext >& xContext) : ComboBox( pParent, nStyle ), m_xFrame(xFrame), - m_xServiceManager(xServiceManager) + m_xContext(xContext) { SetPlaceholderText(SVX_RESSTR(RID_SVXSTR_FINDBAR_FIND)); EnableAutocomplete(sal_True, sal_True); @@ -178,7 +178,7 @@ long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt ) lArgs[2].Name = OUString(SEARCHITEM_SEARCHFLAGS); lArgs[2].Value <<= (sal_Int32)0; - impl_executeSearch( comphelper::getComponentContext(m_xServiceManager), m_xFrame, lArgs); + impl_executeSearch( m_xContext, m_xFrame, lArgs); nRet = 1; } break; @@ -420,7 +420,7 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::cre if ( pParent ) { ToolBox* pToolbar = ( ToolBox* )pParent; - m_pFindTextFieldControl = new FindTextFieldControl( pToolbar, WinBits( WB_DROPDOWN | WB_VSCROLL), m_xFrame, css::uno::Reference<css::lang::XMultiServiceFactory>(m_xContext->getServiceManager(), css::uno::UNO_QUERY_THROW) ); + m_pFindTextFieldControl = new FindTextFieldControl( pToolbar, WinBits( WB_DROPDOWN | WB_VSCROLL), m_xFrame, m_xContext ); Size aSize(250, m_pFindTextFieldControl->GetTextHeight() + 200); m_pFindTextFieldControl->SetSizePixel( aSize ); @@ -720,14 +720,12 @@ void SAL_CALL ExitSearchToolboxController::statusChanged( const css::frame::Feat //----------------------------------------------------------------------------------------------------------- // class FindbarDispatcher -FindbarDispatcher::FindbarDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory) - : m_xFactory( xFactory ) +FindbarDispatcher::FindbarDispatcher() { } FindbarDispatcher::~FindbarDispatcher() { - m_xFactory = NULL; m_xFrame = NULL; } @@ -907,9 +905,9 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL ExitFindbarToolboxControlle } css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) + const css::uno::Reference< css::lang::XMultiServiceFactory >& ) { - return static_cast< cppu::OWeakObject * >( new FindbarDispatcher( rSMgr ) ); + return static_cast< cppu::OWeakObject * >( new FindbarDispatcher ); } //----------------------------------------------------------------------------------------------------------- |