28const std::vector<ScTableProtection::Option> aOptions = {
40 :
weld::GenericDialogController(pParent,
"modules/scalc/ui/protectsheetdlg.ui",
"ProtectSheetDialog")
41 , m_xBtnProtect(m_xBuilder->weld_check_button(
"protect"))
42 , m_xPasswords(m_xBuilder->weld_container(
"passwords"))
43 , m_xOptions(m_xBuilder->weld_container(
"options"))
44 , m_xPassword1Edit(m_xBuilder->weld_entry(
"password1"))
45 , m_xPassword2Edit(m_xBuilder->weld_entry(
"password2"))
46 , m_xOptionsListBox(m_xBuilder->weld_tree_view(
"checklist"))
47 , m_xBtnOk(m_xBuilder->weld_button(
"ok"))
48 , m_xProtected(m_xBuilder->weld_label(
"protected"))
49 , m_xUnprotected(m_xBuilder->weld_label(
"unprotected"))
50 , m_xInsertColumns(m_xBuilder->weld_label(
"insert-columns"))
51 , m_xInsertRows(m_xBuilder->weld_label(
"insert-rows"))
52 , m_xDeleteColumns(m_xBuilder->weld_label(
"delete-columns"))
53 , m_xDeleteRows(m_xBuilder->weld_label(
"delete-rows"))
73 for (
size_t i = 0;
i < aOptions.size(); ++
i)
84 for (
size_t i = 0;
i < aOptions.size(); ++
i)
134 if (&rBtn == m_xBtnProtect.get())
136 bool bChecked = m_xBtnProtect->get_active();
137 EnableOptionalWidgets(bChecked);
138 m_xBtnOk->set_sensitive(bChecked);
149 OUString aPass1 = m_xPassword1Edit->get_text();
150 OUString aPass2 = m_xPassword2Edit->get_text();
151 m_xBtnOk->set_sensitive(aPass1 == aPass2);
Reference< XExecutableDialog > m_xDialog
OUString m_aSelectUnlockedCells
std::unique_ptr< weld::Label > m_xInsertRows
std::unique_ptr< weld::Button > m_xBtnOk
std::unique_ptr< weld::Label > m_xDeleteColumns
std::unique_ptr< weld::CheckButton > m_xBtnProtect
std::unique_ptr< weld::Label > m_xProtected
void InsertEntry(const OUString &rTxt)
void SetDialogData(const ScTableProtection &rData)
std::unique_ptr< weld::Label > m_xDeleteRows
OUString m_aSelectLockedCells
std::unique_ptr< weld::Container > m_xOptions
void EnableOptionalWidgets(bool bEnable)
void WriteData(ScTableProtection &rData) const
virtual ~ScTableProtectionDlg() override
OUString m_aDeleteColumns
std::unique_ptr< weld::TreeView > m_xOptionsListBox
ScTableProtectionDlg()=delete
std::unique_ptr< weld::Entry > m_xPassword1Edit
std::unique_ptr< weld::Label > m_xInsertColumns
std::unique_ptr< weld::Entry > m_xPassword2Edit
std::unique_ptr< weld::Label > m_xUnprotected
OUString m_aInsertColumns
std::unique_ptr< weld::Container > m_xPasswords
sheet protection state container
bool isOptionEnabled(Option eOption) const
void setOption(Option eOption, bool bEnabled)
virtual void setPassword(const OUString &aPassText) override
virtual void setProtected(bool bProtected) override
#define LINK(Instance, Class, Member)
IMPL_LINK(ScTableProtectionDlg, CheckBoxHdl, weld::Toggleable &, rBtn, void)
IMPL_LINK_NOARG(ScTableProtectionDlg, OKHdl, weld::Button &, void)