Kaydet (Commit) b4960947 authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Noel Grandin

xmlsecurity: Ask current datetime only once

... and pass it as the sole argument to XMLSignatureHelper::SetDateTime().

Change-Id: I7f3e8dc90bb34ca347a1ad5a79717a338af3bed9
Reviewed-on: https://gerrit.libreoffice.org/54706Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 9082e374
...@@ -37,8 +37,7 @@ ...@@ -37,8 +37,7 @@
#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp> #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp> #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp>
class Date; class DateTime;
namespace tools { class Time; }
namespace com { namespace com {
namespace sun { namespace sun {
...@@ -128,7 +127,7 @@ public: ...@@ -128,7 +127,7 @@ public:
void SetGpgCertificate(sal_Int32 nSecurityId, const OUString& ouGpgCertDigest, void SetGpgCertificate(sal_Int32 nSecurityId, const OUString& ouGpgCertDigest,
const OUString& ouGpgCert, const OUString& ouGpgOwner); const OUString& ouGpgCert, const OUString& ouGpgOwner);
void SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const tools::Time& rTime ); void SetDateTime( sal_Int32 nSecurityId, const DateTime& rDateTime );
void SetDescription(sal_Int32 nSecurityId, const OUString& rDescription); void SetDescription(sal_Int32 nSecurityId, const OUString& rDescription);
void SetSignatureLineId(sal_Int32 nSecurityId, const OUString& rSignatureLineId); void SetSignatureLineId(sal_Int32 nSecurityId, const OUString& rSignatureLineId);
void void
......
...@@ -35,8 +35,7 @@ ...@@ -35,8 +35,7 @@
#include <comphelper/storagehelper.hxx> #include <comphelper/storagehelper.hxx>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <sax/tools/converter.hxx> #include <sax/tools/converter.hxx>
#include <tools/date.hxx> #include <tools/datetime.hxx>
#include <tools/time.hxx>
#include <o3tl/make_unique.hxx> #include <o3tl/make_unique.hxx>
#include <certificate.hxx> #include <certificate.hxx>
...@@ -385,8 +384,7 @@ bool DocumentSignatureManager::add( ...@@ -385,8 +384,7 @@ bool DocumentSignatureManager::add(
maSignatureHelper.AddForSigning(nSecurityId, aElements[n], bBinaryMode, bAdESCompliant); maSignatureHelper.AddForSigning(nSecurityId, aElements[n], bBinaryMode, bAdESCompliant);
} }
maSignatureHelper.SetDateTime(nSecurityId, Date(Date::SYSTEM), maSignatureHelper.SetDateTime(nSecurityId, DateTime(DateTime::SYSTEM));
tools::Time(tools::Time::SYSTEM));
maSignatureHelper.SetDescription(nSecurityId, rDescription); maSignatureHelper.SetDescription(nSecurityId, rDescription);
if (!rSignatureLineId.isEmpty()) if (!rSignatureLineId.isEmpty())
......
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/io/XSeekable.hpp>
#include <tools/date.hxx>
#include <tools/time.hxx>
#include <comphelper/ofopxmlhelper.hxx> #include <comphelper/ofopxmlhelper.hxx>
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
...@@ -139,9 +137,9 @@ void XMLSignatureHelper::SetGpgCertificate(sal_Int32 nSecurityId, ...@@ -139,9 +137,9 @@ void XMLSignatureHelper::SetGpgCertificate(sal_Int32 nSecurityId,
ouGpgOwner); ouGpgOwner);
} }
void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const ::Date& rDate, const tools::Time& rTime ) void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const ::DateTime& rDateTime )
{ {
css::util::DateTime stDateTime = ::DateTime(rDate, rTime).GetUNODateTime(); css::util::DateTime stDateTime = rDateTime.GetUNODateTime();
mpXSecController->setDate( nSecurityId, stDateTime ); mpXSecController->setDate( nSecurityId, stDateTime );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment