Kaydet (Commit) c4409edb authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

Reduce indentation by returning early on error condition

Change-Id: Iebf6eca68f0dcba87ab517952009ee6dfb4b588c
Reviewed-on: https://gerrit.libreoffice.org/54475Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst b9ebabd6
......@@ -3667,9 +3667,12 @@ bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUS
{
bool bChanges = false;
// the medium should be closed to be able to sign, the caller is responsible to close it
if ( !IsOpen() && !GetError() )
if (IsOpen() || GetError())
{
SAL_WARN("sfx.doc", "The medium must be closed by the signer!");
return bChanges;
}
// The component should know if there was a valid document signature, since
// it should show a warning in this case
uno::Reference< security::XDocumentDigitalSignatures > xSigner(
......@@ -3842,7 +3845,6 @@ bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUS
}
ResetError();
}
return bChanges;
}
......
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