summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-09-21 12:23:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-09-21 14:34:53 +0100
commit82dcd668689bce4b16a38baba09922d46d5952e7 (patch)
tree03b3f272225170b265842fc925600c77aa18d71a
parentb2aa15ed6e989c50402e3914bffbc1a352e127de (diff)
return early on non-main condition, no logic change
Change-Id: I056ef7100c908cde53794f028a3acef5dcb07779
-rw-r--r--sw/source/core/frmedt/fetab.cxx33
1 files changed, 17 insertions, 16 deletions
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index f5af05b5825f..e01d864a38a6 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1020,7 +1020,6 @@ void SwFEShell::SetRowsToRepeat( sal_uInt16 nSet )
// returns the number of rows consecutively selected from top
static sal_uInt16 lcl_GetRowNumber( const SwPosition& rPos )
{
- sal_uInt16 nRet = USHRT_MAX;
Point aTmpPt;
const SwContentNode *pNd;
const SwContentFrame *pFrame;
@@ -1030,25 +1029,27 @@ static sal_uInt16 lcl_GetRowNumber( const SwPosition& rPos )
else
pFrame = nullptr;
- if ( pFrame && pFrame->IsInTab() )
- {
- const SwFrame* pRow = pFrame->GetUpper();
- while ( !pRow->GetUpper()->IsTabFrame() )
- pRow = pRow->GetUpper();
+ if (!pFrame || !pFrame->IsInTab())
+ return USHRT_MAX;
+
+ sal_uInt16 nRet = USHRT_MAX;
+
+ const SwFrame* pRow = pFrame->GetUpper();
+ while ( !pRow->GetUpper()->IsTabFrame() )
+ pRow = pRow->GetUpper();
- const SwTabFrame* pTabFrame = static_cast<const SwTabFrame*>(pRow->GetUpper());
- const SwTableLine* pTabLine = static_cast<const SwRowFrame*>(pRow)->GetTabLine();
+ const SwTabFrame* pTabFrame = static_cast<const SwTabFrame*>(pRow->GetUpper());
+ const SwTableLine* pTabLine = static_cast<const SwRowFrame*>(pRow)->GetTabLine();
- sal_uInt16 nI = 0;
- while ( nI < pTabFrame->GetTable()->GetTabLines().size() )
+ sal_uInt16 nI = 0;
+ while ( nI < pTabFrame->GetTable()->GetTabLines().size() )
+ {
+ if ( pTabFrame->GetTable()->GetTabLines()[ nI ] == pTabLine )
{
- if ( pTabFrame->GetTable()->GetTabLines()[ nI ] == pTabLine )
- {
- nRet = nI;
- break;
- }
- ++nI;
+ nRet = nI;
+ break;
}
+ ++nI;
}
return nRet;