summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-03-07 12:08:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-03-07 12:08:37 +0000
commit48c887fc7a9adfe390512c807c99b08b5f5b41f3 (patch)
tree22310409d45a986ed5c011290b32c1d843562971 /sw
parenta0b634bf57511f250e0406dc382178a1699804f0 (diff)
convert DEFINE to anonymous function
Change-Id: I9b62f02ac0013d1da13c176155c5742972a43fe3
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/sectfrm.cxx26
1 files changed, 16 insertions, 10 deletions
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 781dd96e5436..1d3ad20ae2e7 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -579,9 +579,15 @@ static SwContentFrame* lcl_GetNextContentFrame( const SwLayoutFrame* pLay, bool
return pContentFrame;
}
-#define FIRSTLEAF( pLayFrame ) ( ( pLayFrame->Lower() && pLayFrame->Lower()->IsColumnFrame() )\
- ? pLayFrame->GetNextLayoutLeaf() \
- : pLayFrame )
+namespace
+{
+ SwLayoutFrame* FirstLeaf(SwSectionFrame* pLayFrame)
+ {
+ if (pLayFrame->Lower() && pLayFrame->Lower()->IsColumnFrame())
+ return pLayFrame->GetNextLayoutLeaf();
+ return pLayFrame;
+ }
+}
void SwSectionFrame::MoveContentAndDelete( SwSectionFrame* pDel, bool bSave )
{
@@ -633,7 +639,7 @@ void SwSectionFrame::MoveContentAndDelete( SwSectionFrame* pDel, bool bSave )
{ // Search for the appropriate insert position
if( pNxtSct && pNxtSct->GetFormat() == pParent )
{ // Here we can insert outselves at the beginning
- pUp = FIRSTLEAF( pNxtSct );
+ pUp = FirstLeaf( pNxtSct );
pPrv = nullptr;
if( pPrvSct && !( pPrvSct->GetFormat() == pParent ) )
pPrvSct = nullptr; // In order that nothing is merged
@@ -665,7 +671,7 @@ void SwSectionFrame::MoveContentAndDelete( SwSectionFrame* pDel, bool bSave )
pPrvSct->Init();
SWRECTFN( pUp )
(pPrvSct->*fnRect->fnMakePos)( pUp, pPrv, true );
- pUp = FIRSTLEAF( pPrvSct );
+ pUp = FirstLeaf( pPrvSct );
pPrv = nullptr;
}
pPrvSct = nullptr; // Such that nothing will be merged
@@ -1460,7 +1466,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage )
if( WrongPageDesc( pPg ) )
bWrongPage = true;
else
- return FIRSTLEAF( pSect->GetFollow() );
+ return FirstLeaf( pSect->GetFollow() );
}
else
{
@@ -1488,7 +1494,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage )
if( WrongPageDesc( pNxtPg ) )
bWrongPage = true;
else
- return FIRSTLEAF( pSect->GetFollow() );
+ return FirstLeaf( pSect->GetFollow() );
}
}
}
@@ -1641,7 +1647,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage )
pNew->SimpleFormat();
}
// The wanted layout sheet is now the first of the determined SctFrames:
- pLayLeaf = FIRSTLEAF( pNew );
+ pLayLeaf = FirstLeaf( pNew );
}
return pLayLeaf;
}
@@ -1802,7 +1808,7 @@ SwLayoutFrame *SwFrame::GetPrevSctLeaf( MakePageType )
SWRECTFN( pNew )
(pNew->*fnRect->fnMakePos)( pLayLeaf, pNew->GetPrev(), true );
- pLayLeaf = FIRSTLEAF( pNew );
+ pLayLeaf = FirstLeaf( pNew );
if( !pNew->Lower() ) // Format single column sections
{
pNew->MakePos();
@@ -1813,7 +1819,7 @@ SwLayoutFrame *SwFrame::GetPrevSctLeaf( MakePageType )
}
else
{
- pLayLeaf = FIRSTLEAF( pNew );
+ pLayLeaf = FirstLeaf( pNew );
if( pLayLeaf->IsColBodyFrame() )
{
// In existent section columns we're looking for the last not empty