summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-11-24 14:18:40 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2013-11-24 14:46:58 +0100
commit77768f585af39029fb2ec9df4f976b31593f447a (patch)
tree9fd5e76932f7de1a8a6b60f2445efc66c3b5bff9 /sw
parent9236d8242386965a9cd744fb64193d4e909e3519 (diff)
Bail out early
Change-Id: Ic0bb06e3d64933df4887ce1402f62c16e917fdbd
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/callnk.cxx44
1 files changed, 21 insertions, 23 deletions
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 690c50183ec6..65eb900e1a0e 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -74,32 +74,30 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
static void lcl_notifyRow(const SwCntntNode* pNode, SwCrsrShell& rShell)
{
- if ( pNode != NULL )
+ if ( !pNode )
+ return;
+
+ SwFrm *const pMyFrm = pNode->getLayoutFrm( rShell.GetLayout() );
+ if ( !pMyFrm )
+ return;
+
+ // We need to emulated a change of the row height in order
+ // to have the complete row redrawn
+ SwRowFrm *const pRow = pMyFrm->FindRowFrm();
+ if ( !pRow )
+ return;
+
+ const SwTableLine* pLine = pRow->GetTabLine( );
+ // Avoid redrawing the complete row if there are no nested tables
+ for (SwFrm *pCell = pRow->GetLower(); pCell; pCell = pCell->GetNext())
{
- SwFrm *myFrm = pNode->getLayoutFrm( rShell.GetLayout() );
- if (myFrm!=NULL)
+ for (SwFrm *pContent = pCell->GetLower(); pContent; pContent = pContent->GetNext())
{
- // We need to emulated a change of the row height in order
- // to have the complete row redrawn
- SwRowFrm* pRow = myFrm->FindRowFrm();
- if ( pRow )
+ if (pContent->GetType() == FRM_TAB)
{
- const SwTableLine* pLine = pRow->GetTabLine( );
- // Avoid redrawing the complete row if there are no nested tables
- bool bHasTable = false;
- SwFrm *pCell = pRow->GetLower();
- for (; pCell && !bHasTable; pCell = pCell->GetNext())
- {
- SwFrm *pContent = pCell->GetLower();
- for (; pContent && !bHasTable; pContent = pContent->GetNext())
- if (pContent->GetType() == FRM_TAB)
- bHasTable = true;
- }
- if (bHasTable)
- {
- SwFmtFrmSize pSize = pLine->GetFrmFmt()->GetFrmSize();
- pRow->ModifyNotification(NULL, &pSize);
- }
+ SwFmtFrmSize pSize = pLine->GetFrmFmt()->GetFrmSize();
+ pRow->ModifyNotification(NULL, &pSize);
+ return;
}
}
}