Kaydet (Commit) f240b1db authored tarafından Michael Stahl's avatar Michael Stahl

sw: remove the silly casting in SwEndNoteOptionPage

... by fixing the size of SwFootnoteNum so it can be forward declared.

Change-Id: I1a9d32a1ec7e7201de1910407d32020b75fb7342
üst 15ca0060
...@@ -81,7 +81,7 @@ enum SwFootnotePos ...@@ -81,7 +81,7 @@ enum SwFootnotePos
FTNPOS_CHAPTER = 8 FTNPOS_CHAPTER = 8
}; };
enum SwFootnoteNum enum SwFootnoteNum : unsigned
{ {
FTNNUM_PAGE, FTNNUM_CHAPTER, FTNNUM_DOC FTNNUM_PAGE, FTNNUM_CHAPTER, FTNNUM_DOC
}; };
......
...@@ -273,10 +273,10 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum) ...@@ -273,10 +273,10 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum)
NumCountHdl(*m_pNumCountBox); NumCountHdl(*m_pNumCountBox);
} }
int SwEndNoteOptionPage::GetNumbering() const SwFootnoteNum SwEndNoteOptionPage::GetNumbering() const
{ {
const sal_Int32 nPos = m_pNumCountBox->GetSelectEntryPos(); const sal_Int32 nPos = m_pNumCountBox->GetSelectEntryPos();
return (int) bPosDoc? nPos + 2: nPos; return static_cast<SwFootnoteNum>((bPosDoc) ? nPos + 2 : nPos);
} }
void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell ) void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell )
...@@ -296,7 +296,7 @@ void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell ) ...@@ -296,7 +296,7 @@ void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell )
// all kinds of numbering can be used. // all kinds of numbering can be used.
IMPL_LINK_NOARG(SwEndNoteOptionPage, PosPageHdl, Button*, void) IMPL_LINK_NOARG(SwEndNoteOptionPage, PosPageHdl, Button*, void)
{ {
const SwFootnoteNum eNum = (const SwFootnoteNum)GetNumbering(); const SwFootnoteNum eNum = GetNumbering();
bPosDoc = false; bPosDoc = false;
if(LISTBOX_ENTRY_NOTFOUND == m_pNumCountBox->GetEntryPos(aNumPage)) if(LISTBOX_ENTRY_NOTFOUND == m_pNumCountBox->GetEntryPos(aNumPage))
{ {
...@@ -396,7 +396,7 @@ bool SwEndNoteOptionPage::FillItemSet( SfxItemSet * ) ...@@ -396,7 +396,7 @@ bool SwEndNoteOptionPage::FillItemSet( SfxItemSet * )
{ {
SwFootnoteInfo *pI = static_cast<SwFootnoteInfo*>(pInf.get()); SwFootnoteInfo *pI = static_cast<SwFootnoteInfo*>(pInf.get());
pI->ePos = m_pPosPageBox->IsChecked() ? FTNPOS_PAGE : FTNPOS_CHAPTER; pI->ePos = m_pPosPageBox->IsChecked() ? FTNPOS_PAGE : FTNPOS_CHAPTER;
pI->eNum = (SwFootnoteNum)GetNumbering(); pI->eNum = GetNumbering();
pI->aQuoVadis = m_pContEdit->GetText(); pI->aQuoVadis = m_pContEdit->GetText();
pI->aErgoSum = m_pContFromEdit->GetText(); pI->aErgoSum = m_pContFromEdit->GetText();
if ( !(*pI == pSh->GetFootnoteInfo()) ) if ( !(*pI == pSh->GetFootnoteInfo()) )
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <vcl/field.hxx> #include <vcl/field.hxx>
#include <numberingtypelistbox.hxx> #include <numberingtypelistbox.hxx>
enum SwFootnoteNum : unsigned;
class SwWrtShell; class SwWrtShell;
class SwEndNoteOptionPage : public SfxTabPage class SwEndNoteOptionPage : public SfxTabPage
...@@ -60,7 +61,7 @@ class SwEndNoteOptionPage : public SfxTabPage ...@@ -60,7 +61,7 @@ class SwEndNoteOptionPage : public SfxTabPage
bool bEndNote; bool bEndNote;
inline void SelectNumbering(int eNum); inline void SelectNumbering(int eNum);
int GetNumbering() const; SwFootnoteNum GetNumbering() const;
DECL_LINK(PosPageHdl, Button*, void); DECL_LINK(PosPageHdl, Button*, void);
DECL_LINK(PosChapterHdl, Button*, void); DECL_LINK(PosChapterHdl, Button*, void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment