summaryrefslogtreecommitdiffstats
path: root/xmlsecurity
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 /xmlsecurity
parentDecrease the formula group size limit for OpenCL to be considered back to 100 (diff)
downloadcore-c32a5a3b8e2e3a49ac9f1fd3f2872b00612676b7.tar.gz
core-c32a5a3b8e2e3a49ac9f1fd3f2872b00612676b7.zip
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')
-rw-r--r--xmlsecurity/source/dialogs/resourcemanager.cxx4
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper.cxx12
2 files changed, 4 insertions, 12 deletions
diff --git a/xmlsecurity/source/dialogs/resourcemanager.cxx b/xmlsecurity/source/dialogs/resourcemanager.cxx
index 5407d3933ae7..ed2c02c8d9da 100644
--- a/xmlsecurity/source/dialogs/resourcemanager.cxx
+++ b/xmlsecurity/source/dialogs/resourcemanager.cxx
@@ -52,9 +52,7 @@ namespace XmlSec
DateTime GetDateTime( const ::com::sun::star::util::DateTime& _rDT )
{
- return DateTime(
- Date( _rDT.Day, _rDT.Month, _rDT.Year ),
- tools::Time( _rDT.Hours, _rDT.Minutes, _rDT.Seconds, _rDT.NanoSeconds ) );
+ return DateTime(_rDT);
}
OUString GetDateTimeString( const ::com::sun::star::util::DateTime& _rDT )
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 );
}