diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/sfxpicklist.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 28 | ||||
-rw-r--r-- | sfx2/source/dialog/versdlg.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 4 |
6 files changed, 18 insertions, 42 deletions
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 1c2cf0aac38e..8e8452ea3b49 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -395,10 +395,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) if (xDocProps.is()) { xDocProps->setAuthor( SvtUserOptions().GetFullName() ); ::DateTime now( ::DateTime::SYSTEM ); - xDocProps->setCreationDate( util::DateTime( - now.GetNanoSec(), now.GetSec(), now.GetMin(), - now.GetHour(), now.GetDay(), now.GetMonth(), - now.GetYear(), false) ); + xDocProps->setCreationDate( now.GetUNODateTime() ); } if ( bAllowModif ) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 2ebf8a880788..a64c637db3c4 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -175,8 +175,8 @@ OUString CreateSizeText( sal_Int64 nSize ) OUString ConvertDateTime_Impl( const OUString& rName, const util::DateTime& uDT, const LocaleDataWrapper& rWrapper ) { - Date aD(uDT.Day, uDT.Month, uDT.Year); - tools::Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); + Date aD(uDT); + tools::Time aT(uDT); const OUString pDelim ( ", " ); OUString aStr( rWrapper.getDate( aD ) ); aStr += pDelim; @@ -358,9 +358,7 @@ void SfxDocumentInfoItem::resetUserData(const OUString & i_rAuthor) { setAuthor(i_rAuthor); DateTime now( DateTime::SYSTEM ); - setCreationDate( util::DateTime( - now.GetNanoSec(), now.GetSec(), now.GetMin(), now.GetHour(), - now.GetDay(), now.GetMonth(), now.GetYear(), false) ); + setCreationDate( now.GetUNODateTime() ); setModifiedBy(OUString()); setPrintedBy(OUString()); setModificationDate(util::DateTime()); @@ -802,9 +800,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl) aName = SvtUserOptions().GetFullName(); const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); DateTime now( DateTime::SYSTEM ); - util::DateTime uDT( - now.GetNanoSec(), now.GetSec(), now.GetMin(), now.GetHour(), - now.GetDay(), now.GetMonth(), now.GetYear(), false); + util::DateTime uDT( now.GetUNODateTime() ); m_pCreateValFt->SetText( ConvertDateTime_Impl( aName, uDT, rLocaleWrapper ) ); OUString aEmpty; m_pChangeValFt->SetText( aEmpty ); @@ -1814,13 +1810,13 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny ) } else if ( rAny >>= aTmpDate ) { - pNewLine->m_aDateField.SetDate( Date( aTmpDate.Day, aTmpDate.Month, aTmpDate.Year ) ); + pNewLine->m_aDateField.SetDate( Date( aTmpDate ) ); nType = CUSTOM_TYPE_DATE; } else if ( rAny >>= aTmpDateTime ) { - pNewLine->m_aDateField.SetDate( Date( aTmpDateTime.Day, aTmpDateTime.Month, aTmpDateTime.Year ) ); - pNewLine->m_aTimeField.SetTime( tools::Time( aTmpDateTime.Hours, aTmpDateTime.Minutes, aTmpDateTime.Seconds, aTmpDateTime.NanoSeconds ) ); + pNewLine->m_aDateField.SetDate( Date( aTmpDateTime ) ); + pNewLine->m_aTimeField.SetTime( tools::Time( aTmpDateTime ) ); pNewLine->m_aTimeField.m_isUTC = aTmpDateTime.IsUTC; nType = CUSTOM_TYPE_DATETIME; } @@ -1834,9 +1830,8 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny ) else if ( rAny >>= aTmpDateTimeTZ ) { util::DateTime const& rDT(aTmpDateTimeTZ.DateTimeInTZ); - pNewLine->m_aDateField.SetDate( Date( rDT.Day, rDT.Month, rDT.Year ) ); - pNewLine->m_aTimeField.SetTime( tools::Time( rDT.Hours, rDT.Minutes, - rDT.Seconds, rDT.NanoSeconds ) ); + pNewLine->m_aDateField.SetDate( Date( rDT ) ); + pNewLine->m_aTimeField.SetTime( tools::Time( rDT ) ); pNewLine->m_aTimeField.m_isUTC = rDT.IsUTC; pNewLine->m_aDateField.m_TZ = aTmpDateTimeTZ.Timezone; nType = CUSTOM_TYPE_DATETIME; @@ -2240,9 +2235,8 @@ CmisDateTime::CmisDateTime( vcl::Window* pParent, const util::DateTime& aDateTim get( m_aTimeField, "time"); m_aDateField->Show( true ); m_aTimeField->Show( true ); - m_aDateField->SetDate( Date( aDateTime.Day, aDateTime.Month, aDateTime.Year ) ); - m_aTimeField->SetTime( tools::Time( aDateTime.Hours, aDateTime.Minutes, - aDateTime.Seconds, aDateTime.NanoSeconds ) ); + m_aDateField->SetDate( Date( aDateTime ) ); + m_aTimeField->SetTime( tools::Time( aDateTime ) ); } CmisYesNo::CmisYesNo( vcl::Window* pParent, bool bValue ) diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 35c5d73959d2..36cdebf9ec8b 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -94,10 +94,7 @@ SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < util::RevisionTa pInfo->aComment = rInfo[n].Comment; pInfo->aAuthor = rInfo[n].Author; - Date aDate ( rInfo[n].TimeStamp.Day, rInfo[n].TimeStamp.Month, rInfo[n].TimeStamp.Year ); - tools::Time aTime ( rInfo[n].TimeStamp.Hours, rInfo[n].TimeStamp.Minutes, rInfo[n].TimeStamp.Seconds, rInfo[n].TimeStamp.NanoSeconds ); - - pInfo->aCreationDate = DateTime( aDate, aTime ); + pInfo->aCreationDate = DateTime( rInfo[n].TimeStamp ); aTableList.push_back( pInfo ); } } @@ -111,10 +108,7 @@ SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < document::CmisVe pInfo->aComment = rInfo[n].Comment; pInfo->aAuthor = rInfo[n].Author; - Date aDate ( rInfo[n].TimeStamp.Day, rInfo[n].TimeStamp.Month, rInfo[n].TimeStamp.Year ); - tools::Time aTime ( rInfo[n].TimeStamp.Hours, rInfo[n].TimeStamp.Minutes, rInfo[n].TimeStamp.Seconds, rInfo[n].TimeStamp.NanoSeconds ); - - pInfo->aCreationDate = DateTime( aDate, aTime ); + pInfo->aCreationDate = DateTime( rInfo[n].TimeStamp ); aTableList.push_back( pInfo ); } } diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 2310e6b78e47..022d96fb04cd 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1827,8 +1827,7 @@ SfxDocumentMetaData::resetUserData(const OUString & the_value) bool bModified( false ); 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(), false); + css::util::DateTime uDT(now.GetUNODateTime()); 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 00e03330fb44..cd5c294546ea 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -203,10 +203,7 @@ void SfxObjectShell::UpdateDocInfoForSave() { // update ModificationAuthor, revision and editing time ::DateTime now( ::DateTime::SYSTEM ); - xDocProps->setModificationDate( util::DateTime( - now.GetNanoSec(), now.GetSec(), now.GetMin(), - now.GetHour(), now.GetDay(), now.GetMonth(), - now.GetYear(), false) ); + xDocProps->setModificationDate( now.GetUNODateTime() ); xDocProps->setModifiedBy( aUserName ); UpdateTime_Impl( xDocProps ); } @@ -541,10 +538,7 @@ void SfxObjectShell::ResetFromTemplate( const OUString& rTemplateName, const OUS xDocProps->setTemplateName( rTemplateName ); ::DateTime now( ::DateTime::SYSTEM ); - xDocProps->setTemplateDate( util::DateTime( - now.GetNanoSec(), now.GetSec(), now.GetMin(), - now.GetHour(), now.GetDay(), now.GetMonth(), - now.GetYear(), false) ); + xDocProps->setTemplateDate( now.GetUNODateTime() ); SetQueryLoadTemplate( true ); } diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index bef2e880a286..0edd5046c15c 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -314,9 +314,7 @@ void SfxPrinterController::jobStarted() : OUString() ); ::DateTime now( ::DateTime::SYSTEM ); - xDocProps->setPrintDate( util::DateTime( - now.GetNanoSec(), now.GetSec(), now.GetMin(), now.GetHour(), - now.GetDay(), now.GetMonth(), now.GetYear(), false) ); + xDocProps->setPrintDate( now.GetUNODateTime() ); SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( STR_EVENT_PRINTDOC ), mpObjectShell ) ); uno::Sequence < beans::PropertyValue > aOpts; |