20 #undef SC_DLLIMPLEMENTATION
26 #include <osl/diagnose.h>
30 SID_SCATTR_PROTECTION,
31 SID_SCATTR_PROTECTION,
38 :
SfxTabPage(pPage, pController,
"modules/scalc/ui/cellprotectionpage.ui",
"CellProtectionPage", &rCoreAttrs)
39 , m_xBtnHideCell(m_xBuilder->weld_check_button(
"checkHideAll"))
40 , m_xBtnProtect(m_xBuilder->weld_check_button(
"checkProtected"))
41 , m_xBtnHideFormula(m_xBuilder->weld_check_button(
"checkHideFormula"))
42 , m_xBtnHidePrint(m_xBuilder->weld_check_button(
"checkHidePrinting"))
62 return std::make_unique<ScTabPageProtection>(pPage, pController, *rAttrSet);
69 sal_uInt16 nWhich =
GetWhich( SID_SCATTR_PROTECTION );
72 reinterpret_cast<const SfxPoolItem**>(&pProtAttr) );
75 if ( eItemState == SfxItemState::DEFAULT )
108 bool bAttrsChanged =
false;
109 sal_uInt16 nWhich =
GetWhich( SID_SCATTR_PROTECTION );
123 bAttrsChanged =
true;
125 bAttrsChanged = !pOldItem || aProtAttr != *
static_cast<const ScProtectionAttr*
>(pOldItem);
129 rCoreAttrs->
Put( aProtAttr );
130 else if ( eItemState == SfxItemState::DEFAULT )
133 return bAttrsChanged;
141 return DeactivateRC::LeavePage;
146 aProtectState.ButtonToggled(rBox);
152 aHideCellState.ButtonToggled(rBox);
158 aHideFormulaState.ButtonToggled(rBox);
164 aHidePrintState.ButtonToggled(rBox);
188 OSL_FAIL(
"Wrong button");
#define LINK(Instance, Class, Member)
void ButtonClick(weld::ToggleButton &rBox)
std::unique_ptr< weld::CheckButton > m_xBtnProtect
static const sal_uInt16 pProtectionRanges[]
void SetHidePrint(bool bHPrint)
std::unique_ptr< weld::CheckButton > m_xBtnHideCell
void SetProtection(bool bProtect)
weld::TriStateEnabled aHideCellState
weld::TriStateEnabled aProtectState
void SetExchangeSupport()
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
ScTabPageProtection(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
std::unique_ptr< weld::CheckButton > m_xBtnHidePrint
const SfxItemSet & GetItemSet() const
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
IMPL_LINK(ScTabPageProtection, ProtectClickHdl, weld::ToggleButton &, rBox, void)
bool GetHideFormula() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual ~ScTabPageProtection() override
bool GetHidePrint() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetHideCell(bool bHCell)
weld::TriStateEnabled aHideFormulaState
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
weld::TriStateEnabled aHidePrintState
bool GetProtection() const
void SetHideFormula(bool bHFormula)
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xBtnHideFormula
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const