summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-31 08:18:48 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-31 09:08:19 +0200
commit1ec7b4ae86a9fe666fc1510636c483d8980d04f6 (patch)
tree409f12f8286d2d9b18f5c8939cf3c8bdca47200f /dbaccess
parent6c89715b7d1e78a17b6c53cdb89f2f734500fd44 (diff)
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@cib.de>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 35e6215163d6..2b098e235e07 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -1293,19 +1293,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>());
@@ -1333,7 +1325,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);
}