summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-01-04 15:29:37 +0100
committerMichael Stahl <mstahl@redhat.com>2017-01-04 15:30:53 +0100
commitf240b1db88440297d0b1eef80e8974ee54590df1 (patch)
treeb66573c4b33d2d5f60ea7afab5ce5fd1c1d188ba /sw
parent15ca00601701c50ccdb3d8dbe08ba705787386a7 (diff)
sw: remove the silly casting in SwEndNoteOptionPage
... by fixing the size of SwFootnoteNum so it can be forward declared. Change-Id: I1a9d32a1ec7e7201de1910407d32020b75fb7342
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/ftninfo.hxx2
-rw-r--r--sw/source/ui/misc/docfnote.cxx8
-rw-r--r--sw/source/ui/misc/impfnote.hxx3
3 files changed, 7 insertions, 6 deletions
diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx
index d10ab320d266..df00db048c32 100644
--- a/sw/inc/ftninfo.hxx
+++ b/sw/inc/ftninfo.hxx
@@ -81,7 +81,7 @@ enum SwFootnotePos
FTNPOS_CHAPTER = 8
};
-enum SwFootnoteNum
+enum SwFootnoteNum : unsigned
{
FTNNUM_PAGE, FTNNUM_CHAPTER, FTNNUM_DOC
};
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 9feb8a1273ee..45ce95423f78 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -273,10 +273,10 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum)
NumCountHdl(*m_pNumCountBox);
}
-int SwEndNoteOptionPage::GetNumbering() const
+SwFootnoteNum SwEndNoteOptionPage::GetNumbering() const
{
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 )
@@ -296,7 +296,7 @@ void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell )
// all kinds of numbering can be used.
IMPL_LINK_NOARG(SwEndNoteOptionPage, PosPageHdl, Button*, void)
{
- const SwFootnoteNum eNum = (const SwFootnoteNum)GetNumbering();
+ const SwFootnoteNum eNum = GetNumbering();
bPosDoc = false;
if(LISTBOX_ENTRY_NOTFOUND == m_pNumCountBox->GetEntryPos(aNumPage))
{
@@ -396,7 +396,7 @@ bool SwEndNoteOptionPage::FillItemSet( SfxItemSet * )
{
SwFootnoteInfo *pI = static_cast<SwFootnoteInfo*>(pInf.get());
pI->ePos = m_pPosPageBox->IsChecked() ? FTNPOS_PAGE : FTNPOS_CHAPTER;
- pI->eNum = (SwFootnoteNum)GetNumbering();
+ pI->eNum = GetNumbering();
pI->aQuoVadis = m_pContEdit->GetText();
pI->aErgoSum = m_pContFromEdit->GetText();
if ( !(*pI == pSh->GetFootnoteInfo()) )
diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx
index ac812c2802a4..4fd2c95dffd2 100644
--- a/sw/source/ui/misc/impfnote.hxx
+++ b/sw/source/ui/misc/impfnote.hxx
@@ -26,6 +26,7 @@
#include <vcl/field.hxx>
#include <numberingtypelistbox.hxx>
+enum SwFootnoteNum : unsigned;
class SwWrtShell;
class SwEndNoteOptionPage : public SfxTabPage
@@ -60,7 +61,7 @@ class SwEndNoteOptionPage : public SfxTabPage
bool bEndNote;
inline void SelectNumbering(int eNum);
- int GetNumbering() const;
+ SwFootnoteNum GetNumbering() const;
DECL_LINK(PosPageHdl, Button*, void);
DECL_LINK(PosChapterHdl, Button*, void);