LibreOffice Module sc (master) 1
Public Types | Public Member Functions | Private Attributes | List of all members
ScTableProtection Class Referencefinal

sheet protection state container More...

#include <tabprotection.hxx>

Inheritance diagram for ScTableProtection:
[legend]
Collaboration diagram for ScTableProtection:
[legend]

Public Types

enum  Option {
  AUTOFILTER = 0 ,
  DELETE_COLUMNS ,
  DELETE_ROWS ,
  FORMAT_CELLS ,
  FORMAT_COLUMNS ,
  FORMAT_ROWS ,
  INSERT_COLUMNS ,
  INSERT_HYPERLINKS ,
  INSERT_ROWS ,
  OBJECTS ,
  PIVOT_TABLES ,
  SCENARIOS ,
  SELECT_LOCKED_CELLS ,
  SELECT_UNLOCKED_CELLS ,
  SORT ,
  NONE
}
 

Public Member Functions

 ScTableProtection ()
 
 ScTableProtection (const ScTableProtection &r)
 
virtual ~ScTableProtection () override
 
virtual bool isProtected () const override
 
virtual bool isProtectedWithPass () const override
 
virtual void setProtected (bool bProtected) override
 
virtual bool isPasswordEmpty () const override
 
virtual bool hasPasswordHash (ScPasswordHash eHash, ScPasswordHash eHash2=PASSHASH_UNSPECIFIED) const override
 
virtual void setPassword (const OUString &aPassText) override
 
virtual css::uno::Sequence< sal_Int8getPasswordHash (ScPasswordHash eHash, ScPasswordHash eHash2=PASSHASH_UNSPECIFIED) const override
 
virtual const ScOoxPasswordHashgetPasswordHash () const override
 
virtual void setPasswordHash (const css::uno::Sequence< sal_Int8 > &aPassword, ScPasswordHash eHash, ScPasswordHash eHash2=PASSHASH_UNSPECIFIED) override
 
virtual void setPasswordHash (const OUString &rAlgorithmName, const OUString &rHashValue, const OUString &rSaltValue, sal_uInt32 nSpinCount) override
 
virtual bool verifyPassword (const OUString &aPassText) const override
 
bool isOptionEnabled (Option eOption) const
 
void setOption (Option eOption, bool bEnabled)
 
void setEnhancedProtection (::std::vector< ScEnhancedProtection > &&rProt)
 
const ::std::vector< ScEnhancedProtection > & getEnhancedProtection () const
 
bool updateReference (UpdateRefMode, const ScDocument &, const ScRange &rWhere, SCCOL nDx, SCROW nDy, SCTAB nDz)
 
bool isBlockEditable (const ScRange &rRange) const
 
bool isSelectionEditable (const ScRangeList &rRangeList) const
 
- Public Member Functions inherited from ScPassHashProtectable
virtual ~ScPassHashProtectable ()=0
 
virtual bool isProtected () const =0
 
virtual bool isProtectedWithPass () const =0
 
virtual void setProtected (bool bProtected)=0
 
virtual bool isPasswordEmpty () const =0
 
virtual bool hasPasswordHash (ScPasswordHash eHash, ScPasswordHash eHash2=PASSHASH_UNSPECIFIED) const =0
 
virtual void setPassword (const OUString &aPassText)=0
 
virtual css::uno::Sequence< sal_Int8getPasswordHash (ScPasswordHash eHash, ScPasswordHash eHas2=PASSHASH_UNSPECIFIED) const =0
 
virtual const ScOoxPasswordHashgetPasswordHash () const =0
 
virtual void setPasswordHash (const css::uno::Sequence< sal_Int8 > &aPassword, ScPasswordHash eHash, ScPasswordHash eHash2=PASSHASH_UNSPECIFIED)=0
 
virtual void setPasswordHash (const OUString &rAlgorithmName, const OUString &rHashValue, const OUString &rSaltValue, sal_uInt32 nSpinCount)=0
 
virtual bool verifyPassword (const OUString &aPassText) const =0
 

Private Attributes

std::unique_ptr< ScTableProtectionImplmpImpl
 

Detailed Description

sheet protection state container

This class stores sheet's protection state: 1) whether the protection is on, 2) password and/or password hash, and 3) any associated protection options. This class is also used as a protection state container for the undo/redo stack, in which case the password, hash and the options need to be preserved even when the protection flag is off.

Definition at line 166 of file tabprotection.hxx.

Member Enumeration Documentation

◆ Option

Enumerator
AUTOFILTER 
DELETE_COLUMNS 
DELETE_ROWS 
FORMAT_CELLS 
FORMAT_COLUMNS 
FORMAT_ROWS 
INSERT_COLUMNS 
INSERT_HYPERLINKS 
INSERT_ROWS 
OBJECTS 
PIVOT_TABLES 
SCENARIOS 
SELECT_LOCKED_CELLS 
SELECT_UNLOCKED_CELLS 
SORT 
NONE 

last item - used to resize the vector

Definition at line 169 of file tabprotection.hxx.

Constructor & Destructor Documentation

◆ ScTableProtection() [1/2]

ScTableProtection::ScTableProtection ( )
explicit

Definition at line 613 of file tabprotection.cxx.

References mpImpl, SELECT_LOCKED_CELLS, and SELECT_UNLOCKED_CELLS.

◆ ScTableProtection() [2/2]

ScTableProtection::ScTableProtection ( const ScTableProtection r)
explicit

Definition at line 621 of file tabprotection.cxx.

◆ ~ScTableProtection()

ScTableProtection::~ScTableProtection ( )
overridevirtual

Definition at line 627 of file tabprotection.cxx.

Member Function Documentation

◆ getEnhancedProtection()

const ::std::vector< ScEnhancedProtection > & ScTableProtection::getEnhancedProtection ( ) const

Definition at line 703 of file tabprotection.cxx.

References mpImpl.

Referenced by ExcTable::FillAsTableBinary(), and XclExpSheetProtection::SaveXml().

◆ getPasswordHash() [1/2]

const ScOoxPasswordHash & ScTableProtection::getPasswordHash ( ) const
overridevirtual

Implements ScPassHashProtectable.

Definition at line 666 of file tabprotection.cxx.

References mpImpl.

◆ getPasswordHash() [2/2]

Sequence< sal_Int8 > ScTableProtection::getPasswordHash ( ScPasswordHash  eHash,
ScPasswordHash  eHash2 = PASSHASH_UNSPECIFIED 
) const
overridevirtual

◆ hasPasswordHash()

bool ScTableProtection::hasPasswordHash ( ScPasswordHash  eHash,
ScPasswordHash  eHash2 = PASSHASH_UNSPECIFIED 
) const
overridevirtual

Implements ScPassHashProtectable.

Definition at line 651 of file tabprotection.cxx.

References mpImpl.

Referenced by ScRetypePassDlg::SetTableData(), and ScXMLExport::WriteTable().

◆ isBlockEditable()

bool ScTableProtection::isBlockEditable ( const ScRange rRange) const

Definition at line 714 of file tabprotection.cxx.

References mpImpl.

◆ isOptionEnabled()

bool ScTableProtection::isOptionEnabled ( Option  eOption) const

◆ isPasswordEmpty()

bool ScTableProtection::isPasswordEmpty ( ) const
overridevirtual

Implements ScPassHashProtectable.

Definition at line 646 of file tabprotection.cxx.

References mpImpl.

Referenced by ScRetypePassDlg::SetTableData().

◆ isProtected()

bool ScTableProtection::isProtected ( ) const
overridevirtual

◆ isProtectedWithPass()

bool ScTableProtection::isProtectedWithPass ( ) const
overridevirtual

Implements ScPassHashProtectable.

Definition at line 636 of file tabprotection.cxx.

References mpImpl.

Referenced by ScTabViewShell::Execute().

◆ isSelectionEditable()

bool ScTableProtection::isSelectionEditable ( const ScRangeList rRangeList) const

Definition at line 719 of file tabprotection.cxx.

References mpImpl.

◆ setEnhancedProtection()

void ScTableProtection::setEnhancedProtection ( ::std::vector< ScEnhancedProtection > &&  rProt)

Definition at line 698 of file tabprotection.cxx.

References mpImpl.

Referenced by oox::xls::WorksheetSettings::finalizeImport().

◆ setOption()

void ScTableProtection::setOption ( Option  eOption,
bool  bEnabled 
)

◆ setPassword()

void ScTableProtection::setPassword ( const OUString &  aPassText)
overridevirtual

Implements ScPassHashProtectable.

Definition at line 656 of file tabprotection.cxx.

References mpImpl.

Referenced by ScTableProtectionDlg::WriteData().

◆ setPasswordHash() [1/2]

virtual void ScTableProtection::setPasswordHash ( const css::uno::Sequence< sal_Int8 > &  aPassword,
ScPasswordHash  eHash,
ScPasswordHash  eHash2 = PASSHASH_UNSPECIFIED 
)
overridevirtual

◆ setPasswordHash() [2/2]

void ScTableProtection::setPasswordHash ( const OUString &  rAlgorithmName,
const OUString &  rHashValue,
const OUString &  rSaltValue,
sal_uInt32  nSpinCount 
)
overridevirtual

Implements ScPassHashProtectable.

Definition at line 677 of file tabprotection.cxx.

References mpImpl.

◆ setProtected()

void ScTableProtection::setProtected ( bool  bProtected)
overridevirtual

◆ updateReference()

bool ScTableProtection::updateReference ( UpdateRefMode  eMode,
const ScDocument rDoc,
const ScRange rWhere,
SCCOL  nDx,
SCROW  nDy,
SCTAB  nDz 
)

Definition at line 708 of file tabprotection.cxx.

References eMode, and mpImpl.

◆ verifyPassword()

bool ScTableProtection::verifyPassword ( const OUString &  aPassText) const
overridevirtual

Implements ScPassHashProtectable.

Definition at line 683 of file tabprotection.cxx.

References mpImpl.

Referenced by ScDocFunc::Unprotect().

Member Data Documentation

◆ mpImpl

std::unique_ptr<ScTableProtectionImpl> ScTableProtection::mpImpl
private

The documentation for this class was generated from the following files: