[Libreoffice-commits] core.git: include/toolkit offapi/com offapi/type_reference qadevOOo/tests svx/source toolkit/source vcl/source xmloff/source

Lionel Elie Mamane lionel at mamane.lu
Fri Aug 2 04:36:26 PDT 2013


 include/toolkit/awt/vclxwindows.hxx              |   20 +++---
 include/toolkit/controls/unocontrolbase.hxx      |    3 +
 include/toolkit/controls/unocontrols.hxx         |   20 +++---
 include/toolkit/helper/property.hxx              |    6 +-
 offapi/com/sun/star/awt/XTimeField.idl           |   26 ++++----
 offapi/type_reference/offapi.rdb                 |binary
 qadevOOo/tests/java/ifc/awt/_XTimeField.java     |    4 -
 svx/source/fmcomp/gridcell.cxx                   |    8 +-
 svx/source/form/fmobjfac.cxx                     |    2 
 toolkit/source/awt/vclxwindows.cxx               |   42 +++++++-------
 toolkit/source/controls/unocontrolbase.cxx       |   55 ++++++++----------
 toolkit/source/controls/unocontrolmodel.cxx      |    4 -
 toolkit/source/controls/unocontrols.cxx          |   26 ++++----
 toolkit/source/helper/property.cxx               |    6 +-
 vcl/source/control/field2.cxx                    |   67 ++++++++++++-----------
 xmloff/source/forms/handler/vcl_time_handler.cxx |    8 +-
 16 files changed, 151 insertions(+), 146 deletions(-)

New commits:
commit ed904af8665f6f7590fedd4ad608018f78c686c1
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Sun Jul 28 16:08:26 2013 +0200

    fdo#67235 adapt form control code to time nanosecond API change
    
    Conflicts:
    	offapi/type_reference/offapi.rdb
    
    Change-Id: If68ecf0691919d71d06d7b97d46db115013f9805
    Reviewed-on: https://gerrit.libreoffice.org/5149
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/include/toolkit/awt/vclxwindows.hxx b/include/toolkit/awt/vclxwindows.hxx
index f822b0c..a3a9f1b 100644
--- a/include/toolkit/awt/vclxwindows.hxx
+++ b/include/toolkit/awt/vclxwindows.hxx
@@ -1019,16 +1019,16 @@ public:
     ::com::sun::star::uno::Sequence< sal_Int8 >                     SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
 
     // ::com::sun::star::awt::XTimeField
-    void SAL_CALL setTime( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getTime(  ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL setMin( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getMin(  ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL setMax( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getMax(  ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL setFirst( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getFirst(  ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL setLast( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getLast(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setTime( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getTime(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setMin( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getMin(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setMax( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getMax(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setFirst( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getFirst(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setLast( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getLast(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL setEmpty(  ) throw(::com::sun::star::uno::RuntimeException);
     sal_Bool SAL_CALL isEmpty(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/include/toolkit/controls/unocontrolbase.hxx b/include/toolkit/controls/unocontrolbase.hxx
index 30f1bf6..1fa03a8 100644
--- a/include/toolkit/controls/unocontrolbase.hxx
+++ b/include/toolkit/controls/unocontrolbase.hxx
@@ -39,9 +39,12 @@ protected:
     void                        ImplSetPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues, sal_Bool bUpdateThis );
     ::com::sun::star::uno::Any  ImplGetPropertyValue( const OUString& aPropertyName );
 
+    template <typename T> T ImplGetPropertyValuePOD( sal_uInt16 nProp );
+    template <typename T> T ImplGetPropertyValueClass( sal_uInt16 nProp );
     sal_Bool        ImplGetPropertyValue_BOOL( sal_uInt16 nProp );
     sal_Int16       ImplGetPropertyValue_INT16( sal_uInt16 nProp );
     sal_Int32       ImplGetPropertyValue_INT32( sal_uInt16 nProp );
+    sal_Int64       ImplGetPropertyValue_INT64( sal_uInt16 nProp );
     double          ImplGetPropertyValue_DOUBLE( sal_uInt16 nProp );
     OUString ImplGetPropertyValue_UString( sal_uInt16 nProp );
 
diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx
index 0d3119f..fdcb44a 100644
--- a/include/toolkit/controls/unocontrols.hxx
+++ b/include/toolkit/controls/unocontrols.hxx
@@ -1179,16 +1179,16 @@ public:
     void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
 
     //XTimeField
-    void SAL_CALL setTime( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getTime(  ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL setMin( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getMin(  ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL setMax( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getMax(  ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL setFirst( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getFirst(  ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL setLast( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 SAL_CALL getLast(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setTime( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getTime(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setMin( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getMin(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setMax( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getMax(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setFirst( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getFirst(  ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setLast( sal_Int64 Time ) throw(::com::sun::star::uno::RuntimeException);
+    sal_Int64 SAL_CALL getLast(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL setEmpty(  ) throw(::com::sun::star::uno::RuntimeException);
     sal_Bool SAL_CALL isEmpty(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/include/toolkit/helper/property.hxx b/include/toolkit/helper/property.hxx
index fa1fbbf..5f009dd 100644
--- a/include/toolkit/helper/property.hxx
+++ b/include/toolkit/helper/property.hxx
@@ -68,9 +68,9 @@ namespace uno {
 #define BASEPROPERTY_DATE                            30 // sal_Int32
 #define BASEPROPERTY_DATEMIN                         31 // sal_Int32
 #define BASEPROPERTY_DATEMAX                         32 // sal_Int32
-#define BASEPROPERTY_TIME                            33 // sal_Int32
-#define BASEPROPERTY_TIMEMIN                         34 // sal_Int32
-#define BASEPROPERTY_TIMEMAX                         35 // sal_Int32
+#define BASEPROPERTY_TIME                            33 // sal_Int64
+#define BASEPROPERTY_TIMEMIN                         34 // sal_Int64
+#define BASEPROPERTY_TIMEMAX                         35 // sal_Int64
 #define BASEPROPERTY_VALUE_INT32                     36 // sal_Int32
 #define BASEPROPERTY_VALUEMIN_INT32                  37 // sal_Int32
 #define BASEPROPERTY_VALUEMAX_INT32                  38 // sal_Int32
diff --git a/offapi/com/sun/star/awt/XTimeField.idl b/offapi/com/sun/star/awt/XTimeField.idl
index 73cb16a..0e056e8 100644
--- a/offapi/com/sun/star/awt/XTimeField.idl
+++ b/offapi/com/sun/star/awt/XTimeField.idl
@@ -33,58 +33,58 @@ published interface XTimeField: com::sun::star::uno::XInterface
 
     /** sets the time value which is displayed in the time field.
 
-        <p>The time value must be specified in the format HHMMSShh,
-        where HH are hours, MM are minutes, SS are seconds and hh are
-        hundredth seconds.</p>
+        <p>The time value must be specified in the format HHMMSSnnnnnnnnn,
+        where HH are hours, MM are minutes, SS are seconds and
+        nnnnnnnnn are nanoseconds.</p>
      */
-    void setTime( [in] long Time );
+    void setTime( [in] hyper Time );
 
 
     /** returns the time value which is currently displayed in the time field.
      */
-    long getTime();
+    hyper getTime();
 
 
     /** sets the minimum time value that can be entered by the user.
      */
-    void setMin( [in] long Time );
+    void setMin( [in] hyper Time );
 
 
     /** returns the currently set minimum time value that can be entered by
         the user.
      */
-    long getMin();
+    hyper getMin();
 
 
     /** sets the maximum time value that can be entered by the user.
      */
-    void setMax( [in] long Time );
+    void setMax( [in] hyper Time );
 
 
     /** returns the currently set maximum time value that can be entered by
         the user.
      */
-    long getMax();
+    hyper getMax();
 
 
     /** sets the first value to be set on POS1 key.
      */
-    void setFirst( [in] long Time );
+    void setFirst( [in] hyper Time );
 
 
     /** returns the currently set first value which is set on POS1 key.
      */
-    long getFirst();
+    hyper getFirst();
 
 
     /** sets the last value to be set on END key.
      */
-    void setLast( [in] long Time );
+    void setLast( [in] hyper Time );
 
 
     /** returns the currently set last value which is set on END key.
      */
-    long getLast();
+    hyper getLast();
 
 
     /** sets an empty value for the time.
diff --git a/offapi/type_reference/offapi.rdb b/offapi/type_reference/offapi.rdb
index fd83b22..c09e824 100644
Binary files a/offapi/type_reference/offapi.rdb and b/offapi/type_reference/offapi.rdb differ
diff --git a/qadevOOo/tests/java/ifc/awt/_XTimeField.java b/qadevOOo/tests/java/ifc/awt/_XTimeField.java
index b0061c9..77cde0f 100644
--- a/qadevOOo/tests/java/ifc/awt/_XTimeField.java
+++ b/qadevOOo/tests/java/ifc/awt/_XTimeField.java
@@ -174,7 +174,7 @@ public class _XTimeField extends MultiMethodTest {
     public void _getFirst() {
 
         boolean result = true ;
-        int val = oObj.getFirst() ;
+        long val = oObj.getFirst() ;
 
         log.println("getFirst() = " + val) ;
 
@@ -210,7 +210,7 @@ public class _XTimeField extends MultiMethodTest {
     public void _getLast() {
 
         boolean result = true ;
-        int val = oObj.getLast() ;
+        long val = oObj.getLast() ;
 
         log.println("getLast() = " + val) ;
 
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index c81d1e0..79a5ae8 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -2369,8 +2369,8 @@ void DbTimeField::implAdjustGenericFieldSetting( const Reference< XPropertySet >
     if ( m_pWindow && _rxModel.is() )
     {
         sal_Int16   nFormat     = getINT16( _rxModel->getPropertyValue( FM_PROP_TIMEFORMAT ) );
-        sal_Int32   nMin        = getINT32( _rxModel->getPropertyValue( FM_PROP_TIMEMIN ) );
-        sal_Int32   nMax        = getINT32( _rxModel->getPropertyValue( FM_PROP_TIMEMAX ) );
+        sal_Int64   nMin        = getINT64( _rxModel->getPropertyValue( FM_PROP_TIMEMIN ) );
+        sal_Int64   nMax        = getINT64( _rxModel->getPropertyValue( FM_PROP_TIMEMAX ) );
         sal_Bool    bStrict     = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
 
         static_cast< TimeField* >( m_pWindow )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
@@ -2431,7 +2431,7 @@ void DbTimeField::updateFromModel( Reference< XPropertySet > _rxModel )
 {
     OSL_ENSURE( _rxModel.is() && m_pWindow, "DbTimeField::updateFromModel: invalid call!" );
 
-    sal_Int32 nTime = 0;
+    sal_Int64 nTime = 0;
     if ( _rxModel->getPropertyValue( FM_PROP_DATE ) >>= nTime )
         static_cast< TimeField* >( m_pWindow )->SetTime( ::Time( nTime ) );
     else
@@ -2444,7 +2444,7 @@ sal_Bool DbTimeField::commitControl()
     OUString aText(m_pWindow->GetText());
     Any aVal;
     if (!aText.isEmpty())
-        aVal <<= (sal_Int32)static_cast<TimeField*>(m_pWindow)->GetTime().GetTime();
+        aVal <<= (sal_Int64)static_cast<TimeField*>(m_pWindow)->GetTime().GetTime();
     else
         aVal.clear();
 
diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx
index 1f9a108..15c1f60 100644
--- a/svx/source/form/fmobjfac.cxx
+++ b/svx/source/form/fmobjfac.cxx
@@ -186,7 +186,7 @@ IMPL_LINK(FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
 
             case OBJ_FM_TIMEFIELD:
                 sServiceSpecifier = FM_COMPONENT_TIMEFIELD;
-                aInitialProperties.push_back( PropertyValueArray::value_type( FM_PROP_TIMEMAX, makeAny( (sal_Int32)( Time( 23, 59, 59, 99 ).GetTime() ) ) ) );
+                aInitialProperties.push_back( PropertyValueArray::value_type( FM_PROP_TIMEMAX, makeAny( (sal_Int64)( Time( 23, 59, 59, 999999999 ).GetTime() ) ) ) );
                 break;
 
             case OBJ_FM_NUMERICFIELD:
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 001741c..898a38b 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 566d11b..4f0cb43 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 be3aa3b..c2aa7b7 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 4b3a8f5..c9d7f35 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 451d048..9926b3c 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 ),
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index be0f9e1..a7f2c44 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -2244,7 +2244,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime,
     short       nHour   = 0;
     short       nMinute = 0;
     short       nSecond = 0;
-    short       n100Sec = 0;
+    sal_Int64   nNanoSec = 0;
     Time        aTime( 0, 0, 0 );
 
     if ( rStr.isEmpty() )
@@ -2298,7 +2298,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime,
                     return false;
                 if ( !aStr.isEmpty() && aStr[0] == '-' )
                     bNegative = true;
-                n100Sec = (short)aStr.toString().toInt32();
+                nNanoSec = aStr.toString().toInt64();
             }
             else
                 nSecond = (short)aStr.toString().toInt32();
@@ -2351,44 +2351,44 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime,
             nHour += nMinute / 60;
             nMinute %= 60;
         }
-        n100Sec = (short)aStr.toString().toInt32();
+        nNanoSec = aStr.toString().toInt64();
+    }
 
-        if ( n100Sec )
-        {
-            xub_StrLen nLen = 1; // at least one digit, otherwise n100Sec==0
+    if ( nNanoSec )
+    {
+        assert(aStr.getLength() >= 1);
 
-            while ( aStr[nLen] >= '0' && aStr[nLen] <= '9' )
-                nLen++;
+        sal_Int32 nLen = 1; // at least one digit, otherwise nNanoSec==0
 
-            if ( nLen > 2 )
-            {
-                while( nLen > 3 )
-                {
-                    n100Sec = n100Sec / 10;
-                    nLen--;
-                }
-                // round if negative?
-                n100Sec = (n100Sec + 5) / 10;
-            }
-            else if ( nLen == 1 )
-            {
-                n100Sec = n100Sec * 10;
-            }
+        while ( aStr.getLength() > nLen && aStr[nLen] >= '0' && aStr[nLen] <= '9' )
+            nLen++;
+
+        while ( nLen < 9)
+        {
+            nNanoSec *= 10;
+            ++nLen;
+        }
+        while ( nLen > 9 )
+        {
+            // round if negative?
+            nNanoSec = (nNanoSec + 5) / 10;
+            --nLen;
         }
     }
 
-    if ( (nMinute > 59) || (nSecond > 59) || (n100Sec > 100) )
+    assert(nNanoSec > -1000000000 && nNanoSec < 1000000000);
+    if ( (nMinute > 59) || (nSecond > 59) || (nNanoSec > 1000000000) )
         return false;
 
     if ( eFormat == TIMEF_NONE )
-        nSecond = n100Sec = 0;
+        nSecond = nNanoSec = 0;
     else if ( eFormat == TIMEF_SEC )
-        n100Sec = 0;
+        nNanoSec = 0;
 
     if ( !bDuration )
     {
         if ( bNegative || (nHour < 0) || (nMinute < 0) ||
-             (nSecond < 0) || (n100Sec < 0) )
+             (nSecond < 0) || (nNanoSec < 0) )
             return false;
 
         OUString aUpperCaseStr = aStr.toString().toAsciiUpperCase();
@@ -2404,22 +2404,25 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime,
             nHour = 0;
 
         aTime = Time( (sal_uInt16)nHour, (sal_uInt16)nMinute, (sal_uInt16)nSecond,
-                      (sal_uInt16)n100Sec );
+                      (sal_uInt32)nNanoSec );
     }
     else
     {
+        assert( !bNegative || (nHour < 0) || (nMinute < 0) ||
+             (nSecond < 0) || (nNanoSec < 0) );
         if ( bNegative || (nHour < 0) || (nMinute < 0) ||
-             (nSecond < 0) || (n100Sec < 0) )
+             (nSecond < 0) || (nNanoSec < 0) )
         {
+            // LEM TODO: this looks weird... I think buggy when parsing "05:-02:18"
             bNegative   = true;
             nHour       = nHour < 0 ? -nHour : nHour;
             nMinute     = nMinute < 0 ? -nMinute : nMinute;
             nSecond     = nSecond < 0 ? -nSecond : nSecond;
-            n100Sec     = n100Sec < 0 ? -n100Sec : n100Sec;
+            nNanoSec    = nNanoSec < 0 ? -nNanoSec : nNanoSec;
         }
 
         aTime = Time( (sal_uInt16)nHour, (sal_uInt16)nMinute, (sal_uInt16)nSecond,
-                      (sal_uInt16)n100Sec );
+                      (sal_uInt32)nNanoSec );
         if ( bNegative )
             aTime = -aTime;
     }
@@ -2567,7 +2570,7 @@ void TimeField::ImplTimeSpinArea( sal_Bool bUp )
             aTime += aAddTime;
             if ( !IsDuration() )
             {
-                Time aAbsMaxTime( 23, 59, 59, 99 );
+                Time aAbsMaxTime( 23, 59, 59, 999999999 );
                 if ( aTime > aAbsMaxTime )
                     aTime = aAbsMaxTime;
                 Time aAbsMinTime( 0, 0 );
@@ -2594,7 +2597,7 @@ void TimeFormatter::ImplInit()
 TimeFormatter::TimeFormatter() :
     maLastTime( 0, 0 ),
     maMin( 0, 0 ),
-    maMax( 23, 59, 59, 99 ),
+    maMax( 23, 59, 59, 999999999 ),
     maCorrectedTime( Time::SYSTEM ),
     mbEnforceValidValue( sal_True ),
     maFieldTime( 0, 0 )
diff --git a/xmloff/source/forms/handler/vcl_time_handler.cxx b/xmloff/source/forms/handler/vcl_time_handler.cxx
index c73392f..b508060 100644
--- a/xmloff/source/forms/handler/vcl_time_handler.cxx
+++ b/xmloff/source/forms/handler/vcl_time_handler.cxx
@@ -56,7 +56,7 @@ namespace xmloff
     //------------------------------------------------------------------------------------------------------------------
     OUString VCLTimeHandler::getAttributeValue( const Any& i_propertyValue ) const
     {
-        sal_Int32 nVCLTime(0);
+        sal_Int64 nVCLTime(0);
         OSL_VERIFY( i_propertyValue >>= nVCLTime );
         ::Time aVCLTime( nVCLTime );
 
@@ -74,7 +74,7 @@ namespace xmloff
     //------------------------------------------------------------------------------------------------------------------
     bool VCLTimeHandler::getPropertyValues( const OUString i_attributeValue, PropertyValues& o_propertyValues ) const
     {
-        sal_Int32 nVCLTime(0);
+        sal_Int64 nVCLTime(0);
 
         Duration aDuration;
         if (::sax::Converter::convertDuration( aDuration, i_attributeValue ))
@@ -86,11 +86,13 @@ namespace xmloff
         else
         {
             // compatibility format, before we wrote those values in XML-schema compatible form
-            if (!::sax::Converter::convertNumber(nVCLTime, i_attributeValue))
+            if (!::sax::Converter::convertNumber64(nVCLTime, i_attributeValue))
             {
                 OSL_ENSURE( false, "VCLTimeHandler::getPropertyValues: unknown time format (no XML-schema time, no legacy integer)!" );
                 return false;
             }
+            // legacy integer was in centiseconds
+            nVCLTime *= ::Time::nanoPerCenti;
         }
 
         const Any aPropertyValue( makeAny( nVCLTime ) );


More information about the Libreoffice-commits mailing list