[Libreoffice-commits] core.git: xmlsecurity/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Aug 1 13:02:21 UTC 2018
xmlsecurity/source/helper/xmlsignaturehelper.cxx | 29 +++++++++++------------
1 file changed, 14 insertions(+), 15 deletions(-)
New commits:
commit 090616c5fb01a649076e535ad8ef43bd027f4fa2
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 1 09:18:16 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 1 15:01:53 2018 +0200
flatten conditionals
Change-Id: I3b3e45a20c41e538849b7b0b4cdf112d8fac8fe7
Reviewed-on: https://gerrit.libreoffice.org/58388
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 43efcb618b1c..1118bff743c7 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -370,21 +370,20 @@ bool XMLSignatureHelper::ReadAndVerifySignatureStorage(const uno::Reference<embe
if (!bCacheLastSignature && i == aRelationsInfo.getLength() - 1)
bCache = false;
- if (bCache)
- {
- // Store the contents of the stream as is, in case we need to write it back later.
- xInputStream.clear();
- xInputStream.set(xStorage->openStreamElement(it->Second, nOpenMode), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xPropertySet(xInputStream, uno::UNO_QUERY);
- if (xPropertySet.is())
- {
- sal_Int64 nSize = 0;
- xPropertySet->getPropertyValue("Size") >>= nSize;
- uno::Sequence<sal_Int8> aData;
- xInputStream->readBytes(aData, nSize);
- mpXSecController->setSignatureBytes(aData);
- }
- }
+ if (!bCache)
+ continue;
+ // Store the contents of the stream as is, in case we need to write it back later.
+ xInputStream.clear();
+ xInputStream.set(xStorage->openStreamElement(it->Second, nOpenMode), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xInputStream, uno::UNO_QUERY);
+ if (!xPropertySet.is())
+ continue;
+
+ sal_Int64 nSize = 0;
+ xPropertySet->getPropertyValue("Size") >>= nSize;
+ uno::Sequence<sal_Int8> aData;
+ xInputStream->readBytes(aData, nSize);
+ mpXSecController->setSignatureBytes(aData);
}
}
}
More information about the Libreoffice-commits
mailing list