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 /toolkit | |
parent | 0b6a0657491fdd126541018ac32810f80698ebd0 (diff) |
fdo#46808, convert UnoControl and sub-classes to XComponentContext
Change-Id: I4ade267a44620f5a3af8009ac57a2456c62b83bc
Diffstat (limited to 'toolkit')
43 files changed, 352 insertions, 383 deletions
diff --git a/toolkit/inc/toolkit/controls/animatedimages.hxx b/toolkit/inc/toolkit/controls/animatedimages.hxx index 6faa70111257..1ae4718ab3e5 100644 --- a/toolkit/inc/toolkit/controls/animatedimages.hxx +++ b/toolkit/inc/toolkit/controls/animatedimages.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/awt/XAnimation.hpp> #include <com/sun/star/awt/XAnimatedImages.hpp> #include <com/sun/star/container/XContainerListener.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx> @@ -48,7 +49,7 @@ namespace toolkit class AnimatedImagesControl : public AnimatedImagesControl_Base { public: - AnimatedImagesControl( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory ); + AnimatedImagesControl(); ::rtl::OUString GetComponentServiceName(); // XAnimation @@ -84,7 +85,7 @@ namespace toolkit class AnimatedImagesControlModel : public AnimatedImagesControlModel_Base { public: - AnimatedImagesControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory ); + AnimatedImagesControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_factory ); AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource ); virtual UnoControlModel* Clone() const; diff --git a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx index 3a7e5987c15b..84063b71245c 100644 --- a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx +++ b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx @@ -99,7 +99,7 @@ protected: void updateUserFormChildren( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xAllChildren, const rtl::OUString& aName, ChildOperation Operation, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xTarget ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); public: - ControlModelContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + ControlModelContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ControlModelContainerBase( const ControlModelContainerBase& rModel ); ~ControlModelContainerBase(); @@ -218,6 +218,7 @@ class ControlContainerBase : public ContainerControl_IBase { ::Size ImplGetSizePixel( const ::Size& inSize ); protected: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; bool mbSizeModified; bool mbPosModified; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController; @@ -229,10 +230,13 @@ protected: void ImplUpdateResourceResolver(); void ImplStartListingForResourceEvents(); +#ifdef _MSC_VER + // just implemented to let the various FooImplInheritanceHelper compile ControlContainerBase(); +#endif public: - ControlContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + ControlContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~ControlContainerBase(); DECLIMPL_SERVICEINFO_DERIVED( ControlContainerBase, UnoControlBase, "toolkit.ControlContainerBase" ) diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx index bd01be35e68d..b9861b50dbf6 100644 --- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx +++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx @@ -46,7 +46,7 @@ protected: // ::cppu::OPropertySetHelper void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); public: - UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlDialogModel( const UnoControlDialogModel& rModel ); ~UnoControlDialogModel(); @@ -76,7 +76,7 @@ private: public: - UnoDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~UnoDialogControl(); ::rtl::OUString GetComponentServiceName(); @@ -125,7 +125,7 @@ protected: class UnoMultiPageModel : public ControlModelContainerBase { public: - UnoMultiPageModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoMultiPageModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~UnoMultiPageModel(); UnoMultiPageModel( const UnoMultiPageModel& rModel ); @@ -153,7 +153,7 @@ class UnoMultiPageControl : public ControlContainerBase TabListenerMultiplexer maTabListeners; void bindPage( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); public: - UnoMultiPageControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoMultiPageControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~UnoMultiPageControl(); ::rtl::OUString GetComponentServiceName(); @@ -200,7 +200,7 @@ protected: class UnoPageModel : public ControlModelContainerBase { public: - UnoPageModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoPageModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~UnoPageModel(); UnoPageModel( const UnoPageModel& rModel ); @@ -222,7 +222,7 @@ protected: class UnoPageControl : public ControlContainerBase { public: - UnoPageControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoPageControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~UnoPageControl(); ::rtl::OUString GetComponentServiceName(); @@ -234,7 +234,7 @@ public: class UnoFrameModel : public ControlModelContainerBase { public: - UnoFrameModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoFrameModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~UnoFrameModel(); UnoFrameModel( const UnoFrameModel& rModel ); @@ -255,7 +255,7 @@ class UnoFrameControl : public ControlContainerBase protected: virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl ); public: - UnoFrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoFrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~UnoFrameControl(); ::rtl::OUString GetComponentServiceName(); diff --git a/toolkit/inc/toolkit/controls/formattedcontrol.hxx b/toolkit/inc/toolkit/controls/formattedcontrol.hxx index fec447ebab18..53a6230b0f87 100644 --- a/toolkit/inc/toolkit/controls/formattedcontrol.hxx +++ b/toolkit/inc/toolkit/controls/formattedcontrol.hxx @@ -59,7 +59,7 @@ namespace toolkit ) throw (::com::sun::star::uno::Exception); public: - UnoControlFormattedFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlFormattedFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel ) :UnoControlModel( rModel ) { @@ -105,7 +105,7 @@ namespace toolkit class UnoFormattedFieldControl : public UnoSpinFieldControl { public: - UnoFormattedFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoFormattedFieldControl(); ::rtl::OUString GetComponentServiceName(); // ::com::sun::star::awt::XTextListener diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx index 206bdc08da3b..94701773d42b 100644 --- a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx +++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx @@ -183,7 +183,7 @@ namespace com { namespace sun { namespace star { ,public ::comphelper::OAggregationArrayUsageHelper< OTemplateInstanceDisambiguation< CONTROLMODEL > > { public: - OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); private: OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance); diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx index 285aa73174b0..658c7410c910 100644 --- a/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx +++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx @@ -24,7 +24,7 @@ //==================================================================== //-------------------------------------------------------------------- template <class CONTROLMODEL> -OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) +OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ) :OGeometryControlModel_Base(new CONTROLMODEL( i_factory ) ) { } @@ -79,5 +79,4 @@ OGeometryControlModel_Base* OGeometryControlModel<CONTROLMODEL>::createClone_Imp return new OGeometryControlModel<CONTROLMODEL>(_rxAggregateInstance); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx index abafbae00956..ca55be0c256a 100644 --- a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx +++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx @@ -102,7 +102,7 @@ namespace toolkit ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlRoadmapModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlRoadmapModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoControlRoadmapModel( const UnoControlRoadmapModel& rModel ) : UnoControlRoadmapModel_Base( rModel ), UnoControlRoadmapModel_IBase( rModel ), @@ -159,7 +159,7 @@ namespace toolkit private: ItemListenerMultiplexer maItemListeners; public: - UnoRoadmapControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoRoadmapControl(); ::rtl::OUString GetComponentServiceName(); void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } diff --git a/toolkit/inc/toolkit/controls/spinningprogress.hxx b/toolkit/inc/toolkit/controls/spinningprogress.hxx index e9914883bb39..7db479852406 100644 --- a/toolkit/inc/toolkit/controls/spinningprogress.hxx +++ b/toolkit/inc/toolkit/controls/spinningprogress.hxx @@ -34,7 +34,7 @@ namespace toolkit class SpinningProgressControlModel : public SpinningProgressControlModel_Base { public: - SpinningProgressControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory ); + SpinningProgressControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_factory ); SpinningProgressControlModel( const SpinningProgressControlModel& i_copySource ); virtual UnoControlModel* Clone() const; diff --git a/toolkit/inc/toolkit/controls/tabpagecontainer.hxx b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx index a713d3efedb8..6664182e0148 100644 --- a/toolkit/inc/toolkit/controls/tabpagecontainer.hxx +++ b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx @@ -58,7 +58,7 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); public: - UnoControlTabPageContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlTabPageContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoControlTabPageContainerModel( const UnoControlTabPageContainerModel& rModel ) : UnoControlTabPageContainerModel_Base( rModel ),maContainerListeners( *this ) {;} UnoControlModel* Clone() const { return new UnoControlTabPageContainerModel( *this ); } @@ -106,7 +106,7 @@ typedef ::cppu::AggImplInheritanceHelper1 < ControlContainerBase class UnoControlTabPageContainer : public UnoControlTabPageContainer_Base { public: - UnoControlTabPageContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlTabPageContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ::rtl::OUString GetComponentServiceName(); // ::com::sun::star::lang::XComponent diff --git a/toolkit/inc/toolkit/controls/tabpagemodel.hxx b/toolkit/inc/toolkit/controls/tabpagemodel.hxx index 045f0c9ce4db..73cd566e3985 100644 --- a/toolkit/inc/toolkit/controls/tabpagemodel.hxx +++ b/toolkit/inc/toolkit/controls/tabpagemodel.hxx @@ -38,7 +38,7 @@ protected: ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlTabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory); + UnoControlTabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_factory); // ::com::sun::star::io::XPersistObject ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); @@ -67,7 +67,7 @@ private: bool m_bWindowListener; public: - UnoControlTabPage( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlTabPage( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~UnoControlTabPage(); ::rtl::OUString GetComponentServiceName(); diff --git a/toolkit/inc/toolkit/controls/tkscrollbar.hxx b/toolkit/inc/toolkit/controls/tkscrollbar.hxx index 5bc5b2cee3fb..3ed68ff86af1 100644 --- a/toolkit/inc/toolkit/controls/tkscrollbar.hxx +++ b/toolkit/inc/toolkit/controls/tkscrollbar.hxx @@ -42,7 +42,7 @@ namespace toolkit ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlScrollBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlScrollBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoControlScrollBarModel( const UnoControlScrollBarModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlScrollBarModel( *this ); } @@ -68,7 +68,7 @@ namespace toolkit AdjustmentListenerMultiplexer maAdjustmentListeners; public: - UnoScrollBarControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoScrollBarControl(); ::rtl::OUString GetComponentServiceName(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } diff --git a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx index 95b847cc6850..368922e780ca 100644 --- a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx +++ b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx @@ -43,7 +43,7 @@ namespace toolkit ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoSimpleAnimationControlModel( const UnoSimpleAnimationControlModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoSimpleAnimationControlModel( *this ); } @@ -72,7 +72,7 @@ namespace toolkit private: public: - UnoSimpleAnimationControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoSimpleAnimationControl(); ::rtl::OUString GetComponentServiceName(); // XSimpleAnimation diff --git a/toolkit/inc/toolkit/controls/tkspinbutton.hxx b/toolkit/inc/toolkit/controls/tkspinbutton.hxx index 5b418e78b5d0..44da1f76fd4a 100644 --- a/toolkit/inc/toolkit/controls/tkspinbutton.hxx +++ b/toolkit/inc/toolkit/controls/tkspinbutton.hxx @@ -43,7 +43,7 @@ namespace toolkit ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoSpinButtonModel( const UnoSpinButtonModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoSpinButtonModel( *this ); } @@ -74,7 +74,7 @@ namespace toolkit AdjustmentListenerMultiplexer maAdjustmentListeners; public: - UnoSpinButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoSpinButtonControl(); ::rtl::OUString GetComponentServiceName(); DECLARE_UNO3_AGG_DEFAULTS( UnoSpinButtonControl, UnoControlBase ); diff --git a/toolkit/inc/toolkit/controls/tkthrobber.hxx b/toolkit/inc/toolkit/controls/tkthrobber.hxx index 511361028de4..379e3b459674 100644 --- a/toolkit/inc/toolkit/controls/tkthrobber.hxx +++ b/toolkit/inc/toolkit/controls/tkthrobber.hxx @@ -43,7 +43,7 @@ namespace toolkit ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoThrobberControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoThrobberControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoThrobberControlModel( const UnoThrobberControlModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoThrobberControlModel( *this ); } @@ -72,7 +72,7 @@ namespace toolkit private: public: - UnoThrobberControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoThrobberControl(); ::rtl::OUString GetComponentServiceName(); DECLARE_UNO3_AGG_DEFAULTS( UnoThrobberControl, UnoControlBase ); diff --git a/toolkit/inc/toolkit/controls/unocontrol.hxx b/toolkit/inc/toolkit/controls/unocontrol.hxx index a2470f6d86d2..fae1c005853b 100644 --- a/toolkit/inc/toolkit/controls/unocontrol.hxx +++ b/toolkit/inc/toolkit/controls/unocontrol.hxx @@ -86,7 +86,6 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer > mxVclWindowPeer; // just to avoid the query_interface thing protected: - const ::comphelper::ComponentContext maContext; EventListenerMultiplexer maDisposeListeners; WindowListenerMultiplexer maWindowListeners; FocusListenerMultiplexer maFocusListeners; @@ -136,11 +135,8 @@ protected: virtual sal_Bool requiresNewPeer( const ::rtl::OUString& _rPropertyName ) const; -protected: - UnoControl(); - public: - UnoControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControl(); ~UnoControl(); UnoControlComponentInfos& GetComponentInfos() { return maComponentInfos; } diff --git a/toolkit/inc/toolkit/controls/unocontrolbase.hxx b/toolkit/inc/toolkit/controls/unocontrolbase.hxx index 1b4564802e39..bf539ed7384b 100644 --- a/toolkit/inc/toolkit/controls/unocontrolbase.hxx +++ b/toolkit/inc/toolkit/controls/unocontrolbase.hxx @@ -31,15 +31,7 @@ class TOOLKIT_DLLPUBLIC UnoControlBase : public UnoControl { protected: - UnoControlBase() //do not use! needed by MSVC at compile time to satisfy AggImplInheritanceHelper5 - { - assert(false); - } -protected: - UnoControlBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) - :UnoControl( i_factory ) - { - } + UnoControlBase() :UnoControl() {} sal_Bool ImplHasProperty( sal_uInt16 nProp ); sal_Bool ImplHasProperty( const ::rtl::OUString& aPropertyName ); diff --git a/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx b/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx index e8763ca8894a..ac621817f75c 100644 --- a/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx +++ b/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx @@ -56,9 +56,8 @@ protected: void ImplActivateTabControllers(); public: - UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); - UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory, - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xPeer ); + UnoControlContainer(); + UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xPeer ); ~UnoControlContainer(); diff --git a/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx b/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx index f15a0490b483..b8f8bd222c0f 100644 --- a/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx +++ b/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx @@ -37,7 +37,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoControlContainerModel( const UnoControlContainerModel& rModel ) : UnoControlModel( rModel ) {} UnoControlModel* Clone() const { return new UnoControlContainerModel( *this ); } diff --git a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx index 416b7281ec88..19777a99d515 100644 --- a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx +++ b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx @@ -67,7 +67,7 @@ private: EventListenerMultiplexer maDisposeListeners; protected: - const ::comphelper::ComponentContext maContext; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; protected: void ImplRegisterProperty( sal_uInt16 nPropType ); @@ -100,18 +100,20 @@ protected: ) const; protected: +#ifdef _MSC_VER UnoControlModel() //do not use! needed by MSVC at compile time to satisfy WeakAggImplHelper7 : UnoControlModel_Base() , MutexAndBroadcastHelper() , OPropertySetHelper( BrdcstHelper ) , maDisposeListeners( *this ) - , maContext( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() ) + , maContext( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() ) { assert(false); } +#endif public: - UnoControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlModel( const UnoControlModel& rModel ); virtual UnoControlModel* Clone() const = 0; diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index cb5256f27ea1..08eb00cedeb9 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -86,7 +86,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlEditModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlEditModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlEditModel( const UnoControlEditModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlEditModel( *this ); } @@ -128,7 +128,7 @@ private: public: - UnoEditControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoEditControl(); ::rtl::OUString GetComponentServiceName(); TextListenerMultiplexer& GetTextListeners() { return maTextListeners; } @@ -190,7 +190,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlFileControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlFileControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlFileControlModel( const UnoControlFileControlModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlFileControlModel( *this ); } @@ -211,7 +211,7 @@ public: class UnoFileControl : public UnoEditControl { public: - UnoFileControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoFileControl(); ::rtl::OUString GetComponentServiceName(); // ::com::sun::star::lang::XServiceInfo @@ -230,8 +230,8 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj; protected: - GraphicControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) + GraphicControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) ,mbAdjustingImagePosition( false ) ,mbAdjustingGraphic( false ) { @@ -258,7 +258,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlButtonModel( *this ); } @@ -291,7 +291,7 @@ private: public: - UnoButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoButtonControl(); ::rtl::OUString GetComponentServiceName(); void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); @@ -336,7 +336,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlImageControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlImageControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { } UnoControlModel* Clone() const { return new UnoControlImageControlModel( *this ); } @@ -368,7 +368,7 @@ private: public: - UnoImageControlControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoImageControlControl(); ::rtl::OUString GetComponentServiceName(); void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); @@ -396,7 +396,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlRadioButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlRadioButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlRadioButtonModel( *this ); } @@ -430,7 +430,7 @@ private: public: - UnoRadioButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoRadioButtonControl(); ::rtl::OUString GetComponentServiceName(); void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); @@ -475,7 +475,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlCheckBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlCheckBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlCheckBoxModel( *this ); } @@ -508,7 +508,7 @@ private: public: - UnoCheckBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoCheckBoxControl(); ~UnoCheckBoxControl(){;} ::rtl::OUString GetComponentServiceName(); @@ -556,7 +556,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlFixedHyperlinkModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlFixedHyperlinkModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlFixedHyperlinkModel( *this ); } @@ -582,7 +582,7 @@ private: ActionListenerMultiplexer maActionListeners; public: - UnoFixedHyperlinkControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoFixedHyperlinkControl(); ::rtl::OUString GetComponentServiceName(); @@ -630,7 +630,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlFixedTextModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlFixedTextModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlFixedTextModel( const UnoControlFixedTextModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlFixedTextModel( *this ); } @@ -654,7 +654,7 @@ class UnoFixedTextControl : public UnoControlBase, public ::com::sun::star::awt::XLayoutConstrains { public: - UnoFixedTextControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoFixedTextControl(); ::rtl::OUString GetComponentServiceName(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } @@ -695,7 +695,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlGroupBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlGroupBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlGroupBoxModel( const UnoControlGroupBoxModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlGroupBoxModel( *this ); } @@ -717,7 +717,7 @@ public: class UnoGroupBoxControl : public UnoControlBase { public: - UnoGroupBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoGroupBoxControl(); ::rtl::OUString GetComponentServiceName(); sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); @@ -745,7 +745,7 @@ protected: public: UnoControlListBoxModel( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, ConstructorMode const i_mode = ConstructDefault ); UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); @@ -844,7 +844,7 @@ typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base { public: - UnoListBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoListBoxControl(); ::rtl::OUString GetComponentServiceName(); void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); @@ -921,7 +921,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlComboBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlComboBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlComboBoxModel( *this ); } @@ -954,7 +954,7 @@ private: public: - UnoComboBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoComboBoxControl(); ::rtl::OUString GetComponentServiceName(); void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); @@ -1020,7 +1020,7 @@ private: sal_Bool mbRepeat; public: - UnoSpinFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoSpinFieldControl(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); } ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); @@ -1058,7 +1058,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlDateFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlDateFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlDateFieldModel( const UnoControlDateFieldModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlDateFieldModel( *this ); } @@ -1085,7 +1085,7 @@ private: sal_Int32 mnLast; sal_Bool mbLongFormat; public: - UnoDateFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoDateFieldControl(); ::rtl::OUString GetComponentServiceName(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } @@ -1134,7 +1134,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlTimeFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlTimeFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlTimeFieldModel( const UnoControlTimeFieldModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlTimeFieldModel( *this ); } @@ -1161,7 +1161,7 @@ private: sal_Int32 mnLast; public: - UnoTimeFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoTimeFieldControl(); ::rtl::OUString GetComponentServiceName(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } @@ -1209,7 +1209,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlNumericFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlNumericFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlNumericFieldModel( const UnoControlNumericFieldModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlNumericFieldModel( *this ); } @@ -1236,7 +1236,7 @@ private: double mnLast; public: - UnoNumericFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoNumericFieldControl(); ::rtl::OUString GetComponentServiceName(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } @@ -1286,7 +1286,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlCurrencyFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlCurrencyFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlCurrencyFieldModel( *this ); } @@ -1313,7 +1313,7 @@ private: double mnLast; public: - UnoCurrencyFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoCurrencyFieldControl(); ::rtl::OUString GetComponentServiceName(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } @@ -1362,7 +1362,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlPatternFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlPatternFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlPatternFieldModel( const UnoControlPatternFieldModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlPatternFieldModel( *this ); } @@ -1388,7 +1388,7 @@ protected: void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); public: - UnoPatternFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoPatternFieldControl(); ::rtl::OUString GetComponentServiceName(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } @@ -1423,7 +1423,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlProgressBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlProgressBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlProgressBarModel( const UnoControlProgressBarModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlProgressBarModel( *this ); } @@ -1445,7 +1445,7 @@ class UnoProgressBarControl : public UnoControlBase, public ::com::sun::star::awt::XProgressBar { public: - UnoProgressBarControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoProgressBarControl(); ::rtl::OUString GetComponentServiceName(); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } @@ -1479,7 +1479,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoControlFixedLineModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoControlFixedLineModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlFixedLineModel( const UnoControlFixedLineModel& rModel ) : UnoControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlFixedLineModel( *this ); } @@ -1501,7 +1501,7 @@ public: class UnoFixedLineControl : public UnoControlBase { public: - UnoFixedLineControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoFixedLineControl(); ::rtl::OUString GetComponentServiceName(); sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/controls/animatedimages.cxx b/toolkit/source/controls/animatedimages.cxx index cbab23368ca3..18231f487283 100644 --- a/toolkit/source/controls/animatedimages.cxx +++ b/toolkit/source/controls/animatedimages.cxx @@ -66,8 +66,8 @@ namespace toolkit //= AnimatedImagesControl //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - AnimatedImagesControl::AnimatedImagesControl( Reference< XMultiServiceFactory > const & i_factory ) - :AnimatedImagesControl_Base( i_factory ) + AnimatedImagesControl::AnimatedImagesControl() + :AnimatedImagesControl_Base() { } @@ -229,7 +229,7 @@ namespace toolkit //= AnimatedImagesControlModel //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - AnimatedImagesControlModel::AnimatedImagesControlModel( Reference< XMultiServiceFactory > const & i_factory ) + AnimatedImagesControlModel::AnimatedImagesControlModel( Reference< com::sun::star::uno::XComponentContext > const & i_factory ) :AnimatedImagesControlModel_Base( i_factory ) ,m_pData( new AnimatedImagesControlModel_Data ) { diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index cfa436e5c58b..2a9cbf866350 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -212,8 +212,8 @@ static const ::rtl::OUString& getStepPropertyName( ) // ---------------------------------------------------- // class ControlModelContainerBase // ---------------------------------------------------- -ControlModelContainerBase::ControlModelContainerBase( const Reference< XMultiServiceFactory >& i_factory ) - :ControlModelContainer_IBase( i_factory ) +ControlModelContainerBase::ControlModelContainerBase( const Reference< XComponentContext >& rxContext ) + :ControlModelContainer_IBase( rxContext ) ,maContainerListeners( *this ) ,maChangeListeners ( GetMutex() ) ,mbGroupsUpToDate( sal_False ) @@ -332,83 +332,79 @@ Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl:: OGeometryControlModel_Base* pNewModel = NULL; - const Reference< XMultiServiceFactory > xFactory( maContext.getLegacyServiceFactory() ); if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlEditModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlEditModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlEditModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFormattedFieldModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlFormattedFieldModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlFormattedFieldModel >( m_xContext); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFileControlModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlFileControlModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlFileControlModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlButtonModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlButtonModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlButtonModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlImageControlModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlImageControlModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlImageControlModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRadioButtonModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlRadioButtonModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlRadioButtonModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCheckBoxModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlCheckBoxModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlCheckBoxModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedHyperlinkModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlFixedHyperlinkModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlFixedHyperlinkModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedTextModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlFixedTextModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlFixedTextModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlGroupBoxModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlGroupBoxModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlGroupBoxModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlListBoxModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlListBoxModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlListBoxModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlComboBoxModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlComboBoxModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlComboBoxModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlDateFieldModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlDateFieldModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlDateFieldModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlTimeFieldModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlTimeFieldModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlTimeFieldModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlNumericFieldModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlNumericFieldModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlNumericFieldModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCurrencyFieldModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlCurrencyFieldModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlCurrencyFieldModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlPatternFieldModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlPatternFieldModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlPatternFieldModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlProgressBarModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlProgressBarModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlProgressBarModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlScrollBarModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlScrollBarModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlScrollBarModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFixedLineModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlFixedLineModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlFixedLineModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRoadmapModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_TreeControlModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoTreeModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoTreeModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_GridControlModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoGridModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoGridModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlTabPageContainerModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoMultiPageModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoMultiPageModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoMultiPageModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlTabPageModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoControlTabPageModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoControlTabPageModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoPageModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoPageModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoPageModel >( m_xContext ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoFrameModel ) == 0 ) - pNewModel = new OGeometryControlModel< UnoFrameModel >( xFactory ); + pNewModel = new OGeometryControlModel< UnoFrameModel >( m_xContext ); if ( !pNewModel ) { - if ( xFactory.is() ) + Reference< XInterface > xObject = m_xContext->getServiceManager()->createInstanceWithContext(aServiceSpecifier, m_xContext); + Reference< XServiceInfo > xSI( xObject, UNO_QUERY ); + Reference< XCloneable > xCloneAccess( xSI, UNO_QUERY ); + Reference< XAggregation > xAgg( xCloneAccess, UNO_QUERY ); + if ( xAgg.is() ) { - Reference< XInterface > xObject = xFactory->createInstance( aServiceSpecifier ); - Reference< XServiceInfo > xSI( xObject, UNO_QUERY ); - Reference< XCloneable > xCloneAccess( xSI, UNO_QUERY ); - Reference< XAggregation > xAgg( xCloneAccess, UNO_QUERY ); - if ( xAgg.is() ) + if ( xSI->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlModel"))) ) { - if ( xSI->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlModel"))) ) - { - // release 3 of the 4 references we have to the object - xAgg.clear(); - xSI.clear(); - xObject.clear(); + // release 3 of the 4 references we have to the object + xAgg.clear(); + xSI.clear(); + xObject.clear(); - pNewModel = new OCommonGeometryControlModel( xCloneAccess, aServiceSpecifier ); - } + pNewModel = new OCommonGeometryControlModel( xCloneAccess, aServiceSpecifier ); } } } @@ -1358,8 +1354,9 @@ throw ( RuntimeException ) // ---------------------------------------------------- // class DialogContainerControl // ---------------------------------------------------- -ControlContainerBase::ControlContainerBase( const Reference< XMultiServiceFactory >& i_factory ) - :ContainerControl_IBase( i_factory ) +ControlContainerBase::ControlContainerBase( const Reference< XComponentContext >& rxContext ) + :ContainerControl_IBase() + ,m_xContext(rxContext) ,mbSizeModified(false) ,mbPosModified(false) { @@ -1385,8 +1382,7 @@ void ControlContainerBase::ImplInsertControl( Reference< XControlModel >& rxMode ::rtl::OUString aDefCtrl; xP->getPropertyValue( GetPropertyName( BASEPROPERTY_DEFAULTCONTROL ) ) >>= aDefCtrl; - Reference < XControl > xCtrl; - maContext.createComponent( aDefCtrl, xCtrl ); + Reference < XControl > xCtrl( m_xContext->getServiceManager()->createInstanceWithContext(aDefCtrl, m_xContext), UNO_QUERY ); DBG_ASSERT( xCtrl.is(), "ControlContainerBase::ImplInsertControl: could not create the control!" ); if ( xCtrl.is() ) diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 1d711d3ccfc0..7ad8b7e5dc7a 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -146,8 +146,8 @@ public: // ---------------------------------------------------- // class UnoControlDialogModel // ---------------------------------------------------- -UnoControlDialogModel::UnoControlDialogModel( const Reference< XMultiServiceFactory >& i_factory ) - :ControlModelContainerBase( i_factory ) +UnoControlDialogModel::UnoControlDialogModel( const Reference< XComponentContext >& rxContext ) + :ControlModelContainerBase( rxContext ) { ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); // ImplRegisterProperty( BASEPROPERTY_BORDER ); @@ -279,8 +279,8 @@ void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 // = class UnoDialogControl // ============================================================================ -UnoDialogControl::UnoDialogControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) - :UnoDialogControl_Base( i_factory ) +UnoDialogControl::UnoDialogControl( const uno::Reference< uno::XComponentContext >& rxContext ) + :UnoDialogControl_Base( rxContext ) ,maTopWindowListeners( *this ) ,mbWindowListener(false) { @@ -626,7 +626,7 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang // ---------------------------------------------------- // class MultiPageControl // ---------------------------------------------------- -UnoMultiPageControl::UnoMultiPageControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory) : ControlContainerBase( i_factory ), maTabListeners( *this ) +UnoMultiPageControl::UnoMultiPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext), maTabListeners( *this ) { maComponentInfos.nWidth = 280; maComponentInfos.nHeight = 400; @@ -825,7 +825,7 @@ void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Refer // ------------- UnoMultiPageModel ----------------- -UnoMultiPageModel::UnoMultiPageModel( const Reference< XMultiServiceFactory >& i_factory ) : ControlModelContainerBase( i_factory ) +UnoMultiPageModel::UnoMultiPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext ) { ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); @@ -929,7 +929,7 @@ sal_Bool SAL_CALL UnoMultiPageModel::getGroupControl( ) throw (RuntimeException // ---------------------------------------------------- // class UnoPageControl // ---------------------------------------------------- -UnoPageControl::UnoPageControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) : ControlContainerBase( i_factory ) +UnoPageControl::UnoPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext) { maComponentInfos.nWidth = 280; maComponentInfos.nHeight = 400; @@ -947,7 +947,7 @@ UnoPageControl::~UnoPageControl() // ------------- UnoPageModel ----------------- -UnoPageModel::UnoPageModel( const Reference< XMultiServiceFactory >& i_factory ) : ControlModelContainerBase( i_factory ) +UnoPageModel::UnoPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext ) { ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); @@ -1036,7 +1036,7 @@ sal_Bool SAL_CALL UnoPageModel::getGroupControl( ) throw (RuntimeException) // ---------------------------------------------------- // class UnoFrameControl // ---------------------------------------------------- -UnoFrameControl::UnoFrameControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) : ControlContainerBase( i_factory ) +UnoFrameControl::UnoFrameControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext) { maComponentInfos.nWidth = 280; maComponentInfos.nHeight = 400; @@ -1112,7 +1112,7 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl ) // ------------- UnoFrameModel ----------------- -UnoFrameModel::UnoFrameModel( const Reference< XMultiServiceFactory >& i_factory ) : ControlModelContainerBase( i_factory ) +UnoFrameModel::UnoFrameModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext ) { ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index 79e905bbe11e..bb7bd383625d 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -112,8 +112,8 @@ namespace toolkit // = UnoControlFormattedFieldModel // =================================================================== // ------------------------------------------------------------------- - UnoControlFormattedFieldModel::UnoControlFormattedFieldModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) + UnoControlFormattedFieldModel::UnoControlFormattedFieldModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) ,m_bRevokedAsClient( false ) ,m_bSettingValueAndText( false ) { @@ -421,8 +421,8 @@ namespace toolkit // = UnoFormattedFieldControl // =================================================================== // ------------------------------------------------------------------- - UnoFormattedFieldControl::UnoFormattedFieldControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoSpinFieldControl( i_factory ) + UnoFormattedFieldControl::UnoFormattedFieldControl() + :UnoSpinFieldControl() { } diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx index 94f1d9eb41af..22bc2d743624 100644 --- a/toolkit/source/controls/grid/gridcontrol.cxx +++ b/toolkit/source/controls/grid/gridcontrol.cxx @@ -68,8 +68,8 @@ namespace } //---------------------------------------------------------------------------------------------------------------------- -UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); ImplRegisterProperty( BASEPROPERTY_BORDER ); @@ -89,8 +89,8 @@ UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun:: ImplRegisterProperty( BASEPROPERTY_GRID_SHOWCOLUMNHEADER ); ImplRegisterProperty( BASEPROPERTY_COLUMN_HEADER_HEIGHT ); ImplRegisterProperty( BASEPROPERTY_ROW_HEIGHT ); - ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL, makeAny( lcl_getDefaultDataModel_throw( maContext ) ) ); - ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( lcl_getDefaultColumnModel_throw( maContext ) ) ); + ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL, makeAny( lcl_getDefaultDataModel_throw( m_xContext ) ) ); + ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( lcl_getDefaultColumnModel_throw( m_xContext ) ) ); ImplRegisterProperty( BASEPROPERTY_GRID_SELECTIONMODE ); ImplRegisterProperty( BASEPROPERTY_FONTRELIEF ); ImplRegisterProperty( BASEPROPERTY_FONTEMPHASISMARK ); @@ -128,7 +128,7 @@ UnoGridModel::UnoGridModel( const UnoGridModel& rModel ) DBG_UNHANDLED_EXCEPTION(); } if ( !xDataModel.is() ) - xDataModel = lcl_getDefaultDataModel_throw( maContext ); + xDataModel = lcl_getDefaultDataModel_throw( m_xContext ); UnoControlModel::setFastPropertyValue_NoBroadcast( BASEPROPERTY_GRID_DATAMODEL, makeAny( xDataModel ) ); // do *not* use setFastPropertyValue here: The UnoControlModel ctor did a simple copy of all property values, // so before this call here, we share our data model with the own of the clone source. setFastPropertyValue, @@ -147,7 +147,7 @@ UnoGridModel::UnoGridModel( const UnoGridModel& rModel ) DBG_UNHANDLED_EXCEPTION(); } if ( !xColumnModel.is() ) - xColumnModel = lcl_getDefaultColumnModel_throw( maContext ); + xColumnModel = lcl_getDefaultColumnModel_throw( m_xContext ); UnoControlModel::setFastPropertyValue_NoBroadcast( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( xColumnModel ) ); // same comment as above: do not use our own setPropertyValue here. } @@ -270,8 +270,8 @@ Reference< XPropertySetInfo > UnoGridModel::getPropertySetInfo( ) throw(Runtime //====================================================================================================================== //= UnoGridControl //====================================================================================================================== -UnoGridControl::UnoGridControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoGridControl_Base( i_factory ) +UnoGridControl::UnoGridControl() + :UnoGridControl_Base() ,m_aSelectionListeners( *this ) ,m_pEventForwarder( new GridEventForwarder( *this ) ) { @@ -447,14 +447,14 @@ void SAL_CALL UnoGridControl::removeSelectionListener(const ::com::sun::star::un }//namespace toolkit -Reference< XInterface > SAL_CALL GridControl_CreateInstance( const Reference< XMultiServiceFactory >& i_factory ) +Reference< XInterface > SAL_CALL GridControl_CreateInstance( const Reference< XMultiServiceFactory >& ) { - return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridControl( i_factory ) ); + return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridControl() ); } Reference< XInterface > SAL_CALL GridControlModel_CreateInstance( const Reference< XMultiServiceFactory >& i_factory ) { - return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridModel( i_factory ) ); + return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridModel( comphelper::getComponentContext(i_factory) ) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/controls/grid/gridcontrol.hxx b/toolkit/source/controls/grid/gridcontrol.hxx index 383d36e8e756..607d4552fe98 100644 --- a/toolkit/source/controls/grid/gridcontrol.hxx +++ b/toolkit/source/controls/grid/gridcontrol.hxx @@ -47,7 +47,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoGridModel( const UnoGridModel& rModel ); UnoControlModel* Clone() const; @@ -79,7 +79,7 @@ typedef ::cppu::ImplInheritanceHelper2 < UnoControlBase class UnoGridControl : public UnoGridControl_Base { public: - UnoGridControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoGridControl(); ::rtl::OUString GetComponentServiceName(); // ::com::sun::star::lang::XComponent diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx index 1afd7c9e2c62..04049a06856b 100644 --- a/toolkit/source/controls/roadmapcontrol.cxx +++ b/toolkit/source/controls/roadmapcontrol.cxx @@ -54,7 +54,7 @@ static void lcl_throwIndexOutOfBoundsException( ) // = UnoControlRoadmapModel // =================================================================== // ------------------------------------------------------------------- - UnoControlRoadmapModel::UnoControlRoadmapModel( const Reference< XMultiServiceFactory >& i_factory ) + UnoControlRoadmapModel::UnoControlRoadmapModel( const Reference< XComponentContext >& i_factory ) :UnoControlRoadmapModel_Base( i_factory ) ,maContainerListeners( *this ) { @@ -358,8 +358,8 @@ static void lcl_throwIndexOutOfBoundsException( ) // = UnoRoadmapControl // =================================================================== // ------------------------------------------------------------------- - UnoRoadmapControl::UnoRoadmapControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlRoadmap_Base( i_factory ) + UnoRoadmapControl::UnoRoadmapControl() + :UnoControlRoadmap_Base() ,maItemListeners( *this ) { } diff --git a/toolkit/source/controls/spinningprogress.cxx b/toolkit/source/controls/spinningprogress.cxx index 2c4513dd286b..ed5751357cd0 100644 --- a/toolkit/source/controls/spinningprogress.cxx +++ b/toolkit/source/controls/spinningprogress.cxx @@ -45,14 +45,14 @@ namespace toolkit using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; using ::com::sun::star::beans::XPropertySetInfo; - using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uno::XComponentContext; /** === end UNO using === **/ //================================================================================================================== //= SpinningProgressControlModel //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - SpinningProgressControlModel::SpinningProgressControlModel( Reference< XMultiServiceFactory > const & i_factory ) + SpinningProgressControlModel::SpinningProgressControlModel( Reference< XComponentContext > const & i_factory ) :SpinningProgressControlModel_Base( i_factory ) { // default image sets diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx index 073dc03bd61a..071685c32a47 100644 --- a/toolkit/source/controls/tabpagecontainer.cxx +++ b/toolkit/source/controls/tabpagecontainer.cxx @@ -46,7 +46,7 @@ using ::com::sun::star::awt::tab::XTabPageModel; // ---------------------------------------------------- // class UnoControlTabPageContainerModel // ---------------------------------------------------- -UnoControlTabPageContainerModel::UnoControlTabPageContainerModel( const Reference< XMultiServiceFactory >& i_factory ) +UnoControlTabPageContainerModel::UnoControlTabPageContainerModel( const Reference< XComponentContext >& i_factory ) :UnoControlTabPageContainerModel_Base( i_factory ) ,maContainerListeners( *this ) { @@ -97,7 +97,7 @@ Reference< ::com::sun::star::beans::XPropertySetInfo > UnoControlTabPageContaine namespace { - Reference< XTabPageModel > lcl_createTabPageModel( ::comphelper::ComponentContext const & i_context, + Reference< XTabPageModel > lcl_createTabPageModel( Reference<XComponentContext> const & i_context, Sequence< Any > const & i_initArguments, Reference< XPropertySet > const & i_parentModel ) { try @@ -108,9 +108,9 @@ namespace Reference< XInterface > xInstance; if ( isGeometryControlModel ) - xInstance = *( new OGeometryControlModel< UnoControlTabPageModel >( i_context.getLegacyServiceFactory() ) ); + xInstance = *( new OGeometryControlModel< UnoControlTabPageModel >( i_context ) ); else - xInstance = *( new UnoControlTabPageModel( i_context.getLegacyServiceFactory() ) ); + xInstance = *( new UnoControlTabPageModel( i_context ) ); Reference< XTabPageModel > const xTabPageModel( xInstance, UNO_QUERY_THROW ); Reference< XInitialization > const xInit( xTabPageModel, UNO_QUERY_THROW ); @@ -134,7 +134,7 @@ Reference< XTabPageModel > SAL_CALL UnoControlTabPageContainerModel::createTabPa { Sequence< Any > aInitArgs(1); aInitArgs[0] <<= i_tabPageID; - return lcl_createTabPageModel( maContext, aInitArgs, this ); + return lcl_createTabPageModel( m_xContext, aInitArgs, this ); } Reference< XTabPageModel > SAL_CALL UnoControlTabPageContainerModel::loadTabPage( ::sal_Int16 i_tabPageID, const ::rtl::OUString& i_resourceURL ) throw (RuntimeException) @@ -142,7 +142,7 @@ Reference< XTabPageModel > SAL_CALL UnoControlTabPageContainerModel::loadTabPage Sequence< Any > aInitArgs(2); aInitArgs[0] <<= i_tabPageID; aInitArgs[1] <<= i_resourceURL; - return lcl_createTabPageModel( maContext, aInitArgs, this ); + return lcl_createTabPageModel( m_xContext, aInitArgs, this ); } void SAL_CALL UnoControlTabPageContainerModel::insertByIndex( ::sal_Int32 nIndex, const com::sun::star::uno::Any& aElement) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException) @@ -220,8 +220,8 @@ void UnoControlTabPageContainerModel::removeContainerListener( const Reference< // ---------------------------------------------------- // class UnoControlTabPageContainer // ---------------------------------------------------- -UnoControlTabPageContainer::UnoControlTabPageContainer( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlTabPageContainer_Base( i_factory ) +UnoControlTabPageContainer::UnoControlTabPageContainer( const uno::Reference< uno::XComponentContext >& rxContext ) + :UnoControlTabPageContainer_Base(rxContext) ,m_aTabPageListeners( *this ) { } diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index fd7703d08649..78e3a27f040d 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -64,7 +64,7 @@ using namespace ::com::sun::star::util; // ---------------------------------------------------- // class UnoControlTabPageModel // ---------------------------------------------------- -UnoControlTabPageModel::UnoControlTabPageModel( Reference< XMultiServiceFactory > const & i_factory ) +UnoControlTabPageModel::UnoControlTabPageModel( Reference< XComponentContext > const & i_factory ) :ControlModelContainerBase( i_factory ) { ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); @@ -131,7 +131,7 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArgument ::rtl::OUString sURL; if ( !( rArguments[ 1 ] >>= sURL )) throw lang::IllegalArgumentException(); - Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create( maContext.getUNOContext(),sURL); + Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create( m_xContext, sURL ); if ( xDialogModel.is() ) { Sequence< ::rtl::OUString> aNames = xDialogModel->getElementNames(); @@ -183,8 +183,8 @@ Sequence<rtl::OUString> SAL_CALL UnoControlTabPageModel_getSupportedServiceNames // = class UnoControlTabPage // ============================================================================ -UnoControlTabPage::UnoControlTabPage( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlTabPage_Base( i_factory ) +UnoControlTabPage::UnoControlTabPage( const uno::Reference< uno::XComponentContext >& rxContext ) + :UnoControlTabPage_Base(rxContext) ,m_bWindowListener(false) { maComponentInfos.nWidth = 280; diff --git a/toolkit/source/controls/tkscrollbar.cxx b/toolkit/source/controls/tkscrollbar.cxx index e71a74ebfa78..f2293bc6edec 100644 --- a/toolkit/source/controls/tkscrollbar.cxx +++ b/toolkit/source/controls/tkscrollbar.cxx @@ -36,7 +36,7 @@ namespace toolkit //= UnoControlScrollBarModel //==================================================================== //-------------------------------------------------------------------- - UnoControlScrollBarModel::UnoControlScrollBarModel( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) + UnoControlScrollBarModel::UnoControlScrollBarModel( const uno::Reference< uno::XComponentContext >& i_factory ) :UnoControlModel( i_factory ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXScrollBar ); @@ -86,8 +86,8 @@ namespace toolkit //==================================================================== //= UnoControlScrollBarModel //==================================================================== - UnoScrollBarControl::UnoScrollBarControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) + UnoScrollBarControl::UnoScrollBarControl() + :UnoControlBase() ,maAdjustmentListeners( *this ) { } diff --git a/toolkit/source/controls/tksimpleanimation.cxx b/toolkit/source/controls/tksimpleanimation.cxx index 09a7f4099186..1b893b19805b 100644 --- a/toolkit/source/controls/tksimpleanimation.cxx +++ b/toolkit/source/controls/tksimpleanimation.cxx @@ -33,7 +33,7 @@ namespace toolkit //= UnoSimpleAnimationControlModel //==================================================================== //-------------------------------------------------------------------- - UnoSimpleAnimationControlModel::UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) + UnoSimpleAnimationControlModel::UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ) :UnoControlModel( i_factory ) { ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); @@ -111,8 +111,8 @@ namespace toolkit //= UnoSimpleAnimationControl //==================================================================== //-------------------------------------------------------------------- - UnoSimpleAnimationControl::UnoSimpleAnimationControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) - :UnoSimpleAnimationControl_Base( i_factory ) + UnoSimpleAnimationControl::UnoSimpleAnimationControl() + :UnoSimpleAnimationControl_Base() { } diff --git a/toolkit/source/controls/tkspinbutton.cxx b/toolkit/source/controls/tkspinbutton.cxx index b86ce17290ed..ef5a9665c993 100644 --- a/toolkit/source/controls/tkspinbutton.cxx +++ b/toolkit/source/controls/tkspinbutton.cxx @@ -39,7 +39,7 @@ namespace toolkit //= UnoSpinButtonModel //==================================================================== //-------------------------------------------------------------------- - UnoSpinButtonModel::UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) + UnoSpinButtonModel::UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ) :UnoControlModel( i_factory ) { ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); @@ -127,8 +127,8 @@ namespace toolkit //= UnoSpinButtonControl //==================================================================== //-------------------------------------------------------------------- - UnoSpinButtonControl::UnoSpinButtonControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) + UnoSpinButtonControl::UnoSpinButtonControl() + :UnoControlBase() ,maAdjustmentListeners( *this ) { } diff --git a/toolkit/source/controls/tkthrobber.cxx b/toolkit/source/controls/tkthrobber.cxx index 7de89801210b..7eff4193f3c9 100644 --- a/toolkit/source/controls/tkthrobber.cxx +++ b/toolkit/source/controls/tkthrobber.cxx @@ -33,7 +33,7 @@ namespace toolkit //= UnoThrobberControlModel //==================================================================== //-------------------------------------------------------------------- - UnoThrobberControlModel::UnoThrobberControlModel( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) + UnoThrobberControlModel::UnoThrobberControlModel( const uno::Reference< uno::XComponentContext >& i_factory ) :UnoControlModel( i_factory ) { ImplRegisterProperty( BASEPROPERTY_BORDER ); @@ -109,8 +109,8 @@ namespace toolkit //= UnoThrobberControl //==================================================================== //-------------------------------------------------------------------- - UnoThrobberControl::UnoThrobberControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) + UnoThrobberControl::UnoThrobberControl() + :UnoControlBase() { } diff --git a/toolkit/source/controls/tree/treecontrol.cxx b/toolkit/source/controls/tree/treecontrol.cxx index f16245a05be5..69e88eb9d522 100644 --- a/toolkit/source/controls/tree/treecontrol.cxx +++ b/toolkit/source/controls/tree/treecontrol.cxx @@ -43,7 +43,7 @@ namespace toolkit // ---------------------------------------------------- // class UnoTreeModel // ---------------------------------------------------- -UnoTreeModel::UnoTreeModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) +UnoTreeModel::UnoTreeModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ) :UnoControlModel( i_factory ) { ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); @@ -129,8 +129,8 @@ Reference< XPropertySetInfo > UnoTreeModel::getPropertySetInfo( ) throw(Runtime // ---------------------------------------------------- // class UnoTreeControl // ---------------------------------------------------- -UnoTreeControl::UnoTreeControl( const Reference< XMultiServiceFactory >& i_factory ) -: UnoTreeControl_Base( i_factory ) +UnoTreeControl::UnoTreeControl() +: UnoTreeControl_Base() , maSelectionListeners( *this ) , maTreeExpansionListeners( *this ) , maTreeEditListeners( *this ) @@ -442,14 +442,14 @@ void UnoTreeControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolk } -Reference< XInterface > SAL_CALL TreeControl_CreateInstance( const Reference< XMultiServiceFactory >& i_factory ) +Reference< XInterface > SAL_CALL TreeControl_CreateInstance( const Reference< XMultiServiceFactory >& ) { - return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeControl( i_factory ) ); + return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeControl() ); } Reference< XInterface > SAL_CALL TreeControlModel_CreateInstance( const Reference< XMultiServiceFactory >& i_factory ) { - return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeModel( i_factory ) ); + return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeModel( comphelper::getComponentContext(i_factory) ) ); } void SAL_CALL TreeEditListenerMultiplexer::nodeEditing( const Reference< XTreeNode >& Node ) throw (RuntimeException, ::com::sun::star::util::VetoException) diff --git a/toolkit/source/controls/tree/treecontrol.hxx b/toolkit/source/controls/tree/treecontrol.hxx index 0dd2f7eef35b..a36d242f637a 100644 --- a/toolkit/source/controls/tree/treecontrol.hxx +++ b/toolkit/source/controls/tree/treecontrol.hxx @@ -46,7 +46,7 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: - UnoTreeModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoTreeModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ); UnoTreeModel( const UnoTreeModel& rModel ); UnoControlModel* Clone() const; @@ -69,7 +69,7 @@ typedef ::cppu::ImplInheritanceHelper1< UnoControlBase, ::com::sun::star::awt::t class UnoTreeControl : public UnoTreeControl_Base { public: - UnoTreeControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); + UnoTreeControl(); ::rtl::OUString GetComponentServiceName(); // ::com::sun::star::lang::XComponent diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 6cefb82b6d85..01944885c150 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -21,7 +21,6 @@ #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/VclWindowPeerAttribute.hpp> #include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/resource/XStringResourceResolver.hpp> #include <toolkit/controls/unocontrol.hxx> @@ -136,27 +135,8 @@ struct UnoControl_Data // class UnoControl // ---------------------------------------------------- DBG_NAME( UnoControl ) -UnoControl::UnoControl() - :maContext( ::comphelper::getProcessServiceFactory() ) - ,maDisposeListeners( *this ) - ,maWindowListeners( *this ) - ,maFocusListeners( *this ) - ,maKeyListeners( *this ) - ,maMouseListeners( *this ) - ,maMouseMotionListeners( *this ) - ,maPaintListeners( *this ) - ,maModeChangeListeners( GetMutex() ) - ,mpData( new UnoControl_Data ) -{ - DBG_CTOR( UnoControl, NULL ); - OSL_ENSURE( false, "UnoControl::UnoControl: not implemented. Well, not really." ); - // just implemented to let the various FooImplInheritanceHelper compile, you should use the - // version taking a service factory -} - -UnoControl::UnoControl( const Reference< XMultiServiceFactory >& i_factory ) - : maContext( i_factory ) - , maDisposeListeners( *this ) +UnoControl::UnoControl() : + maDisposeListeners( *this ) , maWindowListeners( *this ) , maFocusListeners( *this ) , maKeyListeners( *this ) diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx index e525203c2bde..d228b2e7e050 100644 --- a/toolkit/source/controls/unocontrolcontainer.cxx +++ b/toolkit/source/controls/unocontrolcontainer.cxx @@ -395,15 +395,15 @@ void SAL_CALL DialogStepChangedListener::propertyChange( const beans::PropertyC // ---------------------------------------------------- // class UnoControlContainer // ---------------------------------------------------- -UnoControlContainer::UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) - :UnoControlContainer_Base( i_factory ) +UnoControlContainer::UnoControlContainer() + :UnoControlContainer_Base() ,maCListeners( *this ) { mpControls = new UnoControlHolderList; } -UnoControlContainer::UnoControlContainer( const uno::Reference< lang::XMultiServiceFactory >& i_factory, const uno::Reference< awt::XWindowPeer >& xP ) - :UnoControlContainer_Base( i_factory ) +UnoControlContainer::UnoControlContainer(const uno::Reference< awt::XWindowPeer >& xP ) + :UnoControlContainer_Base() ,maCListeners( *this ) { setPeer( xP ); diff --git a/toolkit/source/controls/unocontrolcontainermodel.cxx b/toolkit/source/controls/unocontrolcontainermodel.cxx index 912d748f3918..4af12d9c7226 100644 --- a/toolkit/source/controls/unocontrolcontainermodel.cxx +++ b/toolkit/source/controls/unocontrolcontainermodel.cxx @@ -26,7 +26,7 @@ // ---------------------------------------------------- // class UnoControlContainerModel // ---------------------------------------------------- -UnoControlContainerModel::UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) +UnoControlContainerModel::UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory ) :UnoControlModel( i_factory ) { ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 4bff90152583..6e35c664e465 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -112,12 +112,12 @@ static void lcl_ImplMergeFontProperty( FontDescriptor& rFD, sal_uInt16 nPropId, // ---------------------------------------------------- // class UnoControlModel // ---------------------------------------------------- -UnoControlModel::UnoControlModel( const Reference< XMultiServiceFactory >& i_factory ) +UnoControlModel::UnoControlModel( const Reference< XComponentContext >& rxContext ) :UnoControlModel_Base() ,MutexAndBroadcastHelper() ,OPropertySetHelper( BrdcstHelper ) ,maDisposeListeners( *this ) - ,maContext( i_factory ) + ,m_xContext( rxContext ) { // Insert properties from Model into table, // only existing properties are valid, even if they're VOID @@ -129,7 +129,7 @@ UnoControlModel::UnoControlModel( const UnoControlModel& rModel ) , OPropertySetHelper( BrdcstHelper ) , maData( rModel.maData ) , maDisposeListeners( *this ) - , maContext( rModel.maContext ) + , m_xContext( rModel.m_xContext ) { } @@ -330,7 +330,7 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const // the remaining is the locale LanguageTag aLanguageTag( sDefaultCurrency); - LocaleDataWrapper aLocaleInfo( maContext.getUNOContext(), aLanguageTag ); + LocaleDataWrapper aLocaleInfo( m_xContext, aLanguageTag ); if ( sBankSymbol.isEmpty() ) sBankSymbol = aLocaleInfo.getCurrBankSymbol(); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index ac54f2368154..aa48fba639bb 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -121,8 +121,8 @@ ImageHelper::getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL ) // ---------------------------------------------------- // class UnoControlEditModel // ---------------------------------------------------- -UnoControlEditModel::UnoControlEditModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlEditModel::UnoControlEditModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXEdit ); } @@ -173,8 +173,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlEditModel::getPropertySetInf // ---------------------------------------------------- // class UnoEditControl // ---------------------------------------------------- -UnoEditControl::UnoEditControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) +UnoEditControl::UnoEditControl() + :UnoControlBase() ,maTextListeners( *this ) ,mnMaxTextLen( 0 ) ,mbSetTextInPeer( sal_False ) @@ -491,8 +491,8 @@ uno::Sequence< ::rtl::OUString > UnoEditControl::getSupportedServiceNames() thro // ---------------------------------------------------- // class UnoControlFileControlModel // ---------------------------------------------------- -UnoControlFileControlModel::UnoControlFileControlModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlFileControlModel::UnoControlFileControlModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { ImplRegisterProperty( BASEPROPERTY_ALIGN ); ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); @@ -551,8 +551,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFileControlModel::getPropert // ---------------------------------------------------- // class UnoFileControl // ---------------------------------------------------- -UnoFileControl::UnoFileControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoEditControl( i_factory ) +UnoFileControl::UnoFileControl() + :UnoEditControl() { } @@ -634,8 +634,8 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n // ---------------------------------------------------- // class UnoControlButtonModel // ---------------------------------------------------- -UnoControlButtonModel::UnoControlButtonModel( const Reference< XMultiServiceFactory >& i_factory ) - :GraphicControlModel( i_factory ) +UnoControlButtonModel::UnoControlButtonModel( const Reference< XComponentContext >& rxContext ) + :GraphicControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXButton ); @@ -691,8 +691,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlButtonModel::getPropertySetI // ---------------------------------------------------- // class UnoButtonControl // ---------------------------------------------------- -UnoButtonControl::UnoButtonControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) - :UnoButtonControl_Base( i_factory ) +UnoButtonControl::UnoButtonControl() + :UnoButtonControl_Base() ,maActionListeners( *this ) ,maItemListeners( *this ) { @@ -831,8 +831,8 @@ awt::Size UnoButtonControl::calcAdjustedSize( const awt::Size& rNewSize ) throw( // ---------------------------------------------------- // class UnoControlImageControlModel // ---------------------------------------------------- -UnoControlImageControlModel::UnoControlImageControlModel( const Reference< XMultiServiceFactory >& i_factory ) - :GraphicControlModel( i_factory ) +UnoControlImageControlModel::UnoControlImageControlModel( const Reference< XComponentContext >& rxContext ) + :GraphicControlModel( rxContext ) ,mbAdjustingImageScaleMode( false ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXImageControl ); @@ -913,8 +913,8 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal // ---------------------------------------------------- // class UnoImageControlControl // ---------------------------------------------------- -UnoImageControlControl::UnoImageControlControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoImageControlControl_Base( i_factory ) +UnoImageControlControl::UnoImageControlControl() + :UnoImageControlControl_Base() ,maActionListeners( *this ) { // TODO: Where should I look for defaults? @@ -958,8 +958,8 @@ awt::Size UnoImageControlControl::calcAdjustedSize( const awt::Size& rNewSize ) // ---------------------------------------------------- // class UnoControlRadioButtonModel // ---------------------------------------------------- -UnoControlRadioButtonModel::UnoControlRadioButtonModel( const Reference< XMultiServiceFactory >& i_factory ) - :GraphicControlModel( i_factory ) +UnoControlRadioButtonModel::UnoControlRadioButtonModel( const Reference< XComponentContext >& rxContext ) + :GraphicControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXRadioButton ); } @@ -1006,8 +1006,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlRadioButtonModel::getPropert // ---------------------------------------------------- // class UnoRadioButtonControl // ---------------------------------------------------- -UnoRadioButtonControl::UnoRadioButtonControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoRadioButtonControl_Base( i_factory ) +UnoRadioButtonControl::UnoRadioButtonControl() + :UnoRadioButtonControl_Base() ,maItemListeners( *this ) ,maActionListeners( *this ) { @@ -1168,8 +1168,8 @@ awt::Size UnoRadioButtonControl::calcAdjustedSize( const awt::Size& rNewSize ) t // ---------------------------------------------------- // class UnoControlCheckBoxModel // ---------------------------------------------------- -UnoControlCheckBoxModel::UnoControlCheckBoxModel( const Reference< XMultiServiceFactory >& i_factory ) - :GraphicControlModel( i_factory ) +UnoControlCheckBoxModel::UnoControlCheckBoxModel( const Reference< XComponentContext >& rxContext ) + :GraphicControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXCheckBox ); } @@ -1216,8 +1216,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlCheckBoxModel::getPropertySe // ---------------------------------------------------- // class UnoCheckBoxControl // ---------------------------------------------------- -UnoCheckBoxControl::UnoCheckBoxControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) - :UnoCheckBoxControl_Base( i_factory ) +UnoCheckBoxControl::UnoCheckBoxControl() + :UnoCheckBoxControl_Base() ,maItemListeners( *this ), maActionListeners( *this ) { maComponentInfos.nWidth = 100; @@ -1353,8 +1353,8 @@ awt::Size UnoCheckBoxControl::calcAdjustedSize( const awt::Size& rNewSize ) thro // ---------------------------------------------------- // class UnoControlFixedHyperlinkModel // ---------------------------------------------------- -UnoControlFixedHyperlinkModel::UnoControlFixedHyperlinkModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlFixedHyperlinkModel::UnoControlFixedHyperlinkModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXFixedHyperlink ); } @@ -1409,8 +1409,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedHyperlinkModel::getProp // ---------------------------------------------------- // class UnoFixedHyperlinkControl // ---------------------------------------------------- -UnoFixedHyperlinkControl::UnoFixedHyperlinkControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) +UnoFixedHyperlinkControl::UnoFixedHyperlinkControl() + :UnoControlBase() ,maActionListeners( *this ) { maComponentInfos.nWidth = 100; @@ -1540,8 +1540,8 @@ void UnoFixedHyperlinkControl::removeActionListener(const uno::Reference< awt::X // ---------------------------------------------------- // class UnoControlFixedTextModel // ---------------------------------------------------- -UnoControlFixedTextModel::UnoControlFixedTextModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlFixedTextModel::UnoControlFixedTextModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXFixedText ); } @@ -1591,8 +1591,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedTextModel::getPropertyS // ---------------------------------------------------- // class UnoFixedTextControl // ---------------------------------------------------- -UnoFixedTextControl::UnoFixedTextControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) +UnoFixedTextControl::UnoFixedTextControl() + :UnoControlBase() { maComponentInfos.nWidth = 100; maComponentInfos.nHeight = 12; @@ -1672,8 +1672,8 @@ awt::Size UnoFixedTextControl::calcAdjustedSize( const awt::Size& rNewSize ) thr // ---------------------------------------------------- // class UnoControlGroupBoxModel // ---------------------------------------------------- -UnoControlGroupBoxModel::UnoControlGroupBoxModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlGroupBoxModel::UnoControlGroupBoxModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); ImplRegisterProperty( BASEPROPERTY_ENABLED ); @@ -1724,8 +1724,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlGroupBoxModel::getPropertySe // ---------------------------------------------------- // class UnoGroupBoxControl // ---------------------------------------------------- -UnoGroupBoxControl::UnoGroupBoxControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) +UnoGroupBoxControl::UnoGroupBoxControl() + :UnoControlBase() { maComponentInfos.nWidth = 100; maComponentInfos.nHeight = 100; @@ -1847,8 +1847,8 @@ private: // = UnoControlListBoxModel // ===================================================================================================================== // --------------------------------------------------------------------------------------------------------------------- -UnoControlListBoxModel::UnoControlListBoxModel( const Reference< XMultiServiceFactory >& i_factory, ConstructorMode const i_mode ) - :UnoControlListBoxModel_Base( i_factory ) +UnoControlListBoxModel::UnoControlListBoxModel( const Reference< XComponentContext >& rxContext, ConstructorMode const i_mode ) + :UnoControlListBoxModel_Base( rxContext ) ,m_pData( new UnoControlListBoxModel_Data( *this ) ) ,m_aItemListListeners( GetMutex() ) { @@ -2290,8 +2290,8 @@ void UnoControlListBoxModel::impl_notifyItemListEvent_nolck( const sal_Int32 i_n // ---------------------------------------------------- // class UnoListBoxControl // ---------------------------------------------------- -UnoListBoxControl::UnoListBoxControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoListBoxControl_Base( i_factory ) +UnoListBoxControl::UnoListBoxControl() + :UnoListBoxControl_Base() ,maActionListeners( *this ) ,maItemListeners( *this ) { @@ -2714,8 +2714,8 @@ void SAL_CALL UnoListBoxControl::itemListChanged( const lang::EventObject& i_rEv // ---------------------------------------------------- // class UnoControlComboBoxModel // ---------------------------------------------------- -UnoControlComboBoxModel::UnoControlComboBoxModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlListBoxModel( i_factory, ConstructWithoutProperties ) +UnoControlComboBoxModel::UnoControlComboBoxModel( const Reference< XComponentContext >& rxContext ) + :UnoControlListBoxModel( rxContext, ConstructWithoutProperties ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox ); } @@ -2790,8 +2790,8 @@ uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) cons // ---------------------------------------------------- // class UnoComboBoxControl // ---------------------------------------------------- -UnoComboBoxControl::UnoComboBoxControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoEditControl( i_factory ) +UnoComboBoxControl::UnoComboBoxControl() + :UnoEditControl() ,maActionListeners( *this ) ,maItemListeners( *this ) { @@ -3104,8 +3104,8 @@ sal_Int16 UnoComboBoxControl::getDropDownLineCount() throw(uno::RuntimeException // ---------------------------------------------------- // UnoSpinFieldControl // ---------------------------------------------------- -UnoSpinFieldControl::UnoSpinFieldControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoEditControl( i_factory ) +UnoSpinFieldControl::UnoSpinFieldControl() + :UnoEditControl() ,maSpinListeners( *this ) { mbRepeat = sal_False; @@ -3196,8 +3196,8 @@ void UnoSpinFieldControl::enableRepeat( sal_Bool bRepeat ) throw(::com::sun::sta // ---------------------------------------------------- // class UnoControlDateFieldModel // ---------------------------------------------------- -UnoControlDateFieldModel::UnoControlDateFieldModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlDateFieldModel::UnoControlDateFieldModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXDateField ); } @@ -3242,8 +3242,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlDateFieldModel::getPropertyS // ---------------------------------------------------- // class UnoDateFieldControl // ---------------------------------------------------- -UnoDateFieldControl::UnoDateFieldControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoSpinFieldControl( i_factory ) +UnoDateFieldControl::UnoDateFieldControl() + :UnoSpinFieldControl() { mnFirst = Date( 1, 1, 1900 ).GetDate(); mnLast = Date( 31, 12, 2200 ).GetDate(); @@ -3438,8 +3438,8 @@ sal_Bool UnoDateFieldControl::isStrictFormat() throw(uno::RuntimeException) // ---------------------------------------------------- // class UnoControlTimeFieldModel // ---------------------------------------------------- -UnoControlTimeFieldModel::UnoControlTimeFieldModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlTimeFieldModel::UnoControlTimeFieldModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXTimeField ); } @@ -3484,8 +3484,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlTimeFieldModel::getPropertyS // ---------------------------------------------------- // class UnoTimeFieldControl // ---------------------------------------------------- -UnoTimeFieldControl::UnoTimeFieldControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoSpinFieldControl( i_factory ) +UnoTimeFieldControl::UnoTimeFieldControl() + :UnoSpinFieldControl() { mnFirst = Time( 0, 0 ).GetTime(); mnLast = Time( 23, 59, 59, 99 ).GetTime(); @@ -3639,8 +3639,8 @@ sal_Bool UnoTimeFieldControl::isStrictFormat() throw(uno::RuntimeException) // ---------------------------------------------------- // class UnoControlNumericFieldModel // ---------------------------------------------------- -UnoControlNumericFieldModel::UnoControlNumericFieldModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlNumericFieldModel::UnoControlNumericFieldModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXNumericField ); } @@ -3685,8 +3685,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlNumericFieldModel::getProper // ---------------------------------------------------- // class UnoNumericFieldControl // ---------------------------------------------------- -UnoNumericFieldControl::UnoNumericFieldControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoSpinFieldControl( i_factory ) +UnoNumericFieldControl::UnoNumericFieldControl() + :UnoSpinFieldControl() { mnFirst = 0; mnLast = 0x7FFFFFFF; @@ -3837,8 +3837,8 @@ sal_Int16 UnoNumericFieldControl::getDecimalDigits() throw(uno::RuntimeException // ---------------------------------------------------- // class UnoControlCurrencyFieldModel // ---------------------------------------------------- -UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXCurrencyField ); } @@ -3887,8 +3887,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlCurrencyFieldModel::getPrope // ---------------------------------------------------- // class UnoCurrencyFieldControl // ---------------------------------------------------- -UnoCurrencyFieldControl::UnoCurrencyFieldControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoSpinFieldControl( i_factory ) +UnoCurrencyFieldControl::UnoCurrencyFieldControl() + :UnoSpinFieldControl() { mnFirst = 0; mnLast = 0x7FFFFFFF; @@ -4038,8 +4038,8 @@ sal_Int16 UnoCurrencyFieldControl::getDecimalDigits() throw(uno::RuntimeExceptio // ---------------------------------------------------- // class UnoControlPatternFieldModel // ---------------------------------------------------- -UnoControlPatternFieldModel::UnoControlPatternFieldModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlPatternFieldModel::UnoControlPatternFieldModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXPatternField ); } @@ -4082,8 +4082,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlPatternFieldModel::getProper // ---------------------------------------------------- // class UnoPatternFieldControl // ---------------------------------------------------- -UnoPatternFieldControl::UnoPatternFieldControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoSpinFieldControl( i_factory ) +UnoPatternFieldControl::UnoPatternFieldControl() + :UnoSpinFieldControl() { } @@ -4172,8 +4172,8 @@ sal_Bool UnoPatternFieldControl::isStrictFormat() throw(uno::RuntimeException) // ---------------------------------------------------- // class UnoControlProgressBarModel // ---------------------------------------------------- -UnoControlProgressBarModel::UnoControlProgressBarModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlProgressBarModel::UnoControlProgressBarModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); ImplRegisterProperty( BASEPROPERTY_BORDER ); @@ -4229,8 +4229,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlProgressBarModel::getPropert // ---------------------------------------------------- // class UnoProgressBarControl // ---------------------------------------------------- -UnoProgressBarControl::UnoProgressBarControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) +UnoProgressBarControl::UnoProgressBarControl() + :UnoControlBase() { } @@ -4306,8 +4306,8 @@ sal_Int32 UnoProgressBarControl::getValue() throw(::com::sun::star::uno::Runtime // ---------------------------------------------------- // class UnoControlFixedLineModel // ---------------------------------------------------- -UnoControlFixedLineModel::UnoControlFixedLineModel( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlModel( i_factory ) +UnoControlFixedLineModel::UnoControlFixedLineModel( const Reference< XComponentContext >& rxContext ) + :UnoControlModel( rxContext ) { ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); @@ -4358,8 +4358,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedLineModel::getPropertyS // ---------------------------------------------------- // class UnoFixedLineControl // ---------------------------------------------------- -UnoFixedLineControl::UnoFixedLineControl( const Reference< XMultiServiceFactory >& i_factory ) - :UnoControlBase( i_factory ) +UnoFixedLineControl::UnoFixedLineControl() + :UnoControlBase() { maComponentInfos.nWidth = 100; // ?? maComponentInfos.nHeight = 100; // ?? diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index bbf7089e636e..ee1d76b93f2a 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/registry/XRegistryKey.hpp> #include <toolkit/controls/geometrycontrolmodel.hxx> +#include <comphelper/processfactory.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/weak.hxx> #include <osl/mutex.hxx> @@ -91,14 +92,14 @@ namespace toolkit ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) \ { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName ); } -#define IMPL_CREATEINSTANCE2( ImplName ) \ +#define IMPL_CREATEINSTANCE_CTX( ImplName ) \ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \ - { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( i_factory ) ); } + { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( comphelper::getComponentContext(i_factory) ) ); } #define IMPL_CREATE_INSTANCE_WITH_GEOMETRY( ImplName ) \ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \ { \ - return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel< ImplName >( i_factory ) ); \ + return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel< ImplName >( comphelper::getComponentContext( i_factory ) ) ); \ } #define GET_FACTORY_WITH_IMPL_PREFIX( ClassName, ImplNamePrefix, ServiceName1, ServiceName2 ) \ @@ -117,74 +118,74 @@ using namespace toolkit; IMPL_CREATEINSTANCE( VCLXToolkit ) IMPL_CREATEINSTANCE( StdTabController ) IMPL_CREATEINSTANCE( StdTabControllerModel ) -IMPL_CREATEINSTANCE2( UnoButtonControl ) -IMPL_CREATEINSTANCE2( UnoCheckBoxControl ) -IMPL_CREATEINSTANCE2( UnoComboBoxControl ) -IMPL_CREATEINSTANCE2( UnoControlButtonModel ) -IMPL_CREATEINSTANCE2( UnoControlCheckBoxModel ) -IMPL_CREATEINSTANCE2( UnoControlComboBoxModel ) -IMPL_CREATEINSTANCE2( UnoControlContainer ) -IMPL_CREATEINSTANCE2( UnoControlContainerModel ) -IMPL_CREATEINSTANCE2( UnoControlCurrencyFieldModel ) -IMPL_CREATEINSTANCE2( UnoControlDateFieldModel ) -IMPL_CREATEINSTANCE2( UnoControlEditModel ) -IMPL_CREATEINSTANCE2( UnoControlFileControlModel ) -IMPL_CREATEINSTANCE2( UnoControlFixedHyperlinkModel ) -IMPL_CREATEINSTANCE2( UnoControlFixedTextModel ) -IMPL_CREATEINSTANCE2( UnoControlFormattedFieldModel ) -IMPL_CREATEINSTANCE2( UnoControlGroupBoxModel ) -IMPL_CREATEINSTANCE2( UnoControlImageControlModel ) -IMPL_CREATEINSTANCE2( UnoControlListBoxModel ) -IMPL_CREATEINSTANCE2( UnoControlNumericFieldModel ) -IMPL_CREATEINSTANCE2( UnoControlPatternFieldModel ) -IMPL_CREATEINSTANCE2( UnoControlRadioButtonModel ) -IMPL_CREATEINSTANCE2( UnoControlTimeFieldModel ) -IMPL_CREATEINSTANCE2( UnoControlProgressBarModel ) -IMPL_CREATEINSTANCE2( UnoControlScrollBarModel ) -IMPL_CREATEINSTANCE2( UnoSpinButtonModel ) -IMPL_CREATEINSTANCE2( UnoMultiPageModel ) -IMPL_CREATEINSTANCE2( UnoPageModel ) -IMPL_CREATEINSTANCE2( UnoFrameModel ) -IMPL_CREATEINSTANCE2( UnoControlFixedLineModel ) -IMPL_CREATEINSTANCE2( UnoCurrencyFieldControl ) -IMPL_CREATEINSTANCE2( UnoDateFieldControl ) -IMPL_CREATEINSTANCE2( UnoDialogControl ) -IMPL_CREATEINSTANCE2( UnoEditControl ) -IMPL_CREATEINSTANCE2( UnoFileControl ) -IMPL_CREATEINSTANCE2( UnoFixedHyperlinkControl ) -IMPL_CREATEINSTANCE2( UnoFixedTextControl ) -IMPL_CREATEINSTANCE2( UnoFormattedFieldControl ) -IMPL_CREATEINSTANCE2( UnoGroupBoxControl ) -IMPL_CREATEINSTANCE2( UnoImageControlControl ) -IMPL_CREATEINSTANCE2( UnoListBoxControl ) -IMPL_CREATEINSTANCE2( UnoNumericFieldControl ) -IMPL_CREATEINSTANCE2( UnoPatternFieldControl ) -IMPL_CREATEINSTANCE2( UnoRadioButtonControl ) -IMPL_CREATEINSTANCE2( UnoTimeFieldControl ) -IMPL_CREATEINSTANCE2( UnoProgressBarControl ) -IMPL_CREATEINSTANCE2( UnoScrollBarControl ) -IMPL_CREATEINSTANCE2( UnoSpinButtonControl ) -IMPL_CREATEINSTANCE2( UnoFixedLineControl ) -IMPL_CREATEINSTANCE2( UnoMultiPageControl ) -IMPL_CREATEINSTANCE2( UnoPageControl ) -IMPL_CREATEINSTANCE2( UnoFrameControl ) +IMPL_CREATEINSTANCE( UnoButtonControl ) +IMPL_CREATEINSTANCE( UnoCheckBoxControl ) +IMPL_CREATEINSTANCE( UnoComboBoxControl ) +IMPL_CREATEINSTANCE_CTX( UnoControlButtonModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlCheckBoxModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlComboBoxModel ) +IMPL_CREATEINSTANCE( UnoControlContainer ) +IMPL_CREATEINSTANCE_CTX( UnoControlContainerModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlCurrencyFieldModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlDateFieldModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlEditModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlFileControlModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlFixedHyperlinkModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlFixedTextModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlFormattedFieldModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlGroupBoxModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlImageControlModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlListBoxModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlNumericFieldModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlPatternFieldModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlRadioButtonModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlTimeFieldModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlProgressBarModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlScrollBarModel ) +IMPL_CREATEINSTANCE_CTX( UnoSpinButtonModel ) +IMPL_CREATEINSTANCE_CTX( UnoMultiPageModel ) +IMPL_CREATEINSTANCE_CTX( UnoPageModel ) +IMPL_CREATEINSTANCE_CTX( UnoFrameModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlFixedLineModel ) +IMPL_CREATEINSTANCE( UnoCurrencyFieldControl ) +IMPL_CREATEINSTANCE( UnoDateFieldControl ) +IMPL_CREATEINSTANCE_CTX( UnoDialogControl ) +IMPL_CREATEINSTANCE( UnoEditControl ) +IMPL_CREATEINSTANCE( UnoFileControl ) +IMPL_CREATEINSTANCE( UnoFixedHyperlinkControl ) +IMPL_CREATEINSTANCE( UnoFixedTextControl ) +IMPL_CREATEINSTANCE( UnoFormattedFieldControl ) +IMPL_CREATEINSTANCE( UnoGroupBoxControl ) +IMPL_CREATEINSTANCE( UnoImageControlControl ) +IMPL_CREATEINSTANCE( UnoListBoxControl ) +IMPL_CREATEINSTANCE( UnoNumericFieldControl ) +IMPL_CREATEINSTANCE( UnoPatternFieldControl ) +IMPL_CREATEINSTANCE( UnoRadioButtonControl ) +IMPL_CREATEINSTANCE( UnoTimeFieldControl ) +IMPL_CREATEINSTANCE( UnoProgressBarControl ) +IMPL_CREATEINSTANCE( UnoScrollBarControl ) +IMPL_CREATEINSTANCE( UnoSpinButtonControl ) +IMPL_CREATEINSTANCE( UnoFixedLineControl ) +IMPL_CREATEINSTANCE_CTX( UnoMultiPageControl ) +IMPL_CREATEINSTANCE_CTX( UnoPageControl ) +IMPL_CREATEINSTANCE_CTX( UnoFrameControl ) IMPL_CREATEINSTANCE( VCLXMenuBar ) IMPL_CREATEINSTANCE( VCLXPointer ) IMPL_CREATEINSTANCE( VCLXPopupMenu ) IMPL_CREATEINSTANCE( VCLXPrinterServer ) -IMPL_CREATEINSTANCE2( UnoRoadmapControl ) -IMPL_CREATEINSTANCE2( UnoControlRoadmapModel ) -IMPL_CREATEINSTANCE2( UnoSimpleAnimationControl ) -IMPL_CREATEINSTANCE2( UnoSimpleAnimationControlModel ) -IMPL_CREATEINSTANCE2( UnoThrobberControl ) -IMPL_CREATEINSTANCE2( UnoThrobberControlModel ) -IMPL_CREATEINSTANCE2( UnoControlTabPage ) -IMPL_CREATEINSTANCE2( UnoControlTabPageModel ) -IMPL_CREATEINSTANCE2( UnoControlTabPageContainer ) -IMPL_CREATEINSTANCE2( UnoControlTabPageContainerModel ) -IMPL_CREATEINSTANCE2( AnimatedImagesControl ) -IMPL_CREATEINSTANCE2( AnimatedImagesControlModel ) -IMPL_CREATEINSTANCE2( SpinningProgressControlModel ) +IMPL_CREATEINSTANCE( UnoRoadmapControl ) +IMPL_CREATEINSTANCE_CTX( UnoControlRoadmapModel ) +IMPL_CREATEINSTANCE( UnoSimpleAnimationControl ) +IMPL_CREATEINSTANCE_CTX( UnoSimpleAnimationControlModel ) +IMPL_CREATEINSTANCE( UnoThrobberControl ) +IMPL_CREATEINSTANCE_CTX( UnoThrobberControlModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlTabPage ) +IMPL_CREATEINSTANCE_CTX( UnoControlTabPageModel ) +IMPL_CREATEINSTANCE_CTX( UnoControlTabPageContainer ) +IMPL_CREATEINSTANCE_CTX( UnoControlTabPageContainerModel ) +IMPL_CREATEINSTANCE( AnimatedImagesControl ) +IMPL_CREATEINSTANCE_CTX( AnimatedImagesControlModel ) +IMPL_CREATEINSTANCE_CTX( SpinningProgressControlModel ) IMPL_CREATE_INSTANCE_WITH_GEOMETRY( UnoControlDialogModel ) diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index 496839ad1723..3802d29ea212 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -192,11 +192,10 @@ Polygon VCLUnoHelper::CreatePolygon( const ::com::sun::star::uno::Sequence< sal_ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer> VCLUnoHelper::CreateControlContainer( Window* pWindow ) { - const uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - UnoControlContainer* pContainer = new UnoControlContainer( xFactory, pWindow->GetComponentInterface( sal_True ) ); + UnoControlContainer* pContainer = new UnoControlContainer( pWindow->GetComponentInterface( sal_True ) ); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > x = pContainer; - UnoControlModel* pContainerModel = new UnoControlContainerModel( xFactory ); + UnoControlModel* pContainerModel = new UnoControlContainerModel( ::comphelper::getProcessComponentContext() ); pContainer->setModel( (::com::sun::star::awt::XControlModel*)pContainerModel ); return x; |