diff options
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 42 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolbase.cxx | 55 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrols.cxx | 26 | ||||
-rw-r--r-- | toolkit/source/helper/property.cxx | 6 |
5 files changed, 65 insertions, 68 deletions
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 001741c7430d..898a38b40468 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -5153,7 +5153,7 @@ IMPL_XTYPEPROVIDER_START( VCLXTimeField ) VCLXFormattedSpinField::getTypes() IMPL_XTYPEPROVIDER_END -void VCLXTimeField::setTime( sal_Int32 nTime ) throw(::com::sun::star::uno::RuntimeException) +void VCLXTimeField::setTime( sal_Int64 nTime ) throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; @@ -5170,11 +5170,11 @@ void VCLXTimeField::setTime( sal_Int32 nTime ) throw(::com::sun::star::uno::Runt } } -sal_Int32 VCLXTimeField::getTime() throw(::com::sun::star::uno::RuntimeException) +sal_Int64 VCLXTimeField::getTime() throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; - sal_Int32 nTime = 0; + sal_Int64 nTime = 0; TimeField* pTimeField = (TimeField*) GetWindow(); if ( pTimeField ) nTime = pTimeField->GetTime().GetTime(); @@ -5182,7 +5182,7 @@ sal_Int32 VCLXTimeField::getTime() throw(::com::sun::star::uno::RuntimeException return nTime; } -void VCLXTimeField::setMin( sal_Int32 nTime ) throw(::com::sun::star::uno::RuntimeException) +void VCLXTimeField::setMin( sal_Int64 nTime ) throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; @@ -5191,11 +5191,11 @@ void VCLXTimeField::setMin( sal_Int32 nTime ) throw(::com::sun::star::uno::Runti pTimeField->SetMin( nTime ); } -sal_Int32 VCLXTimeField::getMin() throw(::com::sun::star::uno::RuntimeException) +sal_Int64 VCLXTimeField::getMin() throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; - sal_Int32 nTime = 0; + sal_Int64 nTime = 0; TimeField* pTimeField = (TimeField*) GetWindow(); if ( pTimeField ) nTime = pTimeField->GetMin().GetTime(); @@ -5203,7 +5203,7 @@ sal_Int32 VCLXTimeField::getMin() throw(::com::sun::star::uno::RuntimeException) return nTime; } -void VCLXTimeField::setMax( sal_Int32 nTime ) throw(::com::sun::star::uno::RuntimeException) +void VCLXTimeField::setMax( sal_Int64 nTime ) throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; @@ -5212,11 +5212,11 @@ void VCLXTimeField::setMax( sal_Int32 nTime ) throw(::com::sun::star::uno::Runti pTimeField->SetMax( nTime ); } -sal_Int32 VCLXTimeField::getMax() throw(::com::sun::star::uno::RuntimeException) +sal_Int64 VCLXTimeField::getMax() throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; - sal_Int32 nTime = 0; + sal_Int64 nTime = 0; TimeField* pTimeField = (TimeField*) GetWindow(); if ( pTimeField ) nTime = pTimeField->GetMax().GetTime(); @@ -5224,7 +5224,7 @@ sal_Int32 VCLXTimeField::getMax() throw(::com::sun::star::uno::RuntimeException) return nTime; } -void VCLXTimeField::setFirst( sal_Int32 nTime ) throw(::com::sun::star::uno::RuntimeException) +void VCLXTimeField::setFirst( sal_Int64 nTime ) throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; @@ -5233,11 +5233,11 @@ void VCLXTimeField::setFirst( sal_Int32 nTime ) throw(::com::sun::star::uno::Run pTimeField->SetFirst( nTime ); } -sal_Int32 VCLXTimeField::getFirst() throw(::com::sun::star::uno::RuntimeException) +sal_Int64 VCLXTimeField::getFirst() throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; - sal_Int32 nTime = 0; + sal_Int64 nTime = 0; TimeField* pTimeField = (TimeField*) GetWindow(); if ( pTimeField ) nTime = pTimeField->GetFirst().GetTime(); @@ -5245,7 +5245,7 @@ sal_Int32 VCLXTimeField::getFirst() throw(::com::sun::star::uno::RuntimeExceptio return nTime; } -void VCLXTimeField::setLast( sal_Int32 nTime ) throw(::com::sun::star::uno::RuntimeException) +void VCLXTimeField::setLast( sal_Int64 nTime ) throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; @@ -5254,11 +5254,11 @@ void VCLXTimeField::setLast( sal_Int32 nTime ) throw(::com::sun::star::uno::Runt pTimeField->SetLast( nTime ); } -sal_Int32 VCLXTimeField::getLast() throw(::com::sun::star::uno::RuntimeException) +sal_Int64 VCLXTimeField::getLast() throw(::com::sun::star::uno::RuntimeException) { SolarMutexGuard aGuard; - sal_Int32 nTime = 0; + sal_Int64 nTime = 0; TimeField* pTimeField = (TimeField*) GetWindow(); if ( pTimeField ) nTime = pTimeField->GetLast().GetTime(); @@ -5314,7 +5314,7 @@ void VCLXTimeField::setProperty( const OUString& PropertyName, const ::com::sun: } else { - sal_Int32 n = 0; + sal_Int64 n = 0; if ( Value >>= n ) setTime( n ); } @@ -5322,14 +5322,14 @@ void VCLXTimeField::setProperty( const OUString& PropertyName, const ::com::sun: break; case BASEPROPERTY_TIMEMIN: { - sal_Int32 n = 0; + sal_Int64 n = 0; if ( Value >>= n ) setMin( n ); } break; case BASEPROPERTY_TIMEMAX: { - sal_Int32 n = 0; + sal_Int64 n = 0; if ( Value >>= n ) setMax( n ); } @@ -5368,17 +5368,17 @@ void VCLXTimeField::setProperty( const OUString& PropertyName, const ::com::sun: { case BASEPROPERTY_TIME: { - aProp <<= (sal_Int32) getTime(); + aProp <<= (sal_Int64) getTime(); } break; case BASEPROPERTY_TIMEMIN: { - aProp <<= (sal_Int32) getMin(); + aProp <<= (sal_Int64) getMin(); } break; case BASEPROPERTY_TIMEMAX: { - aProp <<= (sal_Int32) getMax(); + aProp <<= (sal_Int64) getMax(); } break; case BASEPROPERTY_ENFORCE_FORMAT: diff --git a/toolkit/source/controls/unocontrolbase.cxx b/toolkit/source/controls/unocontrolbase.cxx index 566d11bb3653..4f0cb43ace7f 100644 --- a/toolkit/source/controls/unocontrolbase.cxx +++ b/toolkit/source/controls/unocontrolbase.cxx @@ -112,59 +112,56 @@ void UnoControlBase::ImplSetPropertyValue( const OUString& aPropertyName, const return ::com::sun::star::uno::Any(); } -sal_Bool UnoControlBase::ImplGetPropertyValue_BOOL( sal_uInt16 nProp ) +template <typename T> T UnoControlBase::ImplGetPropertyValuePOD( sal_uInt16 nProp ) { - sal_Bool b = sal_False; + T t(0); if ( mxModel.is() ) { ::com::sun::star::uno::Any aVal = ImplGetPropertyValue( GetPropertyName( nProp ) ); - aVal >>= b; + aVal >>= t; } - return b; + return t; } -sal_Int16 UnoControlBase::ImplGetPropertyValue_INT16( sal_uInt16 nProp ) +template <typename T> T UnoControlBase::ImplGetPropertyValueClass( sal_uInt16 nProp ) { - sal_Int16 n = 0; + T t; if ( mxModel.is() ) { ::com::sun::star::uno::Any aVal = ImplGetPropertyValue( GetPropertyName( nProp ) ); - aVal >>= n; + aVal >>= t; } - return n; + return t; +} + +sal_Bool UnoControlBase::ImplGetPropertyValue_BOOL( sal_uInt16 nProp ) +{ + return ImplGetPropertyValuePOD<sal_Bool>(nProp); +} + +sal_Int16 UnoControlBase::ImplGetPropertyValue_INT16( sal_uInt16 nProp ) +{ + return ImplGetPropertyValuePOD<sal_Int16>(nProp); } sal_Int32 UnoControlBase::ImplGetPropertyValue_INT32( sal_uInt16 nProp ) { - sal_Int32 n = 0; - if ( mxModel.is() ) - { - ::com::sun::star::uno::Any aVal = ImplGetPropertyValue( GetPropertyName( nProp ) ); - aVal >>= n; - } - return n; + return ImplGetPropertyValuePOD<sal_Int32>(nProp); +} + +sal_Int64 UnoControlBase::ImplGetPropertyValue_INT64( sal_uInt16 nProp ) +{ + return ImplGetPropertyValuePOD<sal_Int64>(nProp); } double UnoControlBase::ImplGetPropertyValue_DOUBLE( sal_uInt16 nProp ) { - double n = 0; - if ( mxModel.is() ) - { - ::com::sun::star::uno::Any aVal = ImplGetPropertyValue( GetPropertyName( nProp ) ); - aVal >>= n; - } - return n; + return ImplGetPropertyValuePOD<double>(nProp); } OUString UnoControlBase::ImplGetPropertyValue_UString( sal_uInt16 nProp ) { - OUString aStr; - if ( mxModel.is() ) - { - ::com::sun::star::uno::Any aVal = ImplGetPropertyValue( GetPropertyName( nProp ) ); - aVal >>= aStr; - } - return aStr; + return ImplGetPropertyValueClass<OUString>(nProp); } ::com::sun::star::awt::Size UnoControlBase::Impl_getMinimumSize() diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index be3aa3bfa611..c2aa7b73a6a4 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -234,8 +234,8 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const case BASEPROPERTY_DATEMAX: aDefault <<= (sal_Int32) Date( 31, 12, 2200 ).GetDate(); break; case BASEPROPERTY_DATEMIN: aDefault <<= (sal_Int32) Date( 1, 1, 1900 ).GetDate(); break; - case BASEPROPERTY_TIMEMAX: aDefault <<= (sal_Int32) Time( 23, 59 ).GetTime(); break; - case BASEPROPERTY_TIMEMIN: aDefault <<= (sal_Int32) 0; break; + case BASEPROPERTY_TIMEMAX: aDefault <<= (sal_Int64) Time( 23, 59 ).GetTime(); break; + case BASEPROPERTY_TIMEMIN: aDefault <<= (sal_Int64) 0; break; case BASEPROPERTY_VALUEMAX_DOUBLE: aDefault <<= (double) 1000000; break; case BASEPROPERTY_VALUEMIN_DOUBLE: aDefault <<= (double) -1000000; break; case BASEPROPERTY_VALUESTEP_DOUBLE: aDefault <<= (double ) 1; break; diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 4b3a8f52ee04..c9d7f354cc2f 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -3539,43 +3539,43 @@ void UnoTimeFieldControl::textChanged( const awt::TextEvent& e ) throw(uno::Runt GetTextListeners().textChanged( e ); } -void UnoTimeFieldControl::setTime( sal_Int32 Time ) throw(uno::RuntimeException) +void UnoTimeFieldControl::setTime( sal_Int64 Time ) throw(uno::RuntimeException) { uno::Any aAny; aAny <<= Time; ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TIME ), aAny, sal_True ); } -sal_Int32 UnoTimeFieldControl::getTime() throw(uno::RuntimeException) +sal_Int64 UnoTimeFieldControl::getTime() throw(uno::RuntimeException) { - return ImplGetPropertyValue_INT32( BASEPROPERTY_TIME ); + return ImplGetPropertyValue_INT64( BASEPROPERTY_TIME ); } -void UnoTimeFieldControl::setMin( sal_Int32 Time ) throw(uno::RuntimeException) +void UnoTimeFieldControl::setMin( sal_Int64 Time ) throw(uno::RuntimeException) { uno::Any aAny; aAny <<= Time; ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TIMEMIN ), aAny, sal_True ); } -sal_Int32 UnoTimeFieldControl::getMin() throw(uno::RuntimeException) +sal_Int64 UnoTimeFieldControl::getMin() throw(uno::RuntimeException) { - return ImplGetPropertyValue_INT32( BASEPROPERTY_TIMEMIN ); + return ImplGetPropertyValue_INT64( BASEPROPERTY_TIMEMIN ); } -void UnoTimeFieldControl::setMax( sal_Int32 Time ) throw(uno::RuntimeException) +void UnoTimeFieldControl::setMax( sal_Int64 Time ) throw(uno::RuntimeException) { uno::Any aAny; aAny <<= Time; ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TIMEMAX ), aAny, sal_True ); } -sal_Int32 UnoTimeFieldControl::getMax() throw(uno::RuntimeException) +sal_Int64 UnoTimeFieldControl::getMax() throw(uno::RuntimeException) { - return ImplGetPropertyValue_INT32( BASEPROPERTY_TIMEMAX ); + return ImplGetPropertyValue_INT64( BASEPROPERTY_TIMEMAX ); } -void UnoTimeFieldControl::setFirst( sal_Int32 Time ) throw(uno::RuntimeException) +void UnoTimeFieldControl::setFirst( sal_Int64 Time ) throw(uno::RuntimeException) { mnFirst = Time; if ( getPeer().is() ) @@ -3585,12 +3585,12 @@ void UnoTimeFieldControl::setFirst( sal_Int32 Time ) throw(uno::RuntimeException } } -sal_Int32 UnoTimeFieldControl::getFirst() throw(uno::RuntimeException) +sal_Int64 UnoTimeFieldControl::getFirst() throw(uno::RuntimeException) { return mnFirst; } -void UnoTimeFieldControl::setLast( sal_Int32 Time ) throw(uno::RuntimeException) +void UnoTimeFieldControl::setLast( sal_Int64 Time ) throw(uno::RuntimeException) { mnLast = Time; if ( getPeer().is() ) @@ -3600,7 +3600,7 @@ void UnoTimeFieldControl::setLast( sal_Int32 Time ) throw(uno::RuntimeException) } } -sal_Int32 UnoTimeFieldControl::getLast() throw(uno::RuntimeException) +sal_Int64 UnoTimeFieldControl::getLast() throw(uno::RuntimeException) { return mnLast; } diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index 451d048f7cd7..9926b3c77e71 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -231,10 +231,10 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) DECL_PROP_2 ( "Text", TEXT, OUString, BOUND, MAYBEDEFAULT ), DECL_PROP_3 ( "TextColor", TEXTCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), DECL_PROP_3 ( "TextLineColor", TEXTLINECOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), - DECL_DEP_PROP_3 ( "Time", TIME, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_DEP_PROP_3 ( "Time", TIME, sal_Int64, BOUND, MAYBEDEFAULT, MAYBEVOID ), DECL_PROP_2 ( "TimeFormat", EXTTIMEFORMAT, sal_Int16, BOUND, MAYBEDEFAULT ), - DECL_PROP_2 ( "TimeMax", TIMEMAX, sal_Int32, BOUND, MAYBEDEFAULT ), - DECL_PROP_2 ( "TimeMin", TIMEMIN, sal_Int32, BOUND, MAYBEDEFAULT ), + DECL_PROP_2 ( "TimeMax", TIMEMAX, sal_Int64, BOUND, MAYBEDEFAULT ), + DECL_PROP_2 ( "TimeMin", TIMEMIN, sal_Int64, BOUND, MAYBEDEFAULT ), DECL_PROP_2 ( "Title", TITLE, OUString, BOUND, MAYBEDEFAULT ), DECL_PROP_2 ( "Toggle", TOGGLE, bool, BOUND, MAYBEDEFAULT ), DECL_PROP_3 ( "TreatAsNumber", TREATASNUMBER, bool, BOUND, MAYBEDEFAULT,TRANSIENT ), |