diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-12-24 23:40:39 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-01-04 12:44:39 +0100 |
commit | bb59a80ee6000d3922fa95262f67e291fd9d8ee2 (patch) | |
tree | 3b6b4c2ba1e589b67f59e118b752f00010bec238 /oox/source/crypto | |
parent | 2dd45c0c62b3ef3d8057b3fc70af24ae11a3d01d (diff) |
Modifying the impl. of startUnknownElement of FastParser:
Modifying it to emit the namespace URI instead of
prefix and qualified name instead of local name.
This will be useful for handling arbitrary elements
in the fast contexts.
Change-Id: I0f150b862574612e97491f6c335f3f4c9966da0a
Reviewed-on: https://gerrit.libreoffice.org/47055
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'oox/source/crypto')
-rw-r--r-- | oox/source/crypto/DocumentDecryption.cxx | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/oox/source/crypto/DocumentDecryption.cxx b/oox/source/crypto/DocumentDecryption.cxx index 7c646877c425..5f5940ad01db 100644 --- a/oox/source/crypto/DocumentDecryption.cxx +++ b/oox/source/crypto/DocumentDecryption.cxx @@ -81,11 +81,13 @@ public: void SAL_CALL startUnknownElement( const OUString& /*aNamespace*/, const OUString& rName, const Reference< XFastAttributeList >& aAttributeList ) override { - if (rName == "keyData") + const auto& localname = [](const OUString &a) { return a.copy(a.indexOf(":") + 1); }; + const OUString& rLocalName = localname(rName); + if (rLocalName == "keyData") { for (const Attribute& rAttribute : aAttributeList->getUnknownAttributes()) { - if (rAttribute.Name == "saltValue") + if (localname(rAttribute.Name) == "saltValue") { Sequence<sal_Int8> keyDataSalt; ::sax::Converter::decodeBase64(keyDataSalt, rAttribute.Value); @@ -93,61 +95,62 @@ public: } } } - else if (rName == "encryptedKey") + else if (rLocalName == "encryptedKey") { for (const Attribute& rAttribute : aAttributeList->getUnknownAttributes()) { - if (rAttribute.Name == "spinCount") + const OUString& rAttrLocalName = localname(rAttribute.Name); + if (rAttrLocalName == "spinCount") { ::sax::Converter::convertNumber(mInfo.spinCount, rAttribute.Value); } - else if (rAttribute.Name == "saltSize") + else if (rAttrLocalName == "saltSize") { ::sax::Converter::convertNumber(mInfo.saltSize, rAttribute.Value); } - else if (rAttribute.Name == "blockSize") + else if (rAttrLocalName == "blockSize") { ::sax::Converter::convertNumber(mInfo.blockSize, rAttribute.Value); } - else if (rAttribute.Name == "keyBits") + else if (rAttrLocalName == "keyBits") { ::sax::Converter::convertNumber(mInfo.keyBits, rAttribute.Value); } - else if (rAttribute.Name == "hashSize") + else if (rAttrLocalName == "hashSize") { ::sax::Converter::convertNumber(mInfo.hashSize, rAttribute.Value); } - else if (rAttribute.Name == "cipherAlgorithm") + else if (rAttrLocalName == "cipherAlgorithm") { mInfo.cipherAlgorithm = rAttribute.Value; } - else if (rAttribute.Name == "cipherChaining") + else if (rAttrLocalName == "cipherChaining") { mInfo.cipherChaining = rAttribute.Value; } - else if (rAttribute.Name == "hashAlgorithm") + else if (rAttrLocalName == "hashAlgorithm") { mInfo.hashAlgorithm = rAttribute.Value; } - else if (rAttribute.Name == "saltValue") + else if (rAttrLocalName == "saltValue") { Sequence<sal_Int8> saltValue; ::sax::Converter::decodeBase64(saltValue, rAttribute.Value); mInfo.saltValue = convertToVector(saltValue); } - else if (rAttribute.Name == "encryptedVerifierHashInput") + else if (rAttrLocalName == "encryptedVerifierHashInput") { Sequence<sal_Int8> encryptedVerifierHashInput; ::sax::Converter::decodeBase64(encryptedVerifierHashInput, rAttribute.Value); mInfo.encryptedVerifierHashInput = convertToVector(encryptedVerifierHashInput); } - else if (rAttribute.Name == "encryptedVerifierHashValue") + else if (rAttrLocalName == "encryptedVerifierHashValue") { Sequence<sal_Int8> encryptedVerifierHashValue; ::sax::Converter::decodeBase64(encryptedVerifierHashValue, rAttribute.Value); mInfo.encryptedVerifierHashValue = convertToVector(encryptedVerifierHashValue); } - else if (rAttribute.Name == "encryptedKeyValue") + else if (rAttrLocalName == "encryptedKeyValue") { Sequence<sal_Int8> encryptedKeyValue; ::sax::Converter::decodeBase64(encryptedKeyValue, rAttribute.Value); |