20#undef SC_DLLIMPLEMENTATION
36#include <document.hxx>
37#include <styledlg.hxx>
48 , m_xBtnEdit(m_xBuilder->weld_button(
"buttonEdit"))
69 if (
nId == SID_ATTR_PAGE_HEADERSET )
90 if (
nId == SID_ATTR_PAGE_HEADERSET )
108 sal_uInt16 nPageWhich =
GetWhich( SID_ATTR_PAGE );
128 return DeactivateRC::LeavePage;
135 SvxHFPage::TurnOnHdl(*m_xTurnOnBox);
137 if (m_xTurnOnBox->get_active())
138 m_xBtnEdit->set_sensitive(
true);
140 m_xBtnEdit->set_sensitive(
false);
149 OSL_FAIL(
"Current ViewShell not found." );
153 if ( (m_xCntSharedBox->get_sensitive() && !m_xCntSharedBox->get_active()) ||
154 (m_xCntSharedFirstBox->get_sensitive() && !m_xCntSharedFirstBox->get_active()) )
158 if ( m_xCntSharedBox->get_sensitive() && !m_xCntSharedBox->get_active() &&
159 m_xCntSharedFirstBox->get_sensitive() && !m_xCntSharedFirstBox->get_active() )
161 nResId = (
nId == SID_ATTR_PAGE_HEADERSET )
162 ? RID_SCDLG_HFED_HEADER
163 : RID_SCDLG_HFED_FOOTER;
165 else if (m_xCntSharedBox->get_sensitive() && !m_xCntSharedBox->get_active())
167 nResId = (
nId == SID_ATTR_PAGE_HEADERSET )
168 ? RID_SCDLG_HFEDIT_SHAREDFIRSTHEADER
169 : RID_SCDLG_HFEDIT_SHAREDFIRSTFOOTER;
173 OSL_ENSURE( m_xCntSharedFirstBox->get_sensitive() && !m_xCntSharedFirstBox->get_active(),
"This should be logically impossible." );
174 nResId = (
nId == SID_ATTR_PAGE_HEADERSET )
175 ? RID_SCDLG_HFEDIT_SHAREDLEFTHEADER
176 : RID_SCDLG_HFEDIT_SHAREDLEFTFOOTER;
183 pDlg->StartExecuteAsync([
this, pDlg](sal_Int32 nResult){
186 aDataSet.Put( *pDlg->GetOutputItemSet() );
196 bool bRightPage = m_xCntSharedBox->get_active() || (SvxPageUsage::Left != nPageUsage);
198 if (
nId == SID_ATTR_PAGE_HEADERSET )
200 aText =
ScResId( STR_PAGEHEADER );
208 aText =
ScResId( STR_PAGEFOOTER );
218 aText +=
" (" +
ScResId( STR_PAGESTYLE ) +
219 ": " + aStrPageStyle +
")";
221 aDlg.set_title(aText);
232 :
ScHFPage(pPage, pController,
rSet, SID_ATTR_PAGE_HEADERSET)
238 return std::make_unique<ScHeaderPage>(pPage, pController, *rCoreSet);
248 :
ScHFPage( pPage, pController,
rSet, SID_ATTR_PAGE_FOOTERSET )
254 return std::make_unique<ScFooterPage>(pPage, pController, *rCoreSet);
virtual VclPtr< SfxAbstractTabDialog > CreateScHFEditDlg(weld::Window *pParent, const SfxItemSet &rCoreSet, const OUString &rPageStyle, sal_uInt16 nResId)=0
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
virtual void Reset(const SfxItemSet *rSet) override
virtual ~ScHFPage() override
virtual void ActivatePage(const SfxItemSet &rSet) override
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::Button > m_xBtnEdit
ScHFPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet, sal_uInt16 nSetId)
virtual bool FillItemSet(SfxItemSet *rOutSet) override
ScViewData & GetViewData()
ScDocument & GetDocument() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetOutputItemSet() const
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
weld::Container * get_content_area()
SfxTabPage * GetTabPage() const
SfxStyleSheetBase & GetStyleSheet()
const OUString & GetName() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
virtual void Reset(const SfxItemSet *rSet) override
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::CheckButton > m_xTurnOnBox
virtual bool FillItemSet(SfxItemSet *rOutSet) override
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
SvxPageUsage GetPageUsage() const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
constexpr OUStringLiteral HID_SC_FOOTER_EDIT
constexpr OUStringLiteral HID_SC_HEADER_EDIT
#define LINK(Instance, Class, Member)
These need to be in global namespace just like their respective types are.
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERLEFT(179)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERLEFT(178)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERRIGHT(181)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERRIGHT(180)
constexpr TypedWhichId< SvxPageItem > ATTR_PAGE(159)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERFIRST(182)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERFIRST(183)
IMPL_LINK_NOARG(ScHFPage, TurnOnHdl, weld::Toggleable &, void)