21#include <osl/diagnose.h>
61 pPage = GetTabPage(
"endnotes");
64 SfxTabDialogController::OkHdl(rBtn);
70 bEN ? OUString(
"modules/swriter/ui/endnotepage.ui") : OUString(
"modules/swriter/ui/footnotepage.ui"),
71 bEN ? OString(
"EndnotePage") : OString(
"FootnotePage"),
77 , m_xOffsetLbl(m_xBuilder->weld_label(
"offset"))
78 , m_xOffsetField(m_xBuilder->weld_spin_button(
"offsetnf"))
79 , m_xNumCountBox(m_xBuilder->weld_combo_box(
"countinglb"))
80 , m_xPrefixED(m_xBuilder->weld_entry(
"prefix"))
81 , m_xSuffixED(m_xBuilder->weld_entry(
"suffix"))
82 , m_xPosFT(m_xBuilder->weld_label(
"pos"))
83 , m_xPosPageBox(m_xBuilder->weld_radio_button(
"pospagecb"))
84 , m_xPosChapterBox(m_xBuilder->weld_radio_button(
"posdoccb"))
85 , m_xStylesContainer(m_xBuilder->weld_widget(
"allstyles"))
86 , m_xParaTemplBox(m_xBuilder->weld_combo_box(
"parastylelb"))
87 , m_xPageTemplLbl(m_xBuilder->weld_label(
"pagestyleft"))
88 , m_xPageTemplBox(m_xBuilder->weld_combo_box(
"pagestylelb"))
89 , m_xFootnoteCharAnchorTemplBox(m_xBuilder->weld_combo_box(
"charanchorstylelb"))
90 , m_xFootnoteCharTextTemplBox(m_xBuilder->weld_combo_box(
"charstylelb"))
91 , m_xContEdit(m_xBuilder->weld_entry(
"conted"))
92 , m_xContFromEdit(m_xBuilder->weld_entry(
"contfromed"))
151 m_xNumViewBox->SelectNumberingType( pInf->m_aFormat.GetNumberingType());
153 m_xPrefixED->set_text(pInf->GetPrefix().replaceAll(
"\t",
"\\t"));
154 m_xSuffixED->set_text(pInf->GetSuffix().replaceAll(
"\t",
"\\t"));
161 pCharFormat = pInf->GetAnchorCharFormat( *
pSh->
GetDoc() );
172 pStyle = pStyleSheetPool->
Next();
186 OSL_ENSURE(!pColl->
IsDefault(),
"default style for footnotes is wrong");
215 return std::make_unique<SwEndNoteOptionPage>(pPage, pController,
true, *
rSet);
262 if (!rButton.get_active())
265 if (m_xPosPageBox->get_active())
272 if (m_xNumCountBox->find_text(aNumPage) == -1)
274 m_xNumCountBox->insert_text(
FTNNUM_PAGE, aNumPage);
276 SelectNumbering(eNum);
278 m_xPageTemplLbl->set_sensitive(
false);
279 m_xPageTemplBox->set_sensitive(
false);
281 else if (m_xPosChapterBox->get_active())
290 m_xNumCountBox->remove_text(aNumPage);
291 m_xNumCountBox->remove_text(aNumChapter);
292 m_xPageTemplLbl->set_sensitive(
true);
293 m_xPageTemplBox->set_sensitive(
true);
300 if (m_xNumCountBox->get_count() - 1 != m_xNumCountBox->get_active())
303 m_xOffsetField->set_value(1);
305 m_xOffsetLbl->set_sensitive(bEnable);
306 m_xOffsetField->set_sensitive(bEnable);
313 for(sal_uInt16
i = 0;
i< nChCount;
i++)
316 if(rChFormat.
GetName() == rCharFormatName )
318 pFormat = &rChFormat;
326 pBase = pPool->
Find(rCharFormatName, SfxStyleFamily::Char);
328 pBase = &pPool->
Make(rCharFormatName, SfxStyleFamily::Char);
339 pInf->m_aFormat.SetNumberingType(
m_xNumViewBox->GetSelectedNumberingType() );
340 pInf->SetPrefix(
m_xPrefixED->get_text().replaceAll(
"\\t",
"\t"));
341 pInf->SetSuffix(
m_xSuffixED->get_text().replaceAll(
"\\t",
"\t"));
354 OSL_ENSURE(pColl,
"paragraph style not found");
355 pInf->SetFootnoteTextColl(*pColl);
391 return std::make_unique<SwFootNoteOptionPage>(pPage, pController, *
rSet);
static SfxObjectShell * Current()
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All) const
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
const OUString & GetName() const
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
virtual weld::Button & GetOKButton() const override
virtual bool FillItemSet(SfxItemSet *)
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
SwDoc * GetDoc()
returns Doc. But be careful!
const SwFootnoteInfo & GetFootnoteInfo() const
Footnote attributes global to document.
const SwEndNoteInfo & GetEndNoteInfo() const
void SetEndNoteInfo(const SwEndNoteInfo &rInfo)
sal_uInt16 GetCharFormatCount() const
CHAR.
void SetFootnoteInfo(const SwFootnoteInfo &rInfo)
SwCharFormat & GetCharFormat(sal_uInt16 nFormat) const
std::unique_ptr< weld::Label > m_xPageTemplLbl
std::unique_ptr< weld::RadioButton > m_xPosPageBox
std::unique_ptr< weld::Entry > m_xPrefixED
std::unique_ptr< weld::SpinButton > m_xOffsetField
std::unique_ptr< weld::ComboBox > m_xParaTemplBox
std::unique_ptr< weld::Entry > m_xContEdit
std::unique_ptr< weld::ComboBox > m_xFootnoteCharAnchorTemplBox
std::unique_ptr< weld::ComboBox > m_xPageTemplBox
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
std::unique_ptr< weld::Entry > m_xSuffixED
virtual void Reset(const SfxItemSet *) override
virtual ~SwEndNoteOptionPage() override
void SelectNumbering(SwFootnoteNum eNum)
void SetShell(SwWrtShell &rShell)
std::unique_ptr< weld::ComboBox > m_xFootnoteCharTextTemplBox
std::unique_ptr< weld::Entry > m_xContFromEdit
std::unique_ptr< weld::Widget > m_xStylesContainer
SwFootnoteNum GetNumbering() const
std::unique_ptr< weld::RadioButton > m_xPosChapterBox
std::unique_ptr< weld::ComboBox > m_xNumCountBox
virtual bool FillItemSet(SfxItemSet *rSet) override
SwEndNoteOptionPage(weld::Container *pPage, weld::DialogController *pController, bool bEndNote, const SfxItemSet &rSet)
std::unique_ptr< SwNumberingTypeListBox > m_xNumViewBox
SwPageDesc * FindPageDescByName(const OUString &rName, bool bGetFromPool=false, size_t *pPos=nullptr)
size_t GetPageDescCnt() const
const SwPageDesc & GetPageDesc(size_t i) const
const OUString & GetName() const
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
Represents the style of a paragraph.
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
const SwView & GetView() const
static SwCharFormat * lcl_GetCharFormat(SwWrtShell *pSh, const OUString &rCharFormatName)
IMPL_LINK(SwFootNoteOptionDlg, OkHdl, weld::Button &, rBtn, void)
IMPL_LINK_NOARG(SwEndNoteOptionPage, NumCountHdl, weld::ComboBox &, void)
#define LINK(Instance, Class, Member)
void SetShell(SwViewShell *pSh)
@ RES_POOLCOLL_FOOTNOTE
Footnotes.
@ RES_POOLCOLL_ENDNOTE
Endnotes.