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 (const ::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
 

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 167 of file tabprotection.hxx.

Member Enumeration Documentation

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 170 of file tabprotection.hxx.

Constructor & Destructor Documentation

ScTableProtection::ScTableProtection ( )
explicit

Definition at line 613 of file tabprotection.cxx.

References mpImpl, SELECT_LOCKED_CELLS, and SELECT_UNLOCKED_CELLS.

ScTableProtection::ScTableProtection ( const ScTableProtection r)
explicit

Definition at line 621 of file tabprotection.cxx.

ScTableProtection::~ScTableProtection ( )
overridevirtual

Definition at line 627 of file tabprotection.cxx.

Member Function Documentation

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

Definition at line 703 of file tabprotection.cxx.

References mpImpl.

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

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

Implements ScPassHashProtectable.

Definition at line 666 of file tabprotection.cxx.

References mpImpl.

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

Definition at line 714 of file tabprotection.cxx.

References mpImpl.

bool ScTableProtection::isOptionEnabled ( Option  eOption) const
bool ScTableProtection::isPasswordEmpty ( ) const
overridevirtual

Implements ScPassHashProtectable.

Definition at line 646 of file tabprotection.cxx.

References mpImpl.

Referenced by ScPassHashHelper::needsPassHashRegen(), and ScRetypePassDlg::SetTableData().

bool ScTableProtection::isProtected ( ) const
overridevirtual
bool ScTableProtection::isProtectedWithPass ( ) const
overridevirtual

Implements ScPassHashProtectable.

Definition at line 636 of file tabprotection.cxx.

References mpImpl.

Referenced by ScTabViewShell::Execute().

bool ScTableProtection::isSelectionEditable ( const ScRangeList rRangeList) const

Definition at line 719 of file tabprotection.cxx.

References mpImpl.

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

Definition at line 698 of file tabprotection.cxx.

References mpImpl.

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

void ScTableProtection::setOption ( Option  eOption,
bool  bEnabled 
)
void ScTableProtection::setPassword ( const OUString &  aPassText)
overridevirtual

Implements ScPassHashProtectable.

Definition at line 656 of file tabprotection.cxx.

References mpImpl.

Referenced by ScTableProtectionDlg::WriteData().

virtual void ScTableProtection::setPasswordHash ( const css::uno::Sequence< sal_Int8 > &  aPassword,
ScPasswordHash  eHash,
ScPasswordHash  eHash2 = PASSHASH_UNSPECIFIED 
)
overridevirtual
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.

void ScTableProtection::setProtected ( bool  bProtected)
overridevirtual
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 mpImpl.

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

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

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