summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-03-30 20:31:41 +0200
committerNoel Grandin <noel@peralex.com>2016-03-31 13:23:03 +0200
commit183c990a47da6f2bbbd4a40ff16f9605b5fdda3a (patch)
tree122415dbb697eb1ceceb7e6024a508847ce9fb05
parent0c536453950c21b066478daa93ba69d4ac83a5de (diff)
tdf#84938 convert FINDMODE_ constants to scoped enum
Change-Id: Ibfe8a0bab07b2572079841f7957a7a52f2127f94
-rw-r--r--sw/source/core/inc/sectfrm.hxx9
-rw-r--r--sw/source/core/layout/flowfrm.cxx2
-rw-r--r--sw/source/core/layout/ftnfrm.cxx4
-rw-r--r--sw/source/core/layout/layouter.cxx2
-rw-r--r--sw/source/core/layout/sectfrm.cxx14
-rw-r--r--sw/source/core/text/txtftn.cxx2
6 files changed, 17 insertions, 16 deletions
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index 7c39a521ba5b..f8a84e74063a 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -30,9 +30,10 @@ class SwAttrSetChg;
class SwFootnoteContFrame;
class SwLayouter;
-#define FINDMODE_ENDNOTE 1
-#define FINDMODE_LASTCNT 2
-#define FINDMODE_MYLAST 4
+enum class SwFindMode
+{
+ None = 0, EndNote = 1, LastCnt = 2, MyLast = 4
+};
class SwSectionFrame: public SwLayoutFrame, public SwFlowFrame
{
@@ -80,7 +81,7 @@ public:
inline SwSectionFrame *GetFollow();
SwSectionFrame* FindMaster() const;
- SwContentFrame *FindLastContent( sal_uInt8 nMode = 0 );
+ SwContentFrame *FindLastContent( SwFindMode nMode = SwFindMode::None );
inline const SwContentFrame *FindLastContent() const;
inline SwSection* GetSection() { return m_pSection; }
inline const SwSection* GetSection() const { return m_pSection; }
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index becbffff35e8..78186e1fa9bc 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2031,7 +2031,7 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat )
{
SwSectionFrame* pSect = pFootnote->FindSctFrame();
if( pSect->IsEndnAtEnd() )
- pRef = pSect->FindLastContent( FINDMODE_LASTCNT );
+ pRef = pSect->FindLastContent( SwFindMode::LastCnt );
}
if( !pRef )
pRef = pFootnote->GetRef();
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 734367a39b02..0a88a25c1e52 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -699,7 +699,7 @@ SwLayoutFrame *SwFrame::GetPrevFootnoteLeaf( MakePageType eMakeFootnote )
{
SwSectionFrame* pSect = pFootnote->FindSctFrame();
if( pSect->IsEndnAtEnd() )
- pTmpRef = pSect->FindLastContent( FINDMODE_LASTCNT );
+ pTmpRef = pSect->FindLastContent( SwFindMode::LastCnt );
}
if( !pTmpRef )
pTmpRef = pFootnote->GetRef();
@@ -1419,7 +1419,7 @@ void SwFootnoteBossFrame::AppendFootnote( SwContentFrame *pRef, SwTextFootnote *
static_cast<SwSectionFrame*>(GetUpper())->IsEndnAtEnd() )
{
SwFrame* pLast =
- static_cast<SwSectionFrame*>(GetUpper())->FindLastContent( FINDMODE_ENDNOTE );
+ static_cast<SwSectionFrame*>(GetUpper())->FindLastContent( SwFindMode::EndNote );
if( pLast )
{
pBoss = pLast->FindFootnoteBossFrame();
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index 98c436dc008e..5e25c8840d8d 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -130,7 +130,7 @@ void SwEndnoter::InsertEndnotes()
}
OSL_ENSURE( pSect->Lower() && pSect->Lower()->IsFootnoteBossFrame(),
"InsertEndnotes: Where's my column?" );
- SwFrame* pRef = pSect->FindLastContent( FINDMODE_MYLAST );
+ SwFrame* pRef = pSect->FindLastContent( SwFindMode::MyLast );
SwFootnoteBossFrame *pBoss = pRef ? pRef->FindFootnoteBossFrame()
: static_cast<SwFootnoteBossFrame*>(pSect->Lower());
pBoss->_MoveFootnotes( *pEndArr );
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 7be0bfdda6de..e22c23d9676d 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -803,12 +803,12 @@ static void lcl_FindContentFrame( SwContentFrame* &rpContentFrame, SwFootnoteFra
}
}
-SwContentFrame *SwSectionFrame::FindLastContent( sal_uInt8 nMode )
+SwContentFrame *SwSectionFrame::FindLastContent( SwFindMode nMode )
{
SwContentFrame *pRet = nullptr;
SwFootnoteFrame *pFootnoteFrame = nullptr;
SwSectionFrame *pSect = this;
- if( nMode )
+ if( nMode != SwFindMode::None )
{
const SwSectionFormat *pFormat = IsEndnAtEnd() ? GetEndSectFormat() :
m_pSection->GetFormat();
@@ -826,16 +826,16 @@ SwContentFrame *SwSectionFrame::FindLastContent( sal_uInt8 nMode )
break;
} while( true );
}
- bool bFootnoteFound = nMode == FINDMODE_ENDNOTE;
+ bool bFootnoteFound = nMode == SwFindMode::EndNote;
do
{
lcl_FindContentFrame( pRet, pFootnoteFrame, pSect->Lower(), bFootnoteFound );
- if( pRet || !pSect->IsFollow() || !nMode ||
- ( FINDMODE_MYLAST == nMode && this == pSect ) )
+ if( pRet || !pSect->IsFollow() || nMode == SwFindMode::None ||
+ ( SwFindMode::MyLast == nMode && this == pSect ) )
break;
pSect = pSect->FindMaster();
} while( pSect );
- if( ( nMode == FINDMODE_ENDNOTE ) && pFootnoteFrame )
+ if( ( nMode == SwFindMode::EndNote ) && pFootnoteFrame )
pRet = pFootnoteFrame->ContainsContent();
return pRet;
}
@@ -1002,7 +1002,7 @@ void SwSectionFrame::_CheckClipping( bool bGrow, bool bMaximize )
if( pFootnote )
{
pFootnote = pFootnote->FindFootnoteBossFrame();
- SwFrame* pTmp = FindLastContent( FINDMODE_LASTCNT );
+ SwFrame* pTmp = FindLastContent( SwFindMode::LastCnt );
// OD 08.11.2002 #104840# - use <SwLayoutFrame::IsBefore(..)>
if ( pTmp && pFootnote->IsBefore( pTmp->FindFootnoteBossFrame() ) )
bExtraCalc = true;
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index ac704e1a1441..bf7ece20bed6 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -599,7 +599,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea
{
pSect = FindSctFrame();
if( pSect->IsEndnAtEnd() )
- pContent = pSect->FindLastContent( FINDMODE_ENDNOTE );
+ pContent = pSect->FindLastContent( SwFindMode::EndNote );
if( !pContent )
pContent = this;
}