21#include <osl/diagnose.h>
61 pPage = GetTabPage(
u"endnotes");
64 SfxTabDialogController::OkHdl(rBtn);
70 bEN ? OUString(
"modules/swriter/ui/endnotepage.ui") : OUString(
"modules/swriter/ui/footnotepage.ui"),
71 bEN ? OUString(
"EndnotePage") : OUString(
"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_xPosPageBox(m_xBuilder->weld_radio_button(
"pospagecb"))
83 , m_xPosChapterBox(m_xBuilder->weld_radio_button(
"posdoccb"))
84 , m_xStylesContainer(m_xBuilder->weld_widget(
"allstyles"))
85 , m_xParaTemplBox(m_xBuilder->weld_combo_box(
"parastylelb"))
86 , m_xPageTemplLbl(m_xBuilder->weld_label(
"pagestyleft"))
87 , m_xPageTemplBox(m_xBuilder->weld_combo_box(
"pagestylelb"))
88 , m_xFootnoteCharAnchorTemplBox(m_xBuilder->weld_combo_box(
"charanchorstylelb"))
89 , m_xFootnoteCharTextTemplBox(m_xBuilder->weld_combo_box(
"charstylelb"))
90 , m_xContEdit(m_xBuilder->weld_entry(
"conted"))
91 , m_xContFromEdit(m_xBuilder->weld_entry(
"contfromed"))
150 m_xNumViewBox->SelectNumberingType( pInf->m_aFormat.GetNumberingType());
152 m_xPrefixED->set_text(pInf->GetPrefix().replaceAll(
"\t",
"\\t"));
153 m_xSuffixED->set_text(pInf->GetSuffix().replaceAll(
"\t",
"\\t"));
160 pCharFormat = pInf->GetAnchorCharFormat( *
m_pSh->
GetDoc() );
171 pStyle = pStyleSheetPool->
Next();
185 OSL_ENSURE(!pColl->
IsDefault(),
"default style for footnotes is wrong");
214 return std::make_unique<SwEndNoteOptionPage>(pPage, pController,
true, *
rSet);
261 if (!rButton.get_active())
264 if (m_xPosPageBox->get_active())
271 if (m_xNumCountBox->find_text(m_aNumPage) == -1)
273 m_xNumCountBox->insert_text(
FTNNUM_PAGE, m_aNumPage);
275 SelectNumbering(eNum);
277 m_xPageTemplLbl->set_sensitive(
false);
278 m_xPageTemplBox->set_sensitive(
false);
280 else if (m_xPosChapterBox->get_active())
289 m_xNumCountBox->remove_text(m_aNumPage);
290 m_xNumCountBox->remove_text(m_aNumChapter);
291 m_xPageTemplLbl->set_sensitive(
true);
292 m_xPageTemplBox->set_sensitive(
true);
299 if (m_xNumCountBox->get_count() - 1 != m_xNumCountBox->get_active())
302 m_xOffsetField->set_value(1);
304 m_xOffsetLbl->set_sensitive(bEnable);
305 m_xOffsetField->set_sensitive(bEnable);
312 for(sal_uInt16
i = 0;
i< nChCount;
i++)
315 if(rChFormat.
GetName() == rCharFormatName )
317 pFormat = &rChFormat;
325 pBase = pPool->
Find(rCharFormatName, SfxStyleFamily::Char);
327 pBase = &pPool->
Make(rCharFormatName, SfxStyleFamily::Char);
338 pInf->m_aFormat.SetNumberingType(
m_xNumViewBox->GetSelectedNumberingType() );
339 pInf->SetPrefix(
m_xPrefixED->get_text().replaceAll(
"\\t",
"\t"));
340 pInf->SetSuffix(
m_xSuffixED->get_text().replaceAll(
"\\t",
"\t"));
353 OSL_ENSURE(pColl,
"paragraph style not found");
354 pInf->SetFootnoteTextColl(*pColl);
390 return std::make_unique<SwFootNoteOptionPage>(pPage, pController, *
rSet);
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
const OUString & GetName() const
void AddTabPage(const OUString &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.