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 /xmlsecurity/source/helper | |
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 'xmlsecurity/source/helper')
-rw-r--r-- | xmlsecurity/source/helper/xmlsignaturehelper.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index 4ffe2c27d243..9f04c58c0b64 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -26,6 +26,7 @@ #include <tools/stream.hxx> #include <tools/debug.hxx> +#include <tools/datetime.hxx> #include <xmloff/attrlist.hxx> @@ -121,16 +122,9 @@ void XMLSignatureHelper::SetX509Certificate( ouX509Cert); } -void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const tools::Time& rTime ) +void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const ::Date& rDate, const tools::Time& rTime ) { - ::com::sun::star::util::DateTime stDateTime; - stDateTime.NanoSeconds = rTime.GetNanoSec(); - stDateTime.Seconds = (::sal_uInt16)rTime.GetSec(); - stDateTime.Minutes = (::sal_uInt16)rTime.GetMin(); - stDateTime.Hours = (::sal_uInt16)rTime.GetHour(); - stDateTime.Day = (::sal_uInt16)rDate.GetDay(); - stDateTime.Month = (::sal_uInt16)rDate.GetMonth(); - stDateTime.Year = (::sal_uInt16)rDate.GetYear(); + css::util::DateTime stDateTime = ::DateTime(rDate, rTime).GetUNODateTime(); mpXSecController->setDate( nSecurityId, stDateTime ); } |