diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-11 13:35:38 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-01-13 15:24:04 +0000 |
commit | c32a5a3b8e2e3a49ac9f1fd3f2872b00612676b7 (patch) | |
tree | cb2de3eab8dbbcff359d367177d91b67725e1b69 /sfx2/source/doc | |
parent | 86db1702d72a103ffeafc69dcaa63318539c147a (diff) |
simplify Date/Time/DateTime conversion code
add constructors to Date/DateTime/Time,
that take the css::util counterparts,
to simplify code converting between these type
Change-Id: I4b03da02c63f65b6ec18cb4d6ecc3859bdef1ff7
Reviewed-on: https://gerrit.libreoffice.org/13855
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 10 |
2 files changed, 3 insertions, 10 deletions
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 ); } |