Reduce indentation by returning early on error condition

Change-Id: Iebf6eca68f0dcba87ab517952009ee6dfb4b588c
Reviewed-on: https://gerrit.libreoffice.org/54475
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
Samuel Mehrbrodt
2018-05-17 11:34:37 +02:00
parent b9ebabd675
commit c4409edb4e

View File

@@ -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;
}