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:
@@ -3667,9 +3667,12 @@ bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUS
|
|||||||
{
|
{
|
||||||
bool bChanges = false;
|
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
|
// The component should know if there was a valid document signature, since
|
||||||
// it should show a warning in this case
|
// it should show a warning in this case
|
||||||
uno::Reference< security::XDocumentDigitalSignatures > xSigner(
|
uno::Reference< security::XDocumentDigitalSignatures > xSigner(
|
||||||
@@ -3842,7 +3845,6 @@ bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUS
|
|||||||
}
|
}
|
||||||
|
|
||||||
ResetError();
|
ResetError();
|
||||||
}
|
|
||||||
|
|
||||||
return bChanges;
|
return bChanges;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user