summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-07-28 16:08:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-08-04 11:02:56 +0200
commit43ea97e1f9cecd6c7cba8db35ce1307c858c6857 (patch)
tree5d4f81ad7e3a9e9e3af563ffe2df1661cb643bee /include
parent9d07f380bb0d5053571a9f3866b0415fe8339c5b (diff)
fdo#67235 adapt form control code to time nanosecond API change
squash of steps 1, 2 and 3 in master Change-Id: If68ecf0691919d71d06d7b97d46db115013f9805 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/toolkit/awt/vclxwindows.hxx42
-rw-r--r--include/toolkit/controls/unocontrolbase.hxx9
-rw-r--r--include/toolkit/controls/unocontrols.hxx48
-rw-r--r--include/toolkit/helper/property.hxx12
-rw-r--r--include/tools/date.hxx16
-rw-r--r--include/tools/time.hxx5
6 files changed, 78 insertions, 54 deletions
diff --git a/include/toolkit/awt/vclxwindows.hxx b/include/toolkit/awt/vclxwindows.hxx
index f822b0cc0e33..f774e64fb3ef 100644
--- a/include/toolkit/awt/vclxwindows.hxx
+++ b/include/toolkit/awt/vclxwindows.hxx
@@ -75,6 +75,8 @@
#include <com/sun/star/awt/XItemListListener.hpp>
#include <com/sun/star/awt/XImageConsumer.hpp>
#include <com/sun/star/awt/XSimpleTabController.hpp>
+#include <com/sun/star/util/Time.hpp>
+#include <com/sun/star/util/Date.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase2.hxx>
@@ -974,16 +976,16 @@ public:
// ::com::sun::star::awt::XDateField
- void SAL_CALL setDate( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setMin( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setMax( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setFirst( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setLast( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDate( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL setLongFormat( sal_Bool bLong ) throw(::com::sun::star::uno::RuntimeException);
sal_Bool SAL_CALL isLongFormat( ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException);
@@ -1019,16 +1021,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( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time SAL_CALL getTime( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time 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 30f1bf664206..1ca1eb4cf1f3 100644
--- a/include/toolkit/controls/unocontrolbase.hxx
+++ b/include/toolkit/controls/unocontrolbase.hxx
@@ -21,6 +21,8 @@
#define _TOOLKIT_AWT_UNOCONTROLBASE_HXX_
#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/util/Time.hpp>
#include <toolkit/controls/unocontrol.hxx>
@@ -39,11 +41,16 @@ 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 );
+ OUString ImplGetPropertyValue_UString( sal_uInt16 nProp );
+ ::com::sun::star::util::Date ImplGetPropertyValue_Date( sal_uInt16 nProp );
+ ::com::sun::star::util::Time ImplGetPropertyValue_Time( sal_uInt16 nProp );
// XLayoutConstrains (nur wenn das Control es unterstuetzt!)
::com::sun::star::awt::Size Impl_getMinimumSize();
diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx
index 0d3119fd8025..c8a5d7ae5843 100644
--- a/include/toolkit/controls/unocontrols.hxx
+++ b/include/toolkit/controls/unocontrols.hxx
@@ -1081,8 +1081,8 @@ class UnoDateFieldControl : public UnoSpinFieldControl,
public ::com::sun::star::awt::XDateField
{
private:
- sal_Int32 mnFirst;
- sal_Int32 mnLast;
+ ::com::sun::star::util::Date mnFirst;
+ ::com::sun::star::util::Date mnLast;
sal_Bool mbLongFormat;
public:
UnoDateFieldControl();
@@ -1103,16 +1103,16 @@ public:
void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
//XDateField
- void SAL_CALL setDate( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setMin( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setMax( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setFirst( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setLast( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDate( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( const ::com::sun::star::util::Date& Date ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Date SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL setLongFormat( sal_Bool bLong ) throw(::com::sun::star::uno::RuntimeException);
sal_Bool SAL_CALL isLongFormat( ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException);
@@ -1157,8 +1157,8 @@ class UnoTimeFieldControl : public UnoSpinFieldControl,
public ::com::sun::star::awt::XTimeField
{
private:
- sal_Int32 mnFirst;
- sal_Int32 mnLast;
+ ::com::sun::star::util::Time mnFirst;
+ ::com::sun::star::util::Time mnLast;
public:
UnoTimeFieldControl();
@@ -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( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time SAL_CALL getTime( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( const ::com::sun::star::util::Time& Time ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::util::Time 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 fa1fbbf2a125..74bdff1ab32c 100644
--- a/include/toolkit/helper/property.hxx
+++ b/include/toolkit/helper/property.hxx
@@ -65,12 +65,12 @@ namespace uno {
#define BASEPROPERTY_SPIN 27 // sal_Bool
#define BASEPROPERTY_STRICTFORMAT 28 // sal_Bool
#define BASEPROPERTY_DECIMALACCURACY 29 // sal_Int16
-#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_DATE 30 // ::com::sun::star::util::Date
+#define BASEPROPERTY_DATEMIN 31 // ::com::sun::star::util::Date
+#define BASEPROPERTY_DATEMAX 32 // ::com::sun::star::util::Date
+#define BASEPROPERTY_TIME 33 // ::com::sun::star::util::Time
+#define BASEPROPERTY_TIMEMIN 34 // ::com::sun::star::util::Time
+#define BASEPROPERTY_TIMEMAX 35 // ::com::sun::star::util::Time
#define BASEPROPERTY_VALUE_INT32 36 // sal_Int32
#define BASEPROPERTY_VALUEMIN_INT32 37 // sal_Int32
#define BASEPROPERTY_VALUEMAX_INT32 38 // sal_Int32
diff --git a/include/tools/date.hxx b/include/tools/date.hxx
index 714a97b85727..31cf706f3a5c 100644
--- a/include/tools/date.hxx
+++ b/include/tools/date.hxx
@@ -21,6 +21,8 @@
#include "tools/toolsdllapi.h"
#include <tools/solar.h>
+#include <com/sun/star/util/Date.hpp>
+#include <sal/log.hxx>
class ResId;
@@ -31,6 +33,10 @@ class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Date
{
private:
sal_uInt32 nDate;
+ void init( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear )
+ { nDate = ( sal_uInt32( nDay % 100 ) ) +
+ ( ( sal_uInt32( nMonth % 100 ) ) * 100 ) +
+ ( ( sal_uInt32( nYear % 10000 ) ) * 10000); }
public:
enum DateInitSystem
@@ -52,12 +58,16 @@ public:
Date( const Date& rDate )
{ nDate = rDate.nDate; }
Date( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear )
- { nDate = ( sal_uInt32( nDay % 100 ) ) +
- ( ( sal_uInt32( nMonth % 100 ) ) * 100 ) +
- ( ( sal_uInt32( nYear % 10000 ) ) * 10000); }
+ { init(nDay, nMonth, nYear); }
+ Date( const ::com::sun::star::util::Date& _rDate )
+ {
+ SAL_WARN_IF(_rDate.Year < 0, "tools.datetime", "Negative year in css::util::Date to ::Date conversion");
+ init(_rDate.Day, _rDate.Month, _rDate.Year);
+ }
void SetDate( sal_uInt32 nNewDate ) { nDate = nNewDate; }
sal_uInt32 GetDate() const { return nDate; }
+ ::com::sun::star::util::Date GetUNODate() const { return ::com::sun::star::util::Date(GetDay(), GetMonth(), GetYear()); }
void SetDay( sal_uInt16 nNewDay );
void SetMonth( sal_uInt16 nNewMonth );
diff --git a/include/tools/time.hxx b/include/tools/time.hxx
index 64751af42284..126a42199bfa 100644
--- a/include/tools/time.hxx
+++ b/include/tools/time.hxx
@@ -21,6 +21,7 @@
#include "tools/toolsdllapi.h"
#include <tools/solar.h>
+#include <com/sun/star/util/Time.hpp>
class ResId;
@@ -34,6 +35,8 @@ class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Time
{
private:
sal_Int64 nTime;
+ void init( sal_uInt32 nHour, sal_uInt32 nMin,
+ sal_uInt32 nSec, sal_uInt64 nNanoSec);
public:
enum TimeInitSystem
@@ -66,11 +69,13 @@ public:
Time( const ResId & rResId );
Time( sal_Int64 _nTime ) { Time::nTime = _nTime; }
Time( const Time& rTime );
+ Time( const ::com::sun::star::util::Time& rTime );
Time( sal_uInt32 nHour, sal_uInt32 nMin,
sal_uInt32 nSec = 0, sal_uInt64 nNanoSec = 0 );
void SetTime( sal_Int64 nNewTime ) { nTime = nNewTime; }
sal_Int64 GetTime() const { return nTime; }
+ ::com::sun::star::util::Time GetUNOTime() const { return ::com::sun::star::util::Time(GetNanoSec(),GetSec(),GetMin(),GetHour(),false); }
void SetHour( sal_uInt16 nNewHour );
void SetMin( sal_uInt16 nNewMin );