diff options
-rw-r--r-- | extensions/source/propctrlr/commoncontrol.hxx | 24 | ||||
-rw-r--r-- | extensions/source/propctrlr/standardcontrol.cxx | 13 | ||||
-rw-r--r-- | extensions/source/propctrlr/standardcontrol.hxx | 39 | ||||
-rw-r--r-- | extensions/source/propctrlr/usercontrol.cxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/usercontrol.hxx | 16 |
5 files changed, 34 insertions, 61 deletions
diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx index 3a3509a484c8..379ce65c9dc5 100644 --- a/extensions/source/propctrlr/commoncontrol.hxx +++ b/extensions/source/propctrlr/commoncontrol.hxx @@ -35,27 +35,6 @@ namespace pcr { - class CommonBehaviourControlHelper; - - template< class TControlWindow > - class ControlWindow : public TControlWindow - { - protected: - CommonBehaviourControlHelper* m_pHelper; - - public: - ControlWindow( vcl::Window* _pParent, WinBits _nStyle ) - :TControlWindow( _pParent, _nStyle ) - ,m_pHelper( NULL ) - { - } - - /// sets a CommonBehaviourControlHelper instance which some functionality is delegated to - virtual void setControlHelper( CommonBehaviourControlHelper& _rControlHelper ) - { m_pHelper = &_rControlHelper; } - }; - - //= CommonBehaviourControlHelper /** A helper class for implementing the <type scope="css::inspection">XPropertyControl</type> @@ -121,7 +100,7 @@ namespace pcr @param TControlInterface an interface class which is derived from (or identical to) <type scope="css::inspection">XPropertyControl</type> @param TControlWindow - a class which is derived from ControlWindow + a class which is derived from vcl::Window */ template < class TControlInterface, class TControlWindow > class CommonBehaviourControl :public ::comphelper::OBaseMutex @@ -180,7 +159,6 @@ namespace pcr ,CommonBehaviourControlHelper( _nControlType, *this ) ,m_pControlWindow( new TControlWindow( _pParentWindow, _nWindowStyle ) ) { - m_pControlWindow->setControlHelper( *this ); if ( _bDoSetHandlers ) { m_pControlWindow->SetModifyHdl( LINK( this, CommonBehaviourControlHelper, ModifiedHdl ) ); diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 3620e383dd08..e343a6cc4c10 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -115,7 +115,7 @@ namespace pcr ODateControl::ODateControl( vcl::Window* pParent, WinBits nWinStyle ) :ODateControl_Base( PropertyControlType::DateField, pParent, nWinStyle | WB_DROPDOWN ) { - ControlWindow<CalendarField>* pControlWindow = getTypedControlWindow(); + CalendarField* pControlWindow = getTypedControlWindow(); pControlWindow->SetStrictFormat(true); pControlWindow->SetMin( ::Date( 1,1,1600 ) ); @@ -1031,7 +1031,7 @@ namespace pcr DropDownEditControl::DropDownEditControl( vcl::Window* _pParent, WinBits _nStyle ) - :DropDownEditControl_Base( _pParent, _nStyle ) + :Edit( _pParent, _nStyle ) ,m_pFloatingEdit( NULL ) ,m_pDropdownButton( NULL ) ,m_nOperationMode( eStringList ) @@ -1060,7 +1060,7 @@ namespace pcr void DropDownEditControl::setControlHelper( CommonBehaviourControlHelper& _rControlHelper ) { - DropDownEditControl_Base::setControlHelper( _rControlHelper ); + m_pHelper = &_rControlHelper; m_pFloatingEdit->getEdit().SetModifyHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, ModifiedHdl ) ); m_pImplEdit->SetGetFocusHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, GetFocusHdl ) ); m_pImplEdit->SetModifyHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, ModifiedHdl ) ); @@ -1079,7 +1079,7 @@ namespace pcr m_pImplEdit.disposeAndClear(); m_pFloatingEdit.disposeAndClear(); m_pDropdownButton.disposeAndClear(); - DropDownEditControl_Base::dispose(); + Edit::dispose(); } @@ -1127,7 +1127,7 @@ namespace pcr || m_nOperationMode == eMultiLineText ) { - bResult = DropDownEditControl_Base::PreNotify( rNEvt ); + bResult = Edit::PreNotify( rNEvt ); } else if ( m_nOperationMode == eStringList ) { @@ -1151,7 +1151,7 @@ namespace pcr } } else - bResult = DropDownEditControl_Base::PreNotify(rNEvt); + bResult = Edit::PreNotify(rNEvt); return bResult; } @@ -1362,6 +1362,7 @@ namespace pcr , false ) { getTypedControlWindow()->setOperationMode( _eMode ); + getTypedControlWindow()->setControlHelper( *this ); } diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index 8c2220c7bf47..e931921dbe6e 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -52,24 +52,21 @@ namespace pcr as all other windows. */ template< class TListboxWindow > - class ListLikeControlWithModifyHandler : public ControlWindow< TListboxWindow > + class ListLikeControlWithModifyHandler : public TListboxWindow { - protected: - typedef ControlWindow< TListboxWindow > ListBoxType; - public: ListLikeControlWithModifyHandler( vcl::Window* _pParent, WinBits _nStyle ) - :ListBoxType( _pParent, _nStyle ) + : TListboxWindow( _pParent, _nStyle ) { } - void SetModifyHdl( const Link<>& _rLink ) { ListBoxType::SetSelectHdl( _rLink ); } + void SetModifyHdl( const Link<>& _rLink ) { TListboxWindow::SetSelectHdl( _rLink ); } }; //= OTimeControl - typedef CommonBehaviourControl< css::inspection::XPropertyControl, ControlWindow< TimeField > > OTimeControl_Base; + typedef CommonBehaviourControl< css::inspection::XPropertyControl, TimeField > OTimeControl_Base; class OTimeControl : public OTimeControl_Base { public: @@ -84,7 +81,7 @@ namespace pcr //= ODateControl - typedef CommonBehaviourControl< css::inspection::XPropertyControl, ControlWindow< CalendarField > > ODateControl_Base; + typedef CommonBehaviourControl< css::inspection::XPropertyControl, CalendarField > ODateControl_Base; class ODateControl : public ODateControl_Base { public: @@ -99,7 +96,7 @@ namespace pcr //= OEditControl - typedef CommonBehaviourControl< css::inspection::XPropertyControl, ControlWindow< Edit > > OEditControl_Base; + typedef CommonBehaviourControl< css::inspection::XPropertyControl, Edit > OEditControl_Base; class OEditControl : public OEditControl_Base { protected: @@ -121,7 +118,7 @@ namespace pcr //= ODateTimeControl - typedef CommonBehaviourControl< css::inspection::XPropertyControl, ControlWindow< FormattedField > > ODateTimeControl_Base; + typedef CommonBehaviourControl< css::inspection::XPropertyControl, FormattedField > ODateTimeControl_Base; class ODateTimeControl : public ODateTimeControl_Base { public: @@ -164,7 +161,7 @@ namespace pcr //= OHyperlinkControl - typedef CommonBehaviourControl< css::inspection::XHyperlinkControl, ControlWindow< HyperlinkInput > > OHyperlinkControl_Base; + typedef CommonBehaviourControl< css::inspection::XHyperlinkControl, HyperlinkInput > OHyperlinkControl_Base; class OHyperlinkControl : public OHyperlinkControl_Base { private: @@ -193,13 +190,11 @@ namespace pcr //= CustomConvertibleNumericField - class CustomConvertibleNumericField : public ControlWindow< MetricField > + class CustomConvertibleNumericField : public MetricField { - typedef ControlWindow< MetricField > BaseClass; - public: CustomConvertibleNumericField( vcl::Window* _pParent, WinBits _nStyle ) - :BaseClass( _pParent, _nStyle ) + :MetricField( _pParent, _nStyle ) { } @@ -310,7 +305,7 @@ namespace pcr //= OComboboxControl - typedef CommonBehaviourControl< css::inspection::XStringListControl, ControlWindow< ComboBox > > OComboboxControl_Base; + typedef CommonBehaviourControl< css::inspection::XStringListControl, ComboBox > OComboboxControl_Base; class OComboboxControl : public OComboboxControl_Base { public: @@ -343,23 +338,24 @@ namespace pcr //= DropDownEditControl class OMultilineFloatingEdit; - typedef ControlWindow< Edit > DropDownEditControl_Base; /** an Edit field which can be used as ControlWindow, and has a drop-down button */ - class DropDownEditControl : public DropDownEditControl_Base + class DropDownEditControl : public Edit { private: - VclPtr<OMultilineFloatingEdit> m_pFloatingEdit; + VclPtr<OMultilineFloatingEdit> m_pFloatingEdit; VclPtr<MultiLineEdit> m_pImplEdit; - VclPtr<PushButton> m_pDropdownButton; + VclPtr<PushButton> m_pDropdownButton; MultiLineOperationMode m_nOperationMode; bool m_bDropdown : 1; + CommonBehaviourControlHelper* m_pHelper; public: DropDownEditControl( vcl::Window* _pParent, WinBits _nStyle ); virtual ~DropDownEditControl(); virtual void dispose() SAL_OVERRIDE; + void setControlHelper( CommonBehaviourControlHelper& _rControlHelper ); void setOperationMode( MultiLineOperationMode _eMode ) { m_nOperationMode = _eMode; } MultiLineOperationMode getOperationMode() const { return m_nOperationMode; } @@ -370,9 +366,6 @@ namespace pcr StlSyntaxSequence< OUString > GetStringListValue() const; - // ControlWindow overridables - virtual void setControlHelper( CommonBehaviourControlHelper& _rControlHelper ) SAL_OVERRIDE; - protected: // Window overridables virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index be37b74b3b59..a11962a2a53a 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -61,7 +61,7 @@ namespace pcr } } - return BaseClass::PreNotify( rNEvt ); + return FormattedField::PreNotify( rNEvt ); } @@ -90,6 +90,7 @@ namespace pcr OFormatSampleControl::OFormatSampleControl( vcl::Window* pParent, WinBits nWinStyle ) :OFormatSampleControl_Base( PropertyControlType::Unknown, pParent, nWinStyle ) { + getTypedControlWindow()->setControlHelper(*this); } diff --git a/extensions/source/propctrlr/usercontrol.hxx b/extensions/source/propctrlr/usercontrol.hxx index 0fd96b9ba407..f10750bc1790 100644 --- a/extensions/source/propctrlr/usercontrol.hxx +++ b/extensions/source/propctrlr/usercontrol.hxx @@ -35,21 +35,21 @@ namespace pcr //= NumberFormatSampleField - class NumberFormatSampleField : public ControlWindow< FormattedField > + class NumberFormatSampleField : public FormattedField { - private: - typedef ControlWindow< FormattedField > BaseClass; - public: NumberFormatSampleField( vcl::Window* _pParent, WinBits _nStyle ) - :BaseClass( _pParent, _nStyle ) + :FormattedField( _pParent, _nStyle ) { } - void SetFormatSupplier( const SvNumberFormatsSupplierObj* pSupplier ); + void SetFormatSupplier( const SvNumberFormatsSupplierObj* pSupplier ); + void setControlHelper( CommonBehaviourControlHelper& _rControlHelper ) { m_pHelper = &_rControlHelper; } protected: virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; + private: + CommonBehaviourControlHelper* m_pHelper; }; @@ -95,7 +95,7 @@ namespace pcr //= OFormattedNumericControl - typedef CommonBehaviourControl< css::inspection::XPropertyControl, ControlWindow< FormattedField > > OFormattedNumericControl_Base; + typedef CommonBehaviourControl< css::inspection::XPropertyControl, FormattedField > OFormattedNumericControl_Base; class OFormattedNumericControl : public OFormattedNumericControl_Base { private: @@ -124,7 +124,7 @@ namespace pcr //= OFileUrlControl - typedef CommonBehaviourControl< css::inspection::XPropertyControl, ControlWindow< ::svt::FileURLBox > > OFileUrlControl_Base; + typedef CommonBehaviourControl< css::inspection::XPropertyControl, ::svt::FileURLBox > OFileUrlControl_Base; class OFileUrlControl : public OFileUrlControl_Base { public: |