diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-08-07 18:16:19 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-08-07 18:19:56 +0200 |
commit | 8b8f6835e60e179de616117f59af64d6f2c34b0a (patch) | |
tree | 68a4bed3d1af4806dbe1e63f753d397ea9a5507d /sc | |
parent | 7851e052d421fd996499a615cf1312ee9b1e1653 (diff) |
fix for fdo#39678: don't write password algorithm in odf 1.0 and 1.1
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 4bdd0e739525..654141810caa 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1524,16 +1524,19 @@ void ScXMLExport::SetBodyAttributes() if (aBuffer.getLength()) { AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); - if (eHashUsed == PASSHASH_XL) + if ( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) { - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, - ScPassHashHelper::getHashURI(PASSHASH_XL)); - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, - ScPassHashHelper::getHashURI(PASSHASH_SHA1)); + if (eHashUsed == PASSHASH_XL) + { + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, + ScPassHashHelper::getHashURI(PASSHASH_XL)); + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, + ScPassHashHelper::getHashURI(PASSHASH_SHA1)); + } + else if (eHashUsed == PASSHASH_SHA1) + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, + ScPassHashHelper::getHashURI(PASSHASH_SHA1)); } - else if (eHashUsed == PASSHASH_SHA1) - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, - ScPassHashHelper::getHashURI(PASSHASH_SHA1)); } } } @@ -2694,16 +2697,19 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe if (aBuffer.getLength()) { AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); - if (eHashUsed == PASSHASH_XL) + if ( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) { - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, - ScPassHashHelper::getHashURI(PASSHASH_XL)); - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, - ScPassHashHelper::getHashURI(PASSHASH_SHA1)); + if (eHashUsed == PASSHASH_XL) + { + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, + ScPassHashHelper::getHashURI(PASSHASH_XL)); + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, + ScPassHashHelper::getHashURI(PASSHASH_SHA1)); + } + else if (eHashUsed == PASSHASH_SHA1) + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, + ScPassHashHelper::getHashURI(PASSHASH_SHA1)); } - else if (eHashUsed == PASSHASH_SHA1) - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, - ScPassHashHelper::getHashURI(PASSHASH_SHA1)); } } } |