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 /forms | |
parent | fdo#46808, use service constructor for i18n::Collator (diff) | |
download | core-46fe5e5e06dba9a450f9339b0bf662547a6966e4.tar.gz core-46fe5e5e06dba9a450f9339b0bf662547a6966e4.zip |
fdo#46808, convert UnoControl and sub-classes to XComponentContext
Change-Id: I4ade267a44620f5a3af8009ac57a2456c62b83bc
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/Filter.cxx | 19 | ||||
-rw-r--r-- | forms/source/component/Filter.hxx | 5 | ||||
-rw-r--r-- | forms/source/richtext/richtextcontrol.cxx | 8 | ||||
-rw-r--r-- | forms/source/richtext/richtextcontrol.hxx | 4 | ||||
-rw-r--r-- | forms/source/solar/component/navbarcontrol.cxx | 8 | ||||
-rw-r--r-- | forms/source/solar/component/navbarcontrol.hxx | 3 |
6 files changed, 23 insertions, 24 deletions
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index b8a1d1f14f9e..8a64e8bd1903 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -92,10 +92,11 @@ namespace frm // OFilterControl //===================================================================== //--------------------------------------------------------------------- - OFilterControl::OFilterControl( const Reference< XMultiServiceFactory >& _rxORB ) - :UnoControl( _rxORB ) + OFilterControl::OFilterControl( const Reference< XComponentContext >& _rxORB ) + :UnoControl() ,m_aTextListeners( *this ) - ,m_aParser( comphelper::getComponentContext(_rxORB) ) + ,m_xContext( _rxORB ) + ,m_aParser( _rxORB ) ,m_nControlClass( FormComponentType::TEXTFIELD ) ,m_bFilterList( sal_False ) ,m_bMultiLine( sal_False ) @@ -122,11 +123,11 @@ namespace frm { // we can create one from the connection, if it's an SDB connection - Reference< XNumberFormatsSupplier > xFormatSupplier = ::dbtools::getNumberFormats( m_xConnection, sal_True, maContext.getUNOContext() ); + Reference< XNumberFormatsSupplier > xFormatSupplier = ::dbtools::getNumberFormats( m_xConnection, sal_True, m_xContext ); if ( xFormatSupplier.is() ) { - m_xFormatter.set(NumberFormatter::create(maContext.getUNOContext()), UNO_QUERY_THROW ); + m_xFormatter.set(NumberFormatter::create(m_xContext), UNO_QUERY_THROW ); m_xFormatter->attachNumberFormatsSupplier( xFormatSupplier ); } } @@ -342,7 +343,7 @@ namespace frm sItemText = itemPos->second; if ( !sItemText.isEmpty() ) { - ::dbtools::OPredicateInputController aPredicateInput( maContext.getUNOContext(), m_xConnection, getParseContext() ); + ::dbtools::OPredicateInputController aPredicateInput( m_xContext, m_xConnection, getParseContext() ); ::rtl::OUString sErrorMessage; OSL_VERIFY( aPredicateInput.normalizePredicateString( sItemText, m_xField, &sErrorMessage ) ); } @@ -527,7 +528,7 @@ namespace frm aNewText = aNewText.trim(); if ( !aNewText.isEmpty() ) { - ::dbtools::OPredicateInputController aPredicateInput( maContext.getUNOContext(), m_xConnection, getParseContext() ); + ::dbtools::OPredicateInputController aPredicateInput( m_xContext, m_xConnection, getParseContext() ); ::rtl::OUString sErrorMessage; if ( !aPredicateInput.normalizePredicateString( aNewText, m_xField, &sErrorMessage ) ) { @@ -743,7 +744,7 @@ namespace frm { try { - Reference< XExecutableDialog > xErrorDialog = ErrorMessageDialog::create( maContext.getUNOContext(), "", m_xMessageParent, makeAny(_rExcept)); + Reference< XExecutableDialog > xErrorDialog = ErrorMessageDialog::create( m_xContext, "", m_xMessageParent, makeAny(_rExcept)); xErrorDialog->execute(); } catch( const Exception& ) @@ -897,7 +898,7 @@ namespace frm //--------------------------------------------------------------------- Reference< XInterface > SAL_CALL OFilterControl::Create( const Reference< XMultiServiceFactory >& _rxFactory ) { - return static_cast< XServiceInfo* >( new OFilterControl( _rxFactory ) ); + return static_cast< XServiceInfo* >( new OFilterControl( comphelper::getComponentContext(_rxFactory) ) ); } //......................................................................... diff --git a/forms/source/component/Filter.hxx b/forms/source/component/Filter.hxx index 1c13c10b4894..438776445a3c 100644 --- a/forms/source/component/Filter.hxx +++ b/forms/source/component/Filter.hxx @@ -60,6 +60,7 @@ namespace frm { TextListenerMultiplexer m_aTextListeners; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xField; ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; @@ -77,12 +78,10 @@ namespace frm sal_Bool m_bFilterListFilled : 1; private: -// OFilterControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); - void implInitFilterList(); public: - OFilterControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB ); + OFilterControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB ); DECLARE_UNO3_AGG_DEFAULTS(OFilterControl,OWeakAggObject); ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 288dc5a93686..730d793fb3b2 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -94,8 +94,8 @@ namespace frm //================================================================== DBG_NAME( ORichTextControl ) //------------------------------------------------------------------ - ORichTextControl::ORichTextControl( const Reference< XMultiServiceFactory >& _rxORB ) - :UnoEditControl( _rxORB ) + ORichTextControl::ORichTextControl() + :UnoEditControl() { DBG_CTOR( ORichTextControl, NULL ); } @@ -294,9 +294,9 @@ namespace frm } //------------------------------------------------------------------ - Reference< XInterface > SAL_CALL ORichTextControl::Create( const Reference< XMultiServiceFactory >& _rxFactory ) + Reference< XInterface > SAL_CALL ORichTextControl::Create( const Reference< XMultiServiceFactory >& ) { - return *( new ORichTextControl( _rxFactory ) ); + return *( new ORichTextControl() ); } //-------------------------------------------------------------------- diff --git a/forms/source/richtext/richtextcontrol.hxx b/forms/source/richtext/richtextcontrol.hxx index 4260335d5aca..365a85f7a27c 100644 --- a/forms/source/richtext/richtextcontrol.hxx +++ b/forms/source/richtext/richtextcontrol.hxx @@ -49,9 +49,7 @@ namespace frm ,public ORichTextControl_Base { public: - ORichTextControl( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB - ); + ORichTextControl(); protected: ~ORichTextControl(); diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx index 092f885c0002..6f86eee71d4b 100644 --- a/forms/source/solar/component/navbarcontrol.cxx +++ b/forms/source/solar/component/navbarcontrol.cxx @@ -94,8 +94,8 @@ namespace frm //================================================================== DBG_NAME( ONavigationBarControl ) //------------------------------------------------------------------ - ONavigationBarControl::ONavigationBarControl( const Reference< XMultiServiceFactory >& _rxORB ) - :UnoControl( _rxORB ) + ONavigationBarControl::ONavigationBarControl( const Reference< XComponentContext >& _rxORB) + :UnoControl(), m_xContext(_rxORB) { DBG_CTOR( ONavigationBarControl, NULL ); } @@ -170,7 +170,7 @@ namespace frm } // create the peer - ONavigationBarPeer* pPeer = ONavigationBarPeer::Create( maContext.getLegacyServiceFactory(), pParentWin, getModel() ); + ONavigationBarPeer* pPeer = ONavigationBarPeer::Create( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), pParentWin, getModel() ); DBG_ASSERT( pPeer, "ONavigationBarControl::createPeer: invalid peer returned!" ); if ( pPeer ) // by definition, the returned component is aquired once @@ -234,7 +234,7 @@ namespace frm //------------------------------------------------------------------ Reference< XInterface > SAL_CALL ONavigationBarControl::Create( const Reference< XMultiServiceFactory >& _rxFactory ) { - return *( new ONavigationBarControl( _rxFactory ) ); + return *( new ONavigationBarControl( comphelper::getComponentContext(_rxFactory) ) ); } //------------------------------------------------------------------ diff --git a/forms/source/solar/component/navbarcontrol.hxx b/forms/source/solar/component/navbarcontrol.hxx index 4188b3dcd4bf..78af8e4d7019 100644 --- a/forms/source/solar/component/navbarcontrol.hxx +++ b/forms/source/solar/component/navbarcontrol.hxx @@ -46,9 +46,10 @@ namespace frm :public UnoControl ,public ONavigationBarControl_Base { + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; public: ONavigationBarControl( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB ); protected: |