summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-04-08 11:08:30 +0200
committerEike Rathke <erack@redhat.com>2014-04-08 11:54:33 +0200
commita65e9fd24d905d03cd77551f2d6c9b2efa18fff6 (patch)
treeb38ce160877849ebe30aa12b9bd7bcf2859acedc /sc
parentd8ad7d5790d5770ae5c197f57bb26e414fdff07e (diff)
hold security descriptors read from OOXML independently
If anyone knows how to interpret that stuff and convert between BIFF/OOXML feel free to implement.. According to ISO/IEC 29000 the securityDescriptor is application defined, but recommends that username@domain be used, which is addr-spec of RFC 822. Well, what Excel2013 writes is something like this 'O:WDG:WDD:(A;;CC;;;S-1-5-21-2328606873-448790680-2149751550-1003)' Change-Id: I138fa116b019f200c211272abf69831bc49127ab
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/tabprotection.hxx8
-rw-r--r--sc/source/core/data/tabprotection.cxx6
2 files changed, 10 insertions, 4 deletions
diff --git a/sc/inc/tabprotection.hxx b/sc/inc/tabprotection.hxx
index a224dc80a10e..2dc798c96e20 100644
--- a/sc/inc/tabprotection.hxx
+++ b/sc/inc/tabprotection.hxx
@@ -119,9 +119,15 @@ struct ScEnhancedProtection
sal_uInt32 mnAreserved;
sal_uInt32 mnPasswordVerifier;
OUString maTitle;
- ::std::vector< sal_uInt8 > maSecurityDescriptor; // raw data
+ ::std::vector< sal_uInt8 > maSecurityDescriptor; // imported as raw BIFF data
+ OUString maSecurityDescriptorXML; // imported from OOXML
ScEnhancedProtection() : mnAreserved(0), mnPasswordVerifier(0) {}
+
+ bool hasSecurityDescriptor() const
+ {
+ return !maSecurityDescriptor.empty() || !maSecurityDescriptorXML.isEmpty();
+ }
};
/** sheet protection state container
diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx
index f8a6a1209514..a9bfd8f78a70 100644
--- a/sc/source/core/data/tabprotection.cxx
+++ b/sc/source/core/data/tabprotection.cxx
@@ -396,7 +396,7 @@ bool ScTableProtectionImpl::isBlockEditable( const ScRange& rRange ) const
for (::std::vector<ScEnhancedProtection>::const_iterator it(maEnhancedProtection.begin()),
itEnd(maEnhancedProtection.end()); it != itEnd; ++it)
{
- if ((*it).maSecurityDescriptor.empty() && (*it).maRangeList.Is())
+ if (!(*it).hasSecurityDescriptor() && (*it).maRangeList.Is())
{
if ((*it).maRangeList->In( rRange))
{
@@ -416,7 +416,7 @@ bool ScTableProtectionImpl::isBlockEditable( const ScRange& rRange ) const
for (::std::vector<ScEnhancedProtection>::const_iterator it(maEnhancedProtection.begin()),
itEnd(maEnhancedProtection.end()); it != itEnd; ++it)
{
- if ((*it).maSecurityDescriptor.empty() && (*it).maRangeList.Is())
+ if (!(*it).hasSecurityDescriptor() && (*it).maRangeList.Is())
{
ScRangeList aList( (*it).maRangeList->GetIntersectedRange( rRange));
if (aList.size() == 1 && *aList[0] == rRange)
@@ -437,7 +437,7 @@ bool ScTableProtectionImpl::isBlockEditable( const ScRange& rRange ) const
for (::std::vector<ScEnhancedProtection>::const_iterator it(maEnhancedProtection.begin()),
itEnd(maEnhancedProtection.end()); it != itEnd; ++it)
{
- if ((*it).maSecurityDescriptor.empty() && (*it).maRangeList.Is())
+ if (!(*it).hasSecurityDescriptor() && (*it).maRangeList.Is())
{
// Ranges are editable if no password is assigned.
if (!(*it).mnPasswordVerifier)