LibreOffice Module sc (master) 1
|
sheet protection state container More...
#include <tabprotection.hxx>
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_Int8 > | getPasswordHash (ScPasswordHash eHash, ScPasswordHash eHash2=PASSHASH_UNSPECIFIED) const override |
virtual const ScOoxPasswordHash & | getPasswordHash () 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_Int8 > | getPasswordHash (ScPasswordHash eHash, ScPasswordHash eHas2=PASSHASH_UNSPECIFIED) const =0 |
virtual const ScOoxPasswordHash & | getPasswordHash () 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< ScTableProtectionImpl > | mpImpl |
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.
Definition at line 169 of file tabprotection.hxx.
|
explicit |
Definition at line 613 of file tabprotection.cxx.
References mpImpl, SELECT_LOCKED_CELLS, and SELECT_UNLOCKED_CELLS.
|
explicit |
Definition at line 621 of file tabprotection.cxx.
|
overridevirtual |
Definition at line 627 of file tabprotection.cxx.
const ::std::vector< ScEnhancedProtection > & ScTableProtection::getEnhancedProtection | ( | ) | const |
Definition at line 703 of file tabprotection.cxx.
References mpImpl.
Referenced by ExcTable::FillAsTableBinary(), and XclExpSheetProtection::SaveXml().
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 666 of file tabprotection.cxx.
References mpImpl.
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 661 of file tabprotection.cxx.
References mpImpl.
Referenced by ExcTable::FillAsTableBinary(), XclExpSheetProtection::SaveXml(), and ScXMLExport::WriteTable().
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 651 of file tabprotection.cxx.
References mpImpl.
Referenced by ScRetypePassDlg::SetTableData(), and ScXMLExport::WriteTable().
bool ScTableProtection::isBlockEditable | ( | const ScRange & | rRange | ) | const |
Definition at line 714 of file tabprotection.cxx.
References mpImpl.
bool ScTableProtection::isOptionEnabled | ( | Option | eOption | ) | const |
Definition at line 688 of file tabprotection.cxx.
References mpImpl.
Referenced by ScGridWindow::Command(), ScTabView::ExpandBlock(), ExcTable::FillAsTableBinary(), ScVbaWorksheet::getEnableSelection(), ScVbaWorksheet::getProtectDrawingObjects(), ScHeaderControl::IsSelectionAllowed(), ScGridWindow::MouseButtonUp(), ScTabView::MoveCursorRel(), XclExpSheetProtection::SaveXml(), ScViewFunctionSet::SetCursorAtCell(), ScTableProtectionDlg::SetDialogData(), ScTabView::SkipCursorHorizontal(), ScTabView::SkipCursorVertical(), ScXMLExport::WriteTable(), and XclExpSheetProtectOptions::XclExpSheetProtectOptions().
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 646 of file tabprotection.cxx.
References mpImpl.
Referenced by ScRetypePassDlg::SetTableData().
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 631 of file tabprotection.cxx.
References mpImpl.
Referenced by ScGridWindow::Command(), ScTabView::ExpandBlock(), ExcTable::FillAsTableBinary(), ExcTable::FillAsTableXml(), ScHeaderControl::IsSelectionAllowed(), ScGridWindow::MouseButtonUp(), ScTabView::MoveCursorRel(), ScDocFunc::ProtectSheet(), ScRetypePassDlg::SetDataFromDocument(), ScRetypePassDlg::SetTableData(), ScTabView::SkipCursorHorizontal(), ScTabView::SkipCursorVertical(), ScDocFunc::Unprotect(), and ScXMLExport::WriteTable().
|
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 | ( | ::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 | ||
) |
Definition at line 693 of file tabprotection.cxx.
References mpImpl.
Referenced by ScMyTables::DeleteTable(), oox::xls::WorksheetSettings::finalizeImport(), ScVbaWorksheet::setEnableSelection(), and ScTableProtectionDlg::WriteData().
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 656 of file tabprotection.cxx.
References mpImpl.
Referenced by ScTableProtectionDlg::WriteData().
|
overridevirtual |
Implements ScPassHashProtectable.
Referenced by ScMyTables::DeleteTable(), and oox::xls::WorksheetSettings::finalizeImport().
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 677 of file tabprotection.cxx.
References mpImpl.
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 641 of file tabprotection.cxx.
References mpImpl.
Referenced by ScMyTables::DeleteTable(), oox::xls::WorksheetSettings::finalizeImport(), ScDocFunc::Unprotect(), and ScTableProtectionDlg::WriteData().
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.
|
overridevirtual |
Implements ScPassHashProtectable.
Definition at line 683 of file tabprotection.cxx.
References mpImpl.
Referenced by ScDocFunc::Unprotect().
|
private |
Definition at line 220 of file tabprotection.hxx.
Referenced by getEnhancedProtection(), getPasswordHash(), hasPasswordHash(), isBlockEditable(), isOptionEnabled(), isPasswordEmpty(), isProtected(), isProtectedWithPass(), isSelectionEditable(), ScTableProtection(), setEnhancedProtection(), setOption(), setPassword(), setPasswordHash(), setProtected(), updateReference(), and verifyPassword().