20#undef SC_DLLIMPLEMENTATION
26#include <osl/diagnose.h>
29 svl::Items<SID_SCATTR_PROTECTION, SID_SCATTR_PROTECTION>);
34 :
SfxTabPage(pPage, pController,
"modules/scalc/ui/cellprotectionpage.ui",
"CellProtectionPage", &rCoreAttrs)
35 , m_xBtnHideCell(m_xBuilder->weld_check_button(
"checkHideAll"))
36 , m_xBtnProtect(m_xBuilder->weld_check_button(
"checkProtected"))
37 , m_xBtnHideFormula(m_xBuilder->weld_check_button(
"checkHideFormula"))
38 , m_xBtnHidePrint(m_xBuilder->weld_check_button(
"checkHidePrinting"))
58 return std::make_unique<ScTabPageProtection>(pPage, pController, *rAttrSet);
65 sal_uInt16 nWhich =
GetWhich( SID_SCATTR_PROTECTION );
68 reinterpret_cast<const SfxPoolItem**
>(&pProtAttr) );
71 if ( eItemState == SfxItemState::DEFAULT )
104 bool bAttrsChanged =
false;
105 sal_uInt16 nWhich =
GetWhich( SID_SCATTR_PROTECTION );
119 bAttrsChanged =
true;
121 bAttrsChanged = !pOldItem || aProtAttr != *
static_cast<const ScProtectionAttr*
>(pOldItem);
125 rCoreAttrs->
Put( aProtAttr );
126 else if ( eItemState == SfxItemState::DEFAULT )
129 return bAttrsChanged;
137 return DeactivateRC::LeavePage;
142 aProtectState.ButtonToggled(rBox);
148 aHideCellState.ButtonToggled(rBox);
154 aHideFormulaState.ButtonToggled(rBox);
160 aHidePrintState.ButtonToggled(rBox);
184 OSL_FAIL(
"Wrong button");
bool GetHideFormula() const
void SetHideFormula(bool bHFormula)
void SetHidePrint(bool bHPrint)
void SetProtection(bool bProtect)
bool GetHidePrint() const
void SetHideCell(bool bHCell)
bool GetProtection() const
weld::TriStateEnabled aHideFormulaState
weld::TriStateEnabled aHideCellState
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::CheckButton > m_xBtnHideFormula
std::unique_ptr< weld::CheckButton > m_xBtnHideCell
weld::TriStateEnabled aProtectState
static const WhichRangesContainer pProtectionRanges
weld::TriStateEnabled aHidePrintState
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
virtual ~ScTabPageProtection() override
void ButtonClick(const weld::Toggleable &rBox)
std::unique_ptr< weld::CheckButton > m_xBtnProtect
ScTabPageProtection(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xBtnHidePrint
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const SfxItemSet & GetItemSet() const
void SetExchangeSupport()
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
TriState get_state() const
#define LINK(Instance, Class, Member)
IMPL_LINK(ScTabPageProtection, ProtectClickHdl, weld::Toggleable &, rBox, void)