diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-09 16:57:22 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-09 17:13:44 +0100 |
commit | 6dc0a4431f48546265d9cab7a8be25131ef18f53 (patch) | |
tree | 1d3495520ebeed04da82df72a4fd27758dddcace /xmlsecurity/source/helper/xsecctl.cxx | |
parent | offapi: fix even more doxygen warnings (diff) | |
download | core-6dc0a4431f48546265d9cab7a8be25131ef18f53.tar.gz core-6dc0a4431f48546265d9cab7a8be25131ef18f53.zip |
xmlsecurity OOXML export: fix prefix and suffix of stream references
In ODF, they're relative to the package root, in OOXML they always start
with a leading slash.
Also, in OOXML the stream URI should have its content type as the
suffix.
Change-Id: Iac570ed15533a23c8a6098f99b716f90e1bac0e0
Diffstat (limited to 'xmlsecurity/source/helper/xsecctl.cxx')
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index b4c3031f5f1f..b45e24b8b725 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -986,11 +986,12 @@ static bool lcl_isOOXMLBlacklist(const OUString& rStreamName) #endif const std::initializer_list<OUStringLiteral> vBlacklist = { - OUStringLiteral("%5BContent_Types%5D.xml"), - OUStringLiteral("docProps/app.xml"), - OUStringLiteral("docProps/core.xml") + OUStringLiteral("/%5BContent_Types%5D.xml"), + OUStringLiteral("/docProps/app.xml"), + OUStringLiteral("/docProps/core.xml") }; - return std::find(vBlacklist.begin(), vBlacklist.end(), rStreamName) != vBlacklist.end(); + // Just check the prefix, as we don't care about the content type part of the stream name. + return std::find_if(vBlacklist.begin(), vBlacklist.end(), [&](const OUStringLiteral& rLiteral) { return rStreamName.startsWith(rLiteral); }) != vBlacklist.end(); } void XSecController::exportOOXMLSignature(const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler, const SignatureInformation& rInformation) |