summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-11 13:35:38 +0200
committerEike Rathke <erack@redhat.com>2015-01-13 15:24:04 +0000
commitc32a5a3b8e2e3a49ac9f1fd3f2872b00612676b7 (patch)
treecb2de3eab8dbbcff359d367177d91b67725e1b69 /svtools
parent86db1702d72a103ffeafc69dcaa63318539c147a (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 'svtools')
-rw-r--r--svtools/source/contnr/contentenumeration.cxx3
-rw-r--r--svtools/source/svhtml/parhtml.cxx6
2 files changed, 2 insertions, 7 deletions
diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx
index c47d8bcddf49..b601bf5eb23b 100644
--- a/svtools/source/contnr/contentenumeration.cxx
+++ b/svtools/source/contnr/contentenumeration.cxx
@@ -51,8 +51,7 @@ namespace svt
#define ROW_IS_COMPACTDISC 12
#define CONVERT_DATETIME( aUnoDT, aToolsDT ) \
- aToolsDT = ::DateTime( Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year ), \
- tools::Time( aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds, aUnoDT.NanoSeconds ) );
+ aToolsDT = ::DateTime( aUnoDT );
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index ce9ba50e44f1..cfbb59b77232 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -2046,11 +2046,7 @@ bool HTMLParser::ParseMetaOptionsImpl(
Date aDate( (sal_uLong)aContent.getToken(0, ';').toInt32() );
tools::Time aTime( (sal_uLong)aContent.getToken(1, ';').toInt32() );
DateTime aDateTime( aDate, aTime );
- ::util::DateTime uDT(aDateTime.GetNanoSec(),
- aDateTime.GetSec(), aDateTime.GetMin(),
- aDateTime.GetHour(), aDateTime.GetDay(),
- aDateTime.GetMonth(), aDateTime.GetYear(),
- false);
+ ::util::DateTime uDT = aDateTime.GetUNODateTime();
if ( HTML_META_CREATED==nAction )
i_xDocProps->setCreationDate( uDT );
else