diff options
author | Eike Rathke <erack@redhat.com> | 2014-04-08 13:49:42 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-04-08 14:44:26 +0200 |
commit | 3974d6a2d96ec3facf529a4e54a2db63783961dd (patch) | |
tree | f2da545c50f0d53578b078749861da29588b5f14 /sc | |
parent | 1c772b16829364ce6a98f3b9584fe68f8f93f7d7 (diff) |
read the defined password attributes
Change-Id: I67be85bdcfb5c03349daeff69fbb09291ce4a8e3
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/tabprotection.hxx | 7 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheetsettings.cxx | 10 |
2 files changed, 14 insertions, 3 deletions
diff --git a/sc/inc/tabprotection.hxx b/sc/inc/tabprotection.hxx index 2dc798c96e20..b057ad08fb0f 100644 --- a/sc/inc/tabprotection.hxx +++ b/sc/inc/tabprotection.hxx @@ -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 { diff --git a/sc/source/filter/oox/worksheetsettings.cxx b/sc/source/filter/oox/worksheetsettings.cxx index 01804dc52fe5..18f3da5b39cc 100644 --- a/sc/source/filter/oox/worksheetsettings.cxx +++ b/sc/source/filter/oox/worksheetsettings.cxx @@ -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()) { |