i#108348 API CHANGE: add IsUTC to css.util.DateTime etc.

Add IsUTC member to:

com.sun.star.util.DateTime
com.sun.star.util.DateTimeRange
com.sun.star.util.Time

Add new stucts with explicit time zones:

com.sun.star.util.DateTimeWithTimezone
com.sun.star.util.DateWithTimezone
com.sun.star.util.TimeWithTimezone

Adapt the sax::Converter to read/write timezones, and fix the unit test.

Everything else just uses default (no time zone), this commit is just
to fix the API.

STRUCT: /UCR/com/sun/star/util/DateTime
    nFields1 = 7  !=  nFields2 = 8
    Registry2 contains 1 more fields
STRUCT: /UCR/com/sun/star/util/DateTimeRange
    nFields1 = 14  !=  nFields2 = 15
    Registry2 contains 1 more fields
STRUCT: /UCR/com/sun/star/util/Time
    nFields1 = 4  !=  nFields2 = 5
    Registry2 contains 1 more fields

Conflicts:
	sc/source/filter/oox/unitconverter.cxx

Change-Id: I01f7a6d082a6b090c8efe71d2de137474c495c18
Reviewed-on: https://gerrit.libreoffice.org/4833
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
This commit is contained in:
Michael Stahl 2013-06-28 00:43:19 +02:00 committed by Eike Rathke
parent a8e8d46020
commit 652ccbdf31
40 changed files with 452 additions and 115 deletions

View File

@ -70,6 +70,7 @@ namespace comphelper
|| !( _rhs >>= rhs )
)
throw ::com::sun::star::lang::IllegalArgumentException();
// FIXME Timezone?
if ( lhs.Year < rhs.Year )
return true;
@ -100,6 +101,7 @@ namespace comphelper
|| !( _rhs >>= rhs )
)
throw ::com::sun::star::lang::IllegalArgumentException();
// FIXME Timezone?
if ( lhs.Hours < rhs.Hours )
return true;
@ -135,6 +137,7 @@ namespace comphelper
|| !( _rhs >>= rhs )
)
throw ::com::sun::star::lang::IllegalArgumentException();
// FIXME Timezone?
if ( lhs.Year < rhs.Year )
return true;

View File

@ -109,7 +109,8 @@ namespace dbtools
utl::Date aDate(_rDateTime.Day,_rDateTime.Month,_rDateTime.Year);
OUStringBuffer aTemp(toDateString(aDate));
aTemp.appendAscii(" ");
utl::Time aTime(_rDateTime.NanoSeconds,_rDateTime.Seconds,_rDateTime.Minutes,_rDateTime.Hours);
utl::Time const aTime(_rDateTime.NanoSeconds, _rDateTime.Seconds,
_rDateTime.Minutes, _rDateTime.Hours, _rDateTime.IsUTC);
aTemp.append( toTimeString(aTime) );
return aTemp.makeStringAndClear();
}
@ -459,7 +460,7 @@ namespace dbtools
aTime = toTime( _sSQLString.copy( nSeparation ) );
return utl::DateTime(aTime.NanoSeconds, aTime.Seconds, aTime.Minutes, aTime.Hours,
aDate.Day, aDate.Month, aDate.Year);
aDate.Day, aDate.Month, aDate.Year, false);
}
//-----------------------------------------------------------------------------

View File

@ -263,7 +263,9 @@ ORowSetValue OOp_CurTime::operate(const ::std::vector<ORowSetValue>& lhs) const
return ORowSetValue();
Time aCurTime( Time::SYSTEM );
return ::com::sun::star::util::Time(aCurTime.GetNanoSec(),aCurTime.GetSec(),aCurTime.GetMin(),aCurTime.GetHour());
return ::com::sun::star::util::Time(aCurTime.GetNanoSec(),
aCurTime.GetSec(), aCurTime.GetMin(), aCurTime.GetHour(),
false);
}
//------------------------------------------------------------------
ORowSetValue OOp_Now::operate(const ::std::vector<ORowSetValue>& lhs) const
@ -272,8 +274,10 @@ ORowSetValue OOp_Now::operate(const ::std::vector<ORowSetValue>& lhs) const
return ORowSetValue();
DateTime aCurTime( DateTime::SYSTEM );
return ::com::sun::star::util::DateTime(aCurTime.GetNanoSec(),aCurTime.GetSec(),aCurTime.GetMin(),aCurTime.GetHour(),
aCurTime.GetDay(),aCurTime.GetMonth(),aCurTime.GetYear());
return ::com::sun::star::util::DateTime(aCurTime.GetNanoSec(),
aCurTime.GetSec(), aCurTime.GetMin(), aCurTime.GetHour(),
aCurTime.GetDay(), aCurTime.GetMonth(), aCurTime.GetYear(),
false);
}
//------------------------------------------------------------------

View File

@ -418,7 +418,7 @@ OUString SAL_CALL ODatabaseMetaDataResultSet::getString( sal_Int32 columnIndex )
OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIME : SQL_C_TYPE_TIME,m_bWasNull,**this,&aTime,sizeof aTime);
else
m_bWasNull = sal_True;
return Time(0,aTime.second,aTime.minute,aTime.hour);
return Time(0, aTime.second,aTime.minute,aTime.hour, false);
}
// -------------------------------------------------------------------------
@ -436,7 +436,8 @@ OUString SAL_CALL ODatabaseMetaDataResultSet::getString( sal_Int32 columnIndex )
OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIMESTAMP : SQL_C_TYPE_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
else
m_bWasNull = sal_True;
return DateTime(aTime.fraction,aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year);
return DateTime(aTime.fraction, aTime.second, aTime.minute, aTime.hour,
aTime.day, aTime.month, aTime.year, false);
}
// -------------------------------------------------------------------------

View File

@ -650,7 +650,7 @@ Time OResultSet::impl_getTime( sal_Int32 columnIndex ) throw(SQLException, Runti
TIME_STRUCT aTime = impl_getValue< TIME_STRUCT > ( columnIndex,
m_pStatement->getOwnConnection()->useOldDateFormat() ? SQL_C_TIME : SQL_C_TYPE_TIME );
return Time(0,aTime.second,aTime.minute,aTime.hour);
return Time(0, aTime.second,aTime.minute,aTime.hour, false);
}
Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
@ -668,7 +668,8 @@ DateTime OResultSet::impl_getTimestamp( sal_Int32 columnIndex ) throw(SQLExcepti
aTime.hour,
aTime.day,
aTime.month,
aTime.year);
aTime.year,
false);
}
DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{

View File

@ -99,7 +99,8 @@ namespace pcr
if ( !getTypedControlWindow()->GetText().isEmpty() )
{
::Time aTime( getTypedControlWindow()->GetTime() );
util::Time aUNOTime( aTime.GetNanoSec(), aTime.GetSec(), aTime.GetMin(), aTime.GetHour() );
util::Time const aUNOTime( aTime.GetNanoSec(), aTime.GetSec(),
aTime.GetMin(), aTime.GetHour(), false );
aPropValue <<= aUNOTime;
}
return aPropValue;

View File

@ -338,7 +338,7 @@ namespace
// ------------------------------------------------------------------------
UNOTime lcl_toUNOTime( const OUString& rString )
{
UNOTime aTime( 0, 0, 0, 0 );
UNOTime aTime;
bool bWellformed = ISO8601parseTime(rString, aTime);
@ -362,7 +362,7 @@ namespace
// all okay?
if ( !bWellformed )
return UNOTime( 0, 0, 0, 0 );
return UNOTime();
return aTime;
}
@ -382,7 +382,8 @@ namespace
UNODate aDate( aDateTime.Day, aDateTime.Month, aDateTime.Year );
OUString sDate = lcl_toXSD_UNODate_typed( aDate );
UNOTime aTime( aDateTime.NanoSeconds, aDateTime.Seconds, aDateTime.Minutes, aDateTime.Hours );
UNOTime const aTime( aDateTime.NanoSeconds, aDateTime.Seconds,
aDateTime.Minutes, aDateTime.Hours, aDateTime.IsUTC);
OUString sTime = lcl_toXSD_UNOTime_typed( aTime );
OUStringBuffer sInfo;
@ -405,7 +406,6 @@ namespace
if ( nDateTimeSep == -1 )
{ // no time part
aDate = lcl_toUNODate( rString );
aTime = UNOTime( 0, 0, 0, 0 );
}
else
{
@ -414,7 +414,7 @@ namespace
}
UNODateTime aDateTime(
aTime.NanoSeconds, aTime.Seconds, aTime.Minutes, aTime.Hours,
aDate.Day, aDate.Month, aDate.Year
aDate.Day, aDate.Month, aDate.Year, aTime.IsUTC
);
return makeAny( aDateTime );
}

View File

@ -4035,7 +4035,9 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/util,\
DataEditorEvent \
DataEditorEventType \
Date \
DateWithTimezone \
DateTime \
DateTimeWithTimezone \
DateTimeRange \
Duration \
ElementChange \
@ -4056,6 +4058,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/util,\
SortField \
SortFieldType \
Time \
TimeWithTimezone \
TriState \
URL \
VetoException \

View File

@ -20,11 +20,12 @@
#define __com_sun_star_util_Date_idl__
module com { module sun { module star { module util {
/** represents a date value.
The time zone is unknown.
*/
published struct Date
{

View File

@ -20,7 +20,6 @@
#define __com_sun_star_util_DateTime_idl__
module com { module sun { module star { module util {
@ -61,7 +60,11 @@ published struct DateTime
*/
short Year;
/** TODO: timezone **/
/** true: time zone is UTC false: unknown time zone.
@since LibreOffice 4.1
*/
boolean IsUTC;
};

View File

@ -20,7 +20,6 @@
#define __com_sun_star_util_DateTimeRange_idl__
module com { module sun { module star { module util {
@ -84,7 +83,12 @@ published struct DateTimeRange
*/
short EndYear;
/** TODO timezones **/
/** true: time zone is UTC false: unknown time zone.
@since LibreOffice 4.1
*/
boolean IsUTC;
};

View File

@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __com_sun_star_util_DateTimeTZ_idl__
#define __com_sun_star_util_DateTimeTZ_idl__
#include <com/sun/star/util/DateTime.idl>
module com { module sun { module star { module util {
/** represents a combined date+time value with time zone.
@since LibreOffice 4.1
*/
struct DateTimeWithTimeZone
{
/** the date and time (in TimeZone)
*/
DateTime DateTimeInTZ;
/** contains the time zone, as signed offset in minutes *from* UTC,
that is *east* of UTC, that is the amount of minutes that should
be added to UTC time to obtain the time in that timezone.
To obtain UTC datetime from DateTimeInTZ, you need to *subtract*
TimeZone minutes.
*/
short Timezone;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __com_sun_star_util_DateTZ_idl__
#define __com_sun_star_util_DateTZ_idl__
#include <com/sun/star/util/Date.idl>
module com { module sun { module star { module util {
/** represents a date value with time zone.
@since LibreOffice 4.1
*/
struct DateWithTimeZone
{
/** the date.
@note XMLSchema-2 defines this as a 24 hour interval.
The TimeZone shifts the interval along the UTC time line.
*/
Date DateInTZ;
/** contains the time zone, as signed offset in minutes *from* UTC,
that is *east* of UTC, that is the amount of minutes that should
be added to UTC time to obtain time in that timezone.
*/
short Timezone;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -20,7 +20,6 @@
#define __com_sun_star_util_Time_idl__
module com { module sun { module star { module util {
@ -44,6 +43,12 @@ published struct Time
*/
unsigned short Hours;
/** true: time zone is UTC false: unknown time zone.
@since LibreOffice 4.1
*/
boolean IsUTC;
};

View File

@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __com_sun_star_util_TimeTZ_idl__
#define __com_sun_star_util_TimeTZ_idl__
#include <com/sun/star/util/Time.idl>
module com { module sun { module star { module util {
/** represents a combined time value with time zone.
@since LibreOffice 4.1
*/
struct TimeWithTimeZone
{
/** the time (in TimeZone)
*/
Time TimeInTZ;
/** contains the time zone, as signed offset in minutes *from* UTC,
that is *east* of UTC, that is the amount of minutes that should
be added to UTC time to obtain the time in that timezone.
To obtain UTC time from TimeInTZ, you need to *subtract* TimeZone
minutes.
*/
short Timezone;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Binary file not shown.

View File

@ -154,7 +154,9 @@ util::DateTime OOXMLDocPropHandler::GetDateTimeFromW3CDTF( const OUString& aChar
}
}
return util::DateTime( aOslDTime.NanoSeconds, aOslDTime.Seconds, aOslDTime.Minutes, aOslDTime.Hours, aOslDTime.Day, aOslDTime.Month, aOslDTime.Year );
return util::DateTime( aOslDTime.NanoSeconds, aOslDTime.Seconds,
aOslDTime.Minutes, aOslDTime.Hours,
aOslDTime.Day, aOslDTime.Month, aOslDTime.Year, false);
}
// ------------------------------------------------

View File

@ -357,7 +357,7 @@ public class _XParameters extends MultiMethodTest {
else {
try {
oObj.setTime(
idx, new Time((short)1,(short)2,(short)3,(short)44)) ;
idx, new Time((short)1,(short)2,(short)3,(short)44, false));
} catch (SQLException e) {
log.println("Unexpected SQL exception:") ;
log.println(e) ;
@ -379,7 +379,7 @@ public class _XParameters extends MultiMethodTest {
else {
try {
oObj.setTimestamp(idx, new DateTime((short)1,(short)2,(short)3,
(short)4, (short)19, (short)01, (short)1979)) ;
(short)4, (short)19, (short)01, (short)1979, false)) ;
} catch (SQLException e) {
log.println("Unexpected SQL exception:") ;
log.println(e) ;

View File

@ -1238,7 +1238,8 @@ void OOle2Obj::initializeOle()
{
uno::Reference< beans::XPropertySet > xChartProps( xCompSupp->getComponent(), uno::UNO_QUERY );
if ( xChartProps.is() )
xChartProps->setPropertyValue("NullDate",uno::makeAny(util::DateTime(0,0,0,0,1,1,1900)));
xChartProps->setPropertyValue("NullDate",
uno::makeAny(util::DateTime(0,0,0,0,1,1,1900,false)));
}
}
}

View File

@ -157,7 +157,8 @@ static bool eqDateTime(util::DateTime a, util::DateTime b) {
return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day
&& a.Hours == b.Hours && a.Minutes == b.Minutes
&& a.Seconds == b.Seconds
&& a.NanoSeconds == b.NanoSeconds;
&& a.NanoSeconds == b.NanoSeconds
&& a.IsUTC == b.IsUTC;
}
static void doTest(util::DateTime const & rdt, char const*const pis,
@ -168,13 +169,14 @@ static void doTest(util::DateTime const & rdt, char const*const pis,
util::DateTime odt;
SAL_INFO("sax.cppunit","about to convert '" << is << "'");
bool bSuccess( Converter::convertDateTime(odt, is) );
SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << " M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds);
SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << " M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds << " UTC: " << (bool)odt.IsUTC);
CPPUNIT_ASSERT(bSuccess);
CPPUNIT_ASSERT(eqDateTime(rdt, odt));
OUStringBuffer buf;
Converter::convertDateTime(buf, odt, true);
SAL_INFO("sax.cppunit","" << buf.getStr());
CPPUNIT_ASSERT(buf.makeStringAndClear().equalsAscii(pos));
CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos),
buf.makeStringAndClear());
}
static void doTestDateTimeF(char const*const pis)
@ -189,43 +191,42 @@ static void doTestDateTimeF(char const*const pis)
void ConverterTest::testDateTime()
{
SAL_INFO("sax.cppunit","\nSAX CONVERTER TEST BEGIN");
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1), "0001-01-01T00:00:00" );
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1),
"0001-01-01T00:00:00Z", "0001-01-01T00:00:00" );
doTest( util::DateTime(0, 0, 0, 0, 1, 1, -1), "-0001-01-01T00:00:00");
// doTest( util::DateTime(0, 0, 0, 0, 1, 1, -1), "-0001-01-01T00:00:00Z");
doTest( util::DateTime(0, 0, 0, 0, 1, 1, -324),
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1, false), "0001-01-01T00:00:00" );
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1, true), "0001-01-01T00:00:00Z" );
doTest( util::DateTime(0, 0, 0, 0, 1, 1, -1, false),
"-0001-01-01T00:00:00");
doTest( util::DateTime(0, 0, 0, 0, 1, 1, -1, true),
"-0001-01-01T01:00:00+01:00", "-0001-01-01T00:00:00Z");
doTest( util::DateTime(0, 0, 0, 0, 1, 1, -324, false),
"-0324-01-01T00:00:00" );
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1),
"0001-01-01T00:00:00-00:00", "0001-01-01T00:00:00" );
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1),
"0001-01-01T00:00:00+00:00", "0001-01-01T00:00:00" );
doTest( util::DateTime(0, 0, 0, 0, 2, 1, 1)/*(0, 0, 12, 0, 2, 1, 1)*/,
"0001-01-02T00:00:00-12:00", "0001-01-02T00:00:00" );
// "0001-02-01T12:00:00" );
doTest( util::DateTime(0, 0, 0, 0, 2, 1, 1)/*(0, 0, 12, 0, 1, 1, 1)*/,
"0001-01-02T00:00:00+12:00", "0001-01-02T00:00:00" );
// "0001-01-01T12:00:00" );
doTest( util::DateTime(990000000, 59, 59, 23, 31, 12, 9999),
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1, true),
"0001-01-01T00:00:00-00:00", "0001-01-01T00:00:00Z" );
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1, true),
"0001-01-01T00:00:00+00:00", "0001-01-01T00:00:00Z" );
doTest( util::DateTime(0, 0, 0, 12, 2, 1, 1, true),
"0001-01-02T00:00:00-12:00", "0001-01-02T12:00:00Z" );
doTest( util::DateTime(0, 0, 0, 12, 1, 1, 1, true),
"0001-01-02T00:00:00+12:00", "0001-01-01T12:00:00Z" );
doTest( util::DateTime(990000000, 59, 59, 23, 31, 12, 9999, false),
"9999-12-31T23:59:59.99", "9999-12-31T23:59:59.990000000" );
doTest( util::DateTime(990000000, 59, 59, 23, 31, 12, 9999),
"9999-12-31T23:59:59.99Z", "9999-12-31T23:59:59.990000000" );
doTest( util::DateTime(999999999, 59, 59, 23, 31, 12, 9999),
doTest( util::DateTime(990000000, 59, 59, 23, 31, 12, 9999, true),
"9999-12-31T23:59:59.99Z", "9999-12-31T23:59:59.990000000Z" );
doTest( util::DateTime(999999999, 59, 59, 23, 31, 12, 9999, false),
"9999-12-31T23:59:59.9999999999999999999999999999999999999",
"9999-12-31T23:59:59.999999999" );
doTest( util::DateTime(999999999, 59, 59, 23, 31, 12, 9999),
doTest( util::DateTime(999999999, 59, 59, 23, 31, 12, 9999, true),
"9999-12-31T23:59:59.9999999999999999999999999999999999999Z",
"9999-12-31T23:59:59.999999999" );
doTest( util::DateTime(0, 0, 0, 0, 29, 2, 2000), // leap year
"2000-02-29T00:00:00-00:00", "2000-02-29T00:00:00" );
doTest( util::DateTime(0, 0, 0, 0, 29, 2, 1600), // leap year
"1600-02-29T00:00:00-00:00", "1600-02-29T00:00:00" );
doTest( util::DateTime(0, 0, 0, 24, 1, 1, 333)
"9999-12-31T23:59:59.999999999Z" );
doTest( util::DateTime(0, 0, 0, 0, 29, 2, 2000, true), // leap year
"2000-02-29T00:00:00-00:00", "2000-02-29T00:00:00Z" );
doTest( util::DateTime(0, 0, 0, 0, 29, 2, 1600, true), // leap year
"1600-02-29T00:00:00-00:00", "1600-02-29T00:00:00Z" );
doTest( util::DateTime(0, 0, 0, 24, 1, 1, 333, false)
/*(0, 0, 0, 0, 2, 1, 333)*/,
"0333-01-01T24:00:00"/*, "0333-01-02T00:00:00"*/ );
// While W3C XMLSchema specifies a minimum of 4 year digits we are lenient
// in what we accept.
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1),
doTest( util::DateTime(0, 0, 0, 0, 1, 1, 1, false),
"1-01-01T00:00:00", "0001-01-01T00:00:00" );
doTestDateTimeF( "+0001-01-01T00:00:00" ); // invalid: ^+
doTestDateTimeF( "0001-1-01T00:00:00" ); // invalid: < 2 M

View File

@ -28,6 +28,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx>
#include <osl/time.h>
#include <algorithm>
@ -1185,13 +1186,48 @@ bool Converter::convertDuration(util::Duration& rDuration,
}
static void
lcl_AppendTimezone(OUStringBuffer & i_rBuffer, sal_Int16 const nOffset)
{
if (0 == nOffset)
{
i_rBuffer.append(sal_Unicode('Z'));
}
else
{
if (0 < nOffset)
{
i_rBuffer.append(sal_Unicode('+'));
}
else
{
i_rBuffer.append(sal_Unicode('-'));
}
const sal_Int32 nHours (abs(nOffset) / 60);
const sal_Int32 nMinutes(abs(nOffset) % 60);
SAL_WARN_IF(nHours > 14 || (nHours == 14 && nMinutes > 0),
"sax", "convertDateTime: timezone overflow");
if (nHours < 10)
{
i_rBuffer.append('0');
}
i_rBuffer.append(nHours);
i_rBuffer.append(':');
if (nMinutes < 10)
{
i_rBuffer.append('0');
}
i_rBuffer.append(nMinutes);
}
}
/** convert util::Date to ISO "date" string */
void Converter::convertDate(
OUStringBuffer& i_rBuffer,
const util::Date& i_rDate)
{
const util::DateTime dt(
0, 0, 0, 0, i_rDate.Day, i_rDate.Month, i_rDate.Year);
const util::DateTime dt(0, 0, 0, 0,
i_rDate.Day, i_rDate.Month, i_rDate.Year, false);
convertDateTime(i_rBuffer, dt, false);
}
@ -1260,6 +1296,17 @@ void Converter::convertDateTime(
i_rBuffer.append(OUString::createFromAscii(ostr.str().c_str()));
}
}
sal_uInt16 * pTimezone(0); // FIXME pass this as parameter
if (pTimezone)
{
lcl_AppendTimezone(i_rBuffer, *pTimezone);
}
else if (i_rDateTime.IsUTC)
{
// append local time
lcl_AppendTimezone(i_rBuffer, 0);
}
}
/** convert ISO "date" or "dateTime" string to util::DateTime */
@ -1279,6 +1326,10 @@ bool Converter::convertDateTime( util::DateTime& rDateTime,
rDateTime.Minutes = 0;
rDateTime.Seconds = 0;
rDateTime.NanoSeconds = 0;
// FIXME
#if 0
rDateTime.IsUTC = date.IsUTC;
#endif
}
return true;
}
@ -1288,6 +1339,99 @@ bool Converter::convertDateTime( util::DateTime& rDateTime,
}
}
static bool lcl_isLeapYear(const sal_uInt32 nYear)
{
return ((nYear % 4) == 0)
&& (((nYear % 100) != 0) || ((nYear % 400) == 0));
}
static sal_uInt16
lcl_MaxDaysPerMonth(const sal_Int32 nMonth, const sal_Int32 nYear)
{
static sal_uInt16 s_MaxDaysPerMonth[12] =
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
OSL_ASSERT(0 < nMonth && nMonth <= 12);
if ((2 == nMonth) && lcl_isLeapYear(nYear))
{
return 29;
}
return s_MaxDaysPerMonth[nMonth - 1];
}
static void lcl_ConvertToUTC(
sal_Int16 & o_rYear, sal_uInt16 & o_rMonth, sal_uInt16 & o_rDay,
sal_uInt16 & o_rHours, sal_uInt16 & o_rMinutes,
sal_Int16 const nSourceOffset)
{
sal_Int16 nOffsetHours(abs(nSourceOffset) / 60);
sal_Int16 const nOffsetMinutes(abs(nSourceOffset) % 60);
o_rMinutes += nOffsetMinutes;
if (nSourceOffset < 0)
{
o_rMinutes += nOffsetMinutes;
if (60 <= o_rMinutes)
{
o_rMinutes -= 60;
++nOffsetHours;
}
o_rHours += nOffsetHours;
if (o_rHours < 24)
{
return;
}
while (24 <= o_rHours)
{
o_rHours -= 24;
++o_rDay;
}
sal_Int16 const nDaysInMonth(lcl_MaxDaysPerMonth(o_rMonth, o_rYear));
if (o_rDay <= nDaysInMonth)
{
return;
}
o_rDay -= nDaysInMonth;
++o_rMonth;
if (o_rMonth <= 12)
{
return;
}
o_rMonth = 1;
++o_rYear; // works for negative year too
}
else if (0 < nSourceOffset)
{
// argh everything is unsigned
if (o_rMinutes < nOffsetMinutes)
{
o_rMinutes += 60;
++nOffsetHours;
}
o_rMinutes -= nOffsetMinutes;
sal_Int16 nDaySubtract(0);
while (o_rHours < nOffsetHours)
{
o_rHours += 24;
++nDaySubtract;
}
o_rHours -= nOffsetHours;
if (nDaySubtract < o_rDay)
{
o_rDay -= nDaySubtract;
return;
}
sal_Int16 const nPrevMonth((o_rMonth == 1) ? 12 : o_rMonth - 1);
sal_Int16 const nDaysInMonth(lcl_MaxDaysPerMonth(nPrevMonth, o_rYear));
o_rDay += nDaysInMonth;
--o_rMonth;
if (0 == o_rMonth)
{
o_rMonth = 12;
--o_rYear; // works for negative year too
}
o_rDay -= nDaySubtract;
}
}
static bool
readDateTimeComponent(const OUString & rString,
sal_Int32 & io_rnPos, sal_Int32 & o_rnTarget,
@ -1309,24 +1453,7 @@ readDateTimeComponent(const OUString & rString,
return true;
}
static bool lcl_isLeapYear(const sal_uInt32 nYear)
{
return ((nYear % 4) == 0)
&& (((nYear % 100) != 0) || ((nYear % 400) == 0));
}
static sal_uInt16
lcl_MaxDaysPerMonth(const sal_Int32 nMonth, const sal_Int32 nYear)
{
static sal_uInt16 s_MaxDaysPerMonth[12] =
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
OSL_ASSERT(0 < nMonth && nMonth <= 12);
if ((2 == nMonth) && lcl_isLeapYear(nYear))
{
return 29;
}
return s_MaxDaysPerMonth[nMonth - 1];
}
/** convert ISO "date" or "dateTime" string to util::DateTime or util::Date */
bool Converter::convertDateOrDateTime(
@ -1526,13 +1653,11 @@ bool Converter::convertDateOrDateTime(
bSuccess &= (nPos == string.getLength()); // trailing junk?
if (bSuccess && bHaveTimezone)
{
// util::DateTime does not support timezones!
}
if (bSuccess)
{
sal_uInt16 * pTimezone(0); // FIXME pass this as parameter
sal_Int16 const nTimezoneOffset = ((bHaveTimezoneMinus) ? (-1) : (+1))
* ((nTimezoneHours * 60) + nTimezoneMinutes);
if (bHaveTime) // time is optional
{
rDateTime.Year =
@ -1543,6 +1668,25 @@ bool Converter::convertDateOrDateTime(
rDateTime.Minutes = static_cast<sal_uInt16>(nMinutes);
rDateTime.Seconds = static_cast<sal_uInt16>(nSeconds);
rDateTime.NanoSeconds = static_cast<sal_uInt32>(nNanoSeconds);
if (bHaveTimezone)
{
if (pTimezone)
{
*pTimezone = nTimezoneOffset;
rDateTime.IsUTC = (0 == nTimezoneOffset);
}
else
{
lcl_ConvertToUTC(rDateTime.Year, rDateTime.Month,
rDateTime.Day, rDateTime.Hours, rDateTime.Minutes,
nTimezoneOffset);
rDateTime.IsUTC = true;
}
}
else
{
rDateTime.IsUTC = false;
}
rbDateTime = true;
}
else
@ -1551,6 +1695,18 @@ bool Converter::convertDateOrDateTime(
((isNegative) ? (-1) : (+1)) * static_cast<sal_Int16>(nYear);
rDate.Month = static_cast<sal_uInt16>(nMonth);
rDate.Day = static_cast<sal_uInt16>(nDay);
if (bHaveTimezone)
{
if (pTimezone)
{
*pTimezone = nTimezoneOffset;
}
else
{
// a Date cannot be adjusted
SAL_INFO("sax", "dropping timezone");
}
}
rbDateTime = false;
}
}

View File

@ -67,7 +67,7 @@ void lclSkipYearBlock( sal_Int32& ornDays, sal_Int16& ornYear, sal_Int32 nDaysIn
/** Returns the number of days before the passed date, starting from the null
date 0000-Jan-01, using standard leap year conventions. */
sal_Int32 lclGetDays( const css::util::Date& rDate )
sal_Int32 lclGetDays( const Date& rDate )
{
// number of days in all full years before passed date including all leap days
sal_Int32 nDays = rDate.Year * 365 + ((rDate.Year + 3) / 4) - ((rDate.Year + 99) / 100) + ((rDate.Year + 399) / 400);
@ -98,7 +98,7 @@ sal_Int32 lclGetDays( const css::util::Date& rDate )
UnitConverter::UnitConverter( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
maCoeffs( UNIT_ENUM_SIZE, 1.0 ),
mnNullDate( lclGetDays( css::util::Date( 30, 12, 1899 ) ) )
mnNullDate( lclGetDays( Date( 30, 12, 1899 ) ) )
{
// initialize constant and default coefficients
const DeviceInfo& rDeviceInfo = getBaseFilter().getGraphicHelper().getDeviceInfo();
@ -157,7 +157,7 @@ void UnitConverter::finalizeImport()
}
}
void UnitConverter::finalizeNullDate( const css::util::Date& rNullDate )
void UnitConverter::finalizeNullDate( const Date& rNullDate )
{
// convert the nulldate to number of days since 0000-Jan-01
mnNullDate = lclGetDays( rNullDate );
@ -180,17 +180,17 @@ double UnitConverter::scaleFromMm100( sal_Int32 nMm100, Unit eUnit ) const
return static_cast< double >( nMm100 ) / getCoefficient( eUnit );
}
double UnitConverter::calcSerialFromDateTime( const css::util::DateTime& rDateTime ) const
double UnitConverter::calcSerialFromDateTime( const DateTime& rDateTime ) const
{
sal_Int32 nDays = lclGetDays( css::util::Date( rDateTime.Day, rDateTime.Month, rDateTime.Year ) ) - mnNullDate;
sal_Int32 nDays = lclGetDays( Date( rDateTime.Day, rDateTime.Month, rDateTime.Year ) ) - mnNullDate;
OSL_ENSURE( nDays >= 0, "UnitConverter::calcDateTimeSerial - invalid date" );
OSL_ENSURE( (rDateTime.Hours <= 23) && (rDateTime.Minutes <= 59) && (rDateTime.Seconds <= 59), "UnitConverter::calcDateTimeSerial - invalid time" );
return nDays + rDateTime.Hours / 24.0 + rDateTime.Minutes / 1440.0 + rDateTime.Seconds / 86400.0;
}
css::util::DateTime UnitConverter::calcDateTimeFromSerial( double fSerial ) const
DateTime UnitConverter::calcDateTimeFromSerial( double fSerial ) const
{
css::util::DateTime aDateTime( 0, 0, 0, 0, 1, 1, 0 );
DateTime aDateTime( 0, 0, 0, 0, 1, 1, 0, false );
double fDays = 0.0;
double fTime = modf( fSerial, &fDays );

View File

@ -143,7 +143,10 @@ static SfxDispatcher* getDispatcher( ViewShellBase& rBase )
com::sun::star::util::DateTime getCurrentDateTime()
{
DateTime aCurrentDate( DateTime::SYSTEM );
return com::sun::star::util::DateTime( 0, aCurrentDate.GetSec(), aCurrentDate.GetMin(), aCurrentDate.GetHour(), aCurrentDate.GetDay(), aCurrentDate.GetMonth(), aCurrentDate.GetYear() );
return com::sun::star::util::DateTime( 0, aCurrentDate.GetSec(),
aCurrentDate.GetMin(), aCurrentDate.GetHour(),
aCurrentDate.GetDay(), aCurrentDate.GetMonth(),
aCurrentDate.GetYear(), false );
}
OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotation )

View File

@ -367,7 +367,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
xDocProps->setCreationDate( util::DateTime(
now.GetNanoSec(), now.GetSec(), now.GetMin(),
now.GetHour(), now.GetDay(), now.GetMonth(),
now.GetYear() ) );
now.GetYear(), false) );
}
if ( bAllowModif )

View File

@ -99,7 +99,8 @@ bool operator==(const util::DateTime &i_rLeft, const util::DateTime &i_rRight)
&& i_rLeft.Hours == i_rRight.Hours
&& i_rLeft.Minutes == i_rRight.Minutes
&& i_rLeft.Seconds == i_rRight.Seconds
&& i_rLeft.NanoSeconds == i_rRight.NanoSeconds;
&& i_rLeft.NanoSeconds == i_rRight.NanoSeconds
&& i_rLeft.IsUTC == i_rRight.IsUTC;
}
// STATIC DATA -----------------------------------------------------------
@ -353,7 +354,7 @@ void SfxDocumentInfoItem::resetUserData(const OUString & i_rAuthor)
DateTime now( DateTime::SYSTEM );
setCreationDate( util::DateTime(
now.GetNanoSec(), now.GetSec(), now.GetMin(), now.GetHour(),
now.GetDay(), now.GetMonth(), now.GetYear() ) );
now.GetDay(), now.GetMonth(), now.GetYear(), false) );
setModifiedBy(OUString());
setPrintedBy(OUString());
setModificationDate(util::DateTime());
@ -799,7 +800,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl)
DateTime now( DateTime::SYSTEM );
util::DateTime uDT(
now.GetNanoSec(), now.GetSec(), now.GetMin(), now.GetHour(),
now.GetDay(), now.GetMonth(), now.GetYear() );
now.GetDay(), now.GetMonth(), now.GetYear(), false);
m_pCreateValFt->SetText( ConvertDateTime_Impl( aName, uDT, rLocaleWrapper ) );
OUString aEmpty;
m_pChangeValFt->SetText( aEmpty );
@ -1866,8 +1867,10 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c
{
Date aTmpDate = pLine->m_aDateField.GetDate();
Time aTmpTime = pLine->m_aTimeField.GetTime();
util::DateTime aDateTime(aTmpTime.GetNanoSec(), aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour(),
aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear() );
util::DateTime const aDateTime(aTmpTime.GetNanoSec(),
aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour(),
aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear(),
false);
aPropertiesSeq[i].Value <<= aDateTime;
}
else if ( CUSTOM_TYPE_DURATION == nType )
@ -1877,7 +1880,8 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c
else if ( CUSTOM_TYPE_DATE == nType )
{
Date aTmpDate = pLine->m_aDateField.GetDate();
util::Date aDate(aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear());
util::Date const aDate(aTmpDate.GetDay(), aTmpDate.GetMonth(),
aTmpDate.GetYear());
aPropertiesSeq[i].Value <<= aDate;
}

View File

@ -413,7 +413,8 @@ bool operator== (const css::util::DateTime &i_rLeft,
&& i_rLeft.Hours == i_rRight.Hours
&& i_rLeft.Minutes == i_rRight.Minutes
&& i_rLeft.Seconds == i_rRight.Seconds
&& i_rLeft.NanoSeconds == i_rRight.NanoSeconds;
&& i_rLeft.NanoSeconds == i_rRight.NanoSeconds
&& i_rLeft.IsUTC == i_rRight.IsUTC;
}
// NB: keep these two arrays in sync!
@ -1828,7 +1829,7 @@ SfxDocumentMetaData::resetUserData(const OUString & the_value)
bModified |= setMetaText("meta:initial-creator", the_value);
::DateTime now( ::DateTime::SYSTEM );
css::util::DateTime uDT(now.GetNanoSec(), now.GetSec(), now.GetMin(),
now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear());
now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear(), false);
bModified |= setMetaText("meta:creation-date", dateTimeToText(uDT));
bModified |= setMetaText("dc:creator", OUString());
bModified |= setMetaText("meta:printed-by", OUString());

View File

@ -205,7 +205,7 @@ void SfxObjectShell::UpdateDocInfoForSave()
xDocProps->setModificationDate( util::DateTime(
now.GetNanoSec(), now.GetSec(), now.GetMin(),
now.GetHour(), now.GetDay(), now.GetMonth(),
now.GetYear() ) );
now.GetYear(), false) );
xDocProps->setModifiedBy( aUserName );
if ( !HasName() || pImp->bIsSaving )
// QUESTION: not in case of "real" SaveAs as this is meant to create a new document
@ -836,7 +836,7 @@ void SfxObjectShell::ResetFromTemplate( const String& rTemplateName, const Strin
xDocProps->setTemplateDate( util::DateTime(
now.GetNanoSec(), now.GetSec(), now.GetMin(),
now.GetHour(), now.GetDay(), now.GetMonth(),
now.GetYear() ) );
now.GetYear(), false) );
SetQueryLoadTemplate( sal_True );
}

View File

@ -40,8 +40,10 @@ using ::com::sun::star::uno::makeAny;
using namespace ::com::sun::star;
#define TIMESTAMP_INVALID_DATETIME ( DateTime ( Date ( 1, 1, 1601 ), Time ( 0, 0, 0 ) ) ) /// Invalid value for date and time to create invalid instance of TimeStamp.
#define TIMESTAMP_INVALID_UTILDATETIME ( util::DateTime ( 0, 0, 0, 0, 1, 1, 1601 ) ) /// Invalid value for date and time to create invalid instance of TimeStamp.
#define TIMESTAMP_INVALID_UTILDATE ( util::Date ( 1, 1, 1601 ) ) /// Invalid value for date to create invalid instance of TimeStamp.
/// Invalid value for date and time to create invalid instance of TimeStamp.
#define TIMESTAMP_INVALID_UTILDATETIME (util::DateTime(0, 0, 0, 0, 1, 1, 1601, false))
/// Invalid value for date to create invalid instance of TimeStamp.
#define TIMESTAMP_INVALID_UTILDATE (util::Date(1, 1, 1601))
static
bool operator==(const util::DateTime &i_rLeft, const util::DateTime &i_rRight)
@ -52,7 +54,8 @@ bool operator==(const util::DateTime &i_rLeft, const util::DateTime &i_rRight)
&& i_rLeft.Hours == i_rRight.Hours
&& i_rLeft.Minutes == i_rRight.Minutes
&& i_rLeft.Seconds == i_rRight.Seconds
&& i_rLeft.NanoSeconds == i_rRight.NanoSeconds;
&& i_rLeft.NanoSeconds == i_rRight.NanoSeconds
&& i_rLeft.IsUTC == i_rRight.IsUTC;
}
static
@ -587,6 +590,7 @@ void SfxOleFileTimeProperty::ImplLoad( SvStream& rStrm )
maDateTime.Minutes = aDateTime.GetMin();
maDateTime.Seconds = aDateTime.GetSec();
maDateTime.NanoSeconds = aDateTime.GetNanoSec();
maDateTime.IsUTC = false;
}
void SfxOleFileTimeProperty::ImplSave( SvStream& rStrm )
@ -895,7 +899,8 @@ void SfxOleSection::SetDateValue( sal_Int32 nPropId, const util::Date& rValue )
SetProperty( SfxOlePropertyRef( new SfxOleFileTimeProperty( nPropId, TIMESTAMP_INVALID_UTILDATETIME ) ) );
else
{
const util::DateTime aValue(0, 0, 0, 0, rValue.Day, rValue.Month, rValue.Year );
const util::DateTime aValue(0, 0, 0, 0, rValue.Day, rValue.Month,
rValue.Year, false );
SetProperty( SfxOlePropertyRef( new SfxOleFileTimeProperty( nPropId, aValue ) ) );
}
}

View File

@ -317,7 +317,7 @@ void SfxPrinterController::jobStarted()
xDocProps->setPrintDate( util::DateTime(
now.GetNanoSec(), now.GetSec(), now.GetMin(), now.GetHour(),
now.GetDay(), now.GetMonth(), now.GetYear() ) );
now.GetDay(), now.GetMonth(), now.GetYear(), false) );
SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( STR_EVENT_PRINTDOC ), mpObjectShell ) );
uno::Sequence < beans::PropertyValue > aOpts;

View File

@ -29,6 +29,7 @@
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/lang/Locale.hpp>
// STATIC DATA -----------------------------------------------------------
DBG_NAME(SfxDateTimeItem)
@ -182,7 +183,8 @@ bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal,
aDateTime.GetHour(),
aDateTime.GetDay(),
aDateTime.GetMonth(),
aDateTime.GetYear() );
aDateTime.GetYear(),
false);
rVal <<= aValue;
return true;
}

View File

@ -97,7 +97,8 @@ namespace svt
&& _rLHS.Hours == _rRHS.Hours
&& _rLHS.Day == _rRHS.Day
&& _rLHS.Month == _rRHS.Month
&& _rLHS.Year == _rRHS.Year;
&& _rLHS.Year == _rRHS.Year
&& _rLHS.IsUTC == _rRHS.IsUTC;
}
//---------------------------------------------------------------------

View File

@ -2187,7 +2187,8 @@ bool HTMLParser::ParseMetaOptionsImpl(
::util::DateTime uDT(aDateTime.GetNanoSec(),
aDateTime.GetSec(), aDateTime.GetMin(),
aDateTime.GetHour(), aDateTime.GetDay(),
aDateTime.GetMonth(), aDateTime.GetYear());
aDateTime.GetMonth(), aDateTime.GetYear(),
false);
if ( HTML_META_CREATED==nAction )
i_xDocProps->setCreationDate( uDT );
else

View File

@ -282,7 +282,8 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline, c
::util::DateTime uDT(aTmplDate.GetNanoSec(),
aTmplDate.GetSec(), aTmplDate.GetMin(),
aTmplDate.GetHour(), aTmplDate.GetDay(),
aTmplDate.GetMonth(), aTmplDate.GetYear());
aTmplDate.GetMonth(), aTmplDate.GetYear(),
false );
xDocProps->setTemplateDate(uDT);
xDocProps->setTemplateURL(rPath);
// Set the new doc's title to the text of the "split para".

View File

@ -1499,7 +1499,7 @@ void SwWW8ImplReader::ImportDop()
::util::DateTime uDT(aLastPrinted.GetNanoSec(),
aLastPrinted.GetSec(), aLastPrinted.GetMin(),
aLastPrinted.GetHour(), aLastPrinted.GetDay(),
aLastPrinted.GetMonth(), aLastPrinted.GetYear());
aLastPrinted.GetMonth(), aLastPrinted.GetYear(), false);
xDocuProps->setPrintDate(uDT);
}

View File

@ -3309,7 +3309,7 @@ void UnoDateFieldControl::textChanged( const awt::TextEvent& e ) throw(uno::Runt
if ( xText.is() && xText->getText().getLength() )
// and in real, the text of the peer is *not* empty
// -> simulate an invalid date, which is different from "no date"
aValue <<= util::Date( 0, 0, 0 );
aValue <<= util::Date();
}
}
else

View File

@ -54,7 +54,8 @@ namespace ftp {
hours,
day,
month,
year) { }
year,
false) { }
void SetYear(sal_uInt16 year) { Year = year; }
void SetMonth(sal_uInt16 month) { Month = month; }

View File

@ -391,7 +391,7 @@ static util::DateTime getDateFromUnix (time_t t)
if ( osl_getDateTimeFromTimeValue( &tv, &dt ) )
return util::DateTime( 0, dt.Seconds, dt.Minutes, dt.Hours,
dt.Day, dt.Month, dt.Year);
dt.Day, dt.Month, dt.Year, false);
else
return util::DateTime();
}

View File

@ -25,6 +25,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx>
namespace
{
sal_Int32 impl_pow(sal_Int32 x, sal_Int32 y)
@ -299,7 +300,7 @@ bool ISO8601parseDateTime(const OUString &rString, starutil::DateTime& rDateTime
if (bSuccess)
{
rDateTime = starutil::DateTime(aTime.NanoSeconds, aTime.Seconds, aTime.Minutes, aTime.Hours,
aDate.Day, aDate.Month, aDate.Year);
aDate.Day, aDate.Month, aDate.Year, false);
}
return bSuccess;

View File

@ -189,7 +189,7 @@ static const char* lcl_RtfToString(RTFKeyword nKeyword)
static util::DateTime lcl_getDateTime(RTFParserState& aState)
{
return util::DateTime(0 /*100sec*/, 0 /*sec*/, aState.nMinute, aState.nHour,
aState.nDay, aState.nMonth, aState.nYear);
aState.nDay, aState.nMonth, aState.nYear, false);
}
static void lcl_DestinationToMath(OUStringBuffer& rDestinationText, oox::formulaimport::XmlStreamBuilder& rMathBuffer, bool& rMathNor)

View File

@ -1165,7 +1165,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >&
sal_Bool bHasMainTitle = sal_False;
sal_Bool bHasSubTitle = sal_False;
sal_Bool bHasLegend = sal_False;
util::DateTime aNullDate(0,0,0,0,30,12,1899);
util::DateTime aNullDate(0,0,0,0,30,12,1899, false);
std::vector< XMLPropertyState > aPropertyStates;