diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-06-28 00:43:19 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-07-15 11:46:41 +0000 |
commit | 652ccbdf3111766fadc379a8cf4650b744e1e19c (patch) | |
tree | 5efdab367c4da4ac6c62ad1e228b77648cc62aed /sfx2/source | |
parent | a8e8d46020702c64ff314adbe87e6f21e73e1999 (diff) |
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>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/sfxpicklist.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/oleprops.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 2 |
6 files changed, 26 insertions, 16 deletions
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index f18b1db0b3da..a32cfee1fe78 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -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 ) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 153d17ca5896..c741c3959e4a 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -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; } diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index fe08d67a0fcd..520db84f3e12 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -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()); diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index c697f6393d6b..811836910891 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -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 ); } diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index a8888cd72336..6b16d3c46eab 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -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 ) ) ); } } diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index dab76f34b1f6..555bc8f2ffb6 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -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; |