From b31f33bcc1e5b8d1f791867358b5b4ad1df6e71e Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Mon, 9 Sep 2013 20:00:48 +0200 Subject: Easier conversion between Basic Date and UNO Date/Time Utility functions to convert between Basic Date type and the representations of Date and Time in UNO, namely: - com.sun.star.util.Date - com.sun.star.util.Time - com.sun.star.util.DateTime Name of new functions: - CDateToUnoDate - CDateFromUnoDate - CDateToUnoTime - CDateFromUnoTime - CDateToUnoDateTime - CDateFromUnoDateTime Change-Id: I2b971df20df1c0351d071023e042169b548894f1 Reviewed-on: https://gerrit.libreoffice.org/5897 Reviewed-by: Noel Power Tested-by: Noel Power --- basic/source/inc/date.hxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'basic/source/inc/date.hxx') diff --git a/basic/source/inc/date.hxx b/basic/source/inc/date.hxx index cd38c896d1df..cb7070284164 100644 --- a/basic/source/inc/date.hxx +++ b/basic/source/inc/date.hxx @@ -20,7 +20,15 @@ #ifndef _SBDATE_HXX #define _SBDATE_HXX +#include +#include +#include + bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ); +double implTimeSerial( sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond); +bool implDateTimeSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, + sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond, + double& rdRet ); sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 nFirstDay = 0 ); @@ -32,6 +40,13 @@ sal_Int16 implGetHour( double dDate ); sal_Int16 implGetMinute( double dDate ); sal_Int16 implGetSecond( double dDate ); +::com::sun::star::util::Date SbxDateToUNODate( const SbxValue* ); +void SbxDateFromUNODate( SbxValue*, const ::com::sun::star::util::Date& ); +::com::sun::star::util::Time SbxDateToUNOTime( const SbxValue* ); +void SbxDateFromUNOTime( SbxValue*, const ::com::sun::star::util::Time& ); +::com::sun::star::util::DateTime SbxDateToUNODateTime( const SbxValue* ); +void SbxDateFromUNODateTime( SbxValue*, const ::com::sun::star::util::DateTime& ); + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit