Kaydet (Commit) 3974d6a2 authored tarafından Eike Rathke's avatar Eike Rathke

read the defined password attributes

Change-Id: I67be85bdcfb5c03349daeff69fbb09291ce4a8e3
üst 1c772b16
......@@ -121,8 +121,13 @@ struct ScEnhancedProtection
OUString maTitle;
::std::vector< sal_uInt8 > maSecurityDescriptor; // imported as raw BIFF data
OUString maSecurityDescriptorXML; // imported from OOXML
// OOXML password definitions
OUString maAlgorithmName;
OUString maHashValue;
OUString maSaltValue;
sal_uInt32 mnSpinCount;
ScEnhancedProtection() : mnAreserved(0), mnPasswordVerifier(0) {}
ScEnhancedProtection() : mnAreserved(0), mnPasswordVerifier(0), mnSpinCount(0) {}
bool hasSecurityDescriptor() const
{
......
......@@ -143,9 +143,15 @@ void WorksheetSettings::importProtectedRange( const AttributeList& rAttribs )
aProt.maSecurityDescriptorXML = rAttribs.getString( XML_securityDescriptor, OUString());
/* XXX ECMA-376/OOXML or ISO/IEC 29500 do not even mention a 'password'
* attribute here (or anywhere else), but this is what Excel2013 writes,
* similar to BIFF. OOXML XMLschema and ISO/IEC 29500 instead define
* 'algorithmName', 'hashValue', 'saltValue' and 'spinCount'. */
* similar to BIFF, if the original file was a BIFF file. OOXML XMLschema
* and ISO/IEC 29500 instead define 'algorithmName', 'hashValue',
* 'saltValue' and 'spinCount' that are written if the protection was newly
* created. */
aProt.mnPasswordVerifier = rAttribs.getIntegerHex( XML_password, 0);
aProt.maAlgorithmName = rAttribs.getString( XML_algorithmName, OUString());
aProt.maHashValue = rAttribs.getString( XML_hashValue, OUString());
aProt.maSaltValue = rAttribs.getString( XML_saltValue, OUString());
aProt.mnSpinCount = rAttribs.getUnsigned( XML_spinCount, 0);
OUString aRefs( rAttribs.getString( XML_sqref, OUString()));
if (!aRefs.isEmpty())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment