Kaydet (Commit) fcdc8178 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

sfx2: add RecheckSignature to run signature verification again

This was extracted from AfterSigning method and is needed when
we add the certificate chain to the database after the document
was loaded already.

Change-Id: I3087386d0131ce962eb3b588c409542617eb7bfe
Reviewed-on: https://gerrit.libreoffice.org/62275
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst e581cc2e
......@@ -357,6 +357,7 @@ public:
/** Returns to if preparing was successful, else false. */
bool PrepareForSigning(weld::Window* pDialogParent);
bool CheckIsReadonly(bool bSignScriptingContent);
void RecheckSignature(bool bAlsoRecheckScriptingSignature);
void AfterSigning(bool bSignSuccess, bool bSignScriptingContent);
bool HasValidSignatures();
SignatureState GetDocumentSignatureState();
......
......@@ -1498,6 +1498,18 @@ bool SfxObjectShell::PrepareForSigning(weld::Window* pDialogParent)
return false;
}
void SfxObjectShell::RecheckSignature(bool bAlsoRecheckScriptingSignature)
{
if (bAlsoRecheckScriptingSignature)
pImpl->nScriptingSignatureState = SignatureState::UNKNOWN; // Re-Check
pImpl->nDocumentSignatureState = SignatureState::UNKNOWN; // Re-Check
Invalidate(SID_SIGNATURE);
Invalidate(SID_MACRO_SIGNATURE);
Broadcast(SfxHint(SfxHintId::TitleChanged));
}
void SfxObjectShell::AfterSigning(bool bSignSuccess, bool bSignScriptingContent)
{
pImpl->m_bSavingForSigning = true;
......@@ -1505,16 +1517,7 @@ void SfxObjectShell::AfterSigning(bool bSignSuccess, bool bSignScriptingContent)
pImpl->m_bSavingForSigning = false;
if ( bSignSuccess )
{
if ( bSignScriptingContent )
pImpl->nScriptingSignatureState = SignatureState::UNKNOWN; // Re-Check
pImpl->nDocumentSignatureState = SignatureState::UNKNOWN; // Re-Check
Invalidate( SID_SIGNATURE );
Invalidate( SID_MACRO_SIGNATURE );
Broadcast( SfxHint(SfxHintId::TitleChanged) );
}
RecheckSignature(bSignScriptingContent);
if ( pImpl->m_bAllowModifiedBackAfterSigning )
EnableSetModified();
......
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