diff options
author | Kurt Zenker <kz@openoffice.org> | 2007-05-10 09:50:15 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2007-05-10 09:50:15 +0000 |
commit | ba7aa1a1da75d83608abbb5be03c845e0a5eda9a (patch) | |
tree | 3bfbc0287a027fe41f9637fd346e3f7850567bb2 /extensions/source/propctrlr/standardcontrol.cxx | |
parent | bb766a7d65d7fb43417731e54927bd8725e31119 (diff) |
INTEGRATION: CWS dba23a (1.24.98); FILE MERGED
2007/03/01 13:43:30 fs 1.24.98.4: numeric min/max are sal_Int64 since recently
2007/03/01 12:02:14 fs 1.24.98.3: #i74061# support for read-only object inspector
2007/02/22 11:22:27 fs 1.24.98.2: #i73260# misc warning issues
2007/02/22 10:58:15 fs 1.24.98.1: #i68961# lcl_convertListToDisplayText: use an OUStringBuffer, which means that the resulting string is cut to 0 characters if too long
Diffstat (limited to 'extensions/source/propctrlr/standardcontrol.cxx')
-rw-r--r-- | extensions/source/propctrlr/standardcontrol.cxx | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index deb43327cdb7..910d70f3b69c 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -4,9 +4,9 @@ * * $RCSfile: standardcontrol.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: obo $ $Date: 2006-09-16 13:23:43 $ + * last change: $Author: kz $ $Date: 2007-05-10 10:50:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -575,11 +575,11 @@ namespace pcr { Optional< double > aReturn( sal_True, 0 ); - long minValue = getTypedControlWindow()->GetMin(); - if ( minValue == ::std::numeric_limits< long >::min() ) + sal_Int64 minValue = getTypedControlWindow()->GetMin(); + if ( minValue == ::std::numeric_limits< sal_Int64 >::min() ) aReturn.IsPresent = sal_False; else - aReturn.Value = minValue; + aReturn.Value = (double)minValue; return aReturn; } @@ -588,7 +588,7 @@ namespace pcr void SAL_CALL ONumericControl::setMinValue( const Optional< double >& _minvalue ) throw (RuntimeException) { if ( !_minvalue.IsPresent ) - getTypedControlWindow()->SetMin( ::std::numeric_limits< long >::min() ); + getTypedControlWindow()->SetMin( ::std::numeric_limits< sal_Int64 >::min() ); else getTypedControlWindow()->SetMin( impl_apiValueToFieldValue_nothrow( _minvalue.Value ) ); } @@ -598,11 +598,11 @@ namespace pcr { Optional< double > aReturn( sal_True, 0 ); - long maxValue = getTypedControlWindow()->GetMax(); - if ( maxValue == ::std::numeric_limits< long >::max() ) + sal_Int64 maxValue = getTypedControlWindow()->GetMax(); + if ( maxValue == ::std::numeric_limits< sal_Int64 >::max() ) aReturn.IsPresent = sal_False; else - aReturn.Value = maxValue; + aReturn.Value = (double)maxValue; return aReturn; } @@ -611,7 +611,7 @@ namespace pcr void SAL_CALL ONumericControl::setMaxValue( const Optional< double >& _maxvalue ) throw (RuntimeException) { if ( !_maxvalue.IsPresent ) - getTypedControlWindow()->SetMax( ::std::numeric_limits< long >::max() ); + getTypedControlWindow()->SetMax( ::std::numeric_limits< sal_Int64 >::max() ); else getTypedControlWindow()->SetMax( impl_apiValueToFieldValue_nothrow( _maxvalue.Value ) ); } @@ -685,9 +685,9 @@ namespace pcr } //------------------------------------------------------------------ - double ONumericControl::impl_fieldValueToApiValue_nothrow( long _nFieldValue ) const + double ONumericControl::impl_fieldValueToApiValue_nothrow( sal_Int64 _nFieldValue ) const { - double nApiValue = ImplCalcDoubleValue( _nFieldValue, getTypedControlWindow()->GetDecimalDigits() ); + double nApiValue = ImplCalcDoubleValue( (long)_nFieldValue, getTypedControlWindow()->GetDecimalDigits() ); nApiValue *= m_nFieldToUNOValueFactor; return nApiValue; } @@ -766,6 +766,11 @@ namespace pcr } getTypedControlWindow()->SetDropDownLineCount( LB_DEFAULT_COUNT ); + if ( ( nWinStyle & WB_READONLY ) != 0 ) + { + getTypedControlWindow()->SetReadOnly( TRUE ); + getTypedControlWindow()->Enable( TRUE ); + } } //------------------------------------------------------------------ @@ -863,6 +868,11 @@ namespace pcr :OListboxControl_Base( PropertyControlType::ListBox, pParent, nWinStyle ) { getTypedControlWindow()->SetDropDownLineCount( LB_DEFAULT_COUNT ); + if ( ( nWinStyle & WB_READONLY ) != 0 ) + { + getTypedControlWindow()->SetReadOnly( TRUE ); + getTypedControlWindow()->Enable( TRUE ); + } } //------------------------------------------------------------------ @@ -1205,19 +1215,19 @@ namespace pcr //.............................................................. String lcl_convertListToDisplayText( const StlSyntaxSequence< ::rtl::OUString >& _rStrings ) { - String sComposed; + ::rtl::OUStringBuffer aComposed; for ( StlSyntaxSequence< ::rtl::OUString >::const_iterator strings = _rStrings.begin(); strings != _rStrings.end(); ++strings ) { if ( strings != _rStrings.begin() ) - sComposed += ';'; - sComposed += '\"'; - sComposed += String( *strings ); - sComposed += '\"'; + aComposed.append( (sal_Unicode)';' ); + aComposed.append( (sal_Unicode)'\"' ); + aComposed.append( *strings ); + aComposed.append( (sal_Unicode)'\"' ); } - return sComposed; + return aComposed.makeStringAndClear(); } } @@ -1360,7 +1370,7 @@ namespace pcr //------------------------------------------------------------------ void DropDownEditControl::SetTextValue( const ::rtl::OUString& _rText ) { - OSL_PRECOND( m_nOperationMode == eMultiLineText, "DropDownEditControl::GetTextValue: illegal call!" ); + OSL_PRECOND( m_nOperationMode == eMultiLineText, "DropDownEditControl::SetTextValue: illegal call!" ); m_pFloatingEdit->getEdit()->SetText( _rText ); SetText( _rText ); |