[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-1' - dbaccess/source
Samuel Mehrbrodt (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 8 21:51:24 UTC 2020
dbaccess/source/core/dataaccess/ModelImpl.cxx | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
New commits:
commit 903c3f6bac1814adb39246bacb117fffd796d03e
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Mar 31 08:18:48 2020 +0200
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Apr 8 23:50:54 2020 +0200
Fix reading ODF version
Change-Id: I5787737d3f689fba93bf4be56c018967b5e37ab1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91407
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
(cherry picked from commit 1ec7b4ae86a9fe666fc1510636c483d8980d04f6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91918
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 0e1934f364c6..ef4525cc3877 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -1310,19 +1310,11 @@ bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor)
// which leads to signatures not being found
Reference<XStorage> xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
ZIP_STORAGE_FORMAT_STRING, m_sDocFileLocation, ElementModes::READ);
- OUString aVersion;
- try
- {
- uno::Reference<beans::XPropertySet> xPropSet(xStorage, uno::UNO_QUERY_THROW);
- xPropSet->getPropertyValue("Version") >>= aVersion;
- }
- catch (uno::Exception&)
- {
- }
+ OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(getOrCreateRootStorage()));
uno::Reference<security::XDocumentDigitalSignatures> xSigner(
security::DocumentDigitalSignatures::createWithVersion(
- comphelper::getProcessComponentContext(), aVersion));
+ comphelper::getProcessComponentContext(), aODFVersion));
uno::Sequence<security::DocumentSignatureInformation> aInfo
= xSigner->verifyScriptingContentSignatures(xStorage,
uno::Reference<io::XInputStream>());
@@ -1350,7 +1342,7 @@ bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor)
aRequest.DocumentURL = m_sDocFileLocation;
aRequest.DocumentStorage = xStorage;
aRequest.DocumentSignatureInformation = aInfo;
- aRequest.DocumentVersion = aVersion;
+ aRequest.DocumentVersion = aODFVersion;
aRequest.Classification = task::InteractionClassification_QUERY;
bResult = SfxMedium::CallApproveHandler(xInteraction, uno::makeAny(aRequest), true);
}
More information about the Libreoffice-commits
mailing list