diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-03 19:48:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-05 16:45:21 +0200 |
commit | d60bc5d0827247797811d766aafb7d26a502152f (patch) | |
tree | f576c6f091348b271547a96c83fe204f2938938b /svx | |
parent | 697f635fb8316d2c325ccdf9040cd0e371cdd6e5 (diff) |
clarify this arg is to determine if its a spinbutton or entry variant
Change-Id: If102441312bf0c6d27462535268e79242bcde48c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97894
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 26 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 10 |
2 files changed, 18 insertions, 18 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 4a2a452b3ecb..2a4213ffcede 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1851,20 +1851,19 @@ DbSpinField::DbSpinField( DbGridColumn& _rColumn, sal_Int16 _nStandardAlign ) { } - void DbSpinField::Init( vcl::Window& _rParent, const Reference< XRowSet >& _rxCursor ) { m_rColumn.SetAlignmentFromModel( m_nStandardAlign ); Reference< XPropertySet > xModel( m_rColumn.getModel() ); - // determine the WinBits for the field - WinBits nFieldStyle = 0; + // determine if we need a spinbutton version + bool bSpinButton(false); if ( ::comphelper::getBOOL( xModel->getPropertyValue( FM_PROP_SPIN ) ) ) - nFieldStyle = WB_REPEAT | WB_SPIN; + bSpinButton = true; // create the fields - m_pWindow = createField( &_rParent, nFieldStyle, xModel ); - m_pPainter = createField( &_rParent, nFieldStyle, xModel ); + m_pWindow = createField( &_rParent, bSpinButton, xModel ); + m_pPainter = createField( &_rParent, bSpinButton, xModel ); // adjust all other settings which depend on the property values implAdjustGenericFieldSetting( xModel ); @@ -1873,7 +1872,6 @@ void DbSpinField::Init( vcl::Window& _rParent, const Reference< XRowSet >& _rxCu DbCellControl::Init( _rParent, _rxCursor ); } - CellControllerRef DbSpinField::CreateController() const { return new SpinCellController( static_cast< SpinField* >( m_pWindow.get() ) ); @@ -1946,8 +1944,9 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe rPaintFormatter.SetFormat( sFormatString, aAppLanguage ); } -VclPtr<SpinField> DbNumericField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) +VclPtr<SpinField> DbNumericField::createField( vcl::Window* _pParent, bool bSpinButton, const Reference< XPropertySet >& /*_rxModel*/ ) { + WinBits _nFieldStyle = bSpinButton ? (WB_REPEAT | WB_SPIN) : 0; return VclPtr<DoubleNumericField>::Create( _pParent, _nFieldStyle ); } @@ -2074,8 +2073,9 @@ void DbCurrencyField::implAdjustGenericFieldSetting( const Reference< XPropertyS } -VclPtr<SpinField> DbCurrencyField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) +VclPtr<SpinField> DbCurrencyField::createField( vcl::Window* _pParent, bool bSpinButton, const Reference< XPropertySet >& /*_rxModel*/ ) { + WinBits _nFieldStyle = bSpinButton ? (WB_REPEAT | WB_SPIN) : 0; return VclPtr<LongCurrencyField>::Create( _pParent, _nFieldStyle ); } @@ -2179,8 +2179,9 @@ DbDateField::DbDateField( DbGridColumn& _rColumn ) doPropertyListening( FM_PROP_DATE_SHOW_CENTURY ); } -VclPtr<SpinField> DbDateField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& _rxModel ) +VclPtr<SpinField> DbDateField::createField( vcl::Window* _pParent, bool bSpinButton, const Reference< XPropertySet >& _rxModel ) { + WinBits _nFieldStyle = bSpinButton ? (WB_REPEAT | WB_SPIN) : 0; // check if there is a DropDown property set to TRUE bool bDropDown = !hasProperty( FM_PROP_DROPDOWN, _rxModel ) || getBOOL( _rxModel->getPropertyValue( FM_PROP_DROPDOWN ) ); @@ -2305,13 +2306,12 @@ DbTimeField::DbTimeField( DbGridColumn& _rColumn ) doPropertyListening( FM_PROP_STRICTFORMAT ); } - -VclPtr<SpinField> DbTimeField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) +VclPtr<SpinField> DbTimeField::createField( vcl::Window* _pParent, bool bSpinButton, const Reference< XPropertySet >& /*_rxModel*/ ) { + WinBits _nFieldStyle = bSpinButton ? (WB_REPEAT | WB_SPIN) : 0; return VclPtr<TimeField>::Create( _pParent, _nFieldStyle ); } - void DbTimeField::implAdjustGenericFieldSetting( const Reference< XPropertySet >& _rxModel ) { DBG_ASSERT( m_pWindow, "DbTimeField::implAdjustGenericFieldSetting: not to be called without window!" ); diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index 2e43144fcb1d..2491152cbf0d 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -547,7 +547,7 @@ public: protected: virtual VclPtr<SpinField> createField( vcl::Window* _pParent, - WinBits _nFieldStyle, + bool bSpinButton, const css::uno::Reference< css::beans::XPropertySet >& _rxModel ) = 0; }; @@ -568,7 +568,7 @@ protected: // DbSpinField virtual VclPtr<SpinField> createField( vcl::Window* _pParent, - WinBits _nFieldStyle, + bool bSpinButton, const css::uno::Reference< css::beans::XPropertySet >& _rxModel ) override; @@ -592,7 +592,7 @@ protected: // DbSpinField virtual VclPtr<SpinField> createField( vcl::Window* _pParent, - WinBits _nFieldStyle, + bool bSpinButton, const css::uno::Reference< css::beans::XPropertySet >& _rxModel ) override; @@ -620,7 +620,7 @@ protected: // DbSpinField virtual VclPtr<SpinField> createField( vcl::Window* _pParent, - WinBits _nFieldStyle, + bool bSpinButton, const css::uno::Reference< css::beans::XPropertySet >& _rxModel ) override; @@ -644,7 +644,7 @@ protected: // DbSpinField virtual VclPtr<SpinField> createField( vcl::Window* _pParent, - WinBits _nFieldStyle, + bool bSpinButton, const css::uno::Reference< css::beans::XPropertySet >& _rxModel ) override; |