summaryrefslogtreecommitdiff
path: root/svx/source/table/tablelayouter.cxx
diff options
context:
space:
mode:
authorK_Karthikeyan <karthikeyan@kacst.edu.sa>2013-01-20 10:12:24 +0300
committerRadek Doulík <rodo@novell.com>2013-01-24 11:04:19 +0000
commita01a537602204f2831b3caf78b7cb23c5e9194eb (patch)
treec5cec5d8a68ee76caea1d673c347ca8bc0d32bd9 /svx/source/table/tablelayouter.cxx
parent439ac45925039aa7a537feedab3e731e8a60a8e5 (diff)
Replace the frequent functioncalls
The function getHorizontalEdge contains more function calls to the getRowCount(). Instead we store the return value of getRowCount() value in a const integer varible nRowCount and use it. Change-Id: I3e1460913099d1060d5005329e0b63e5ebcd362c Reviewed-on: https://gerrit.libreoffice.org/1777 Reviewed-by: Radek Doulík <rodo@novell.com> Tested-by: Radek Doulík <rodo@novell.com>
Diffstat (limited to 'svx/source/table/tablelayouter.cxx')
-rw-r--r--svx/source/table/tablelayouter.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 27bf185be7f0..d01a9936b48d 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -222,15 +222,16 @@ SvxBorderLine* TableLayouter::getBorderLine( sal_Int32 nEdgeX, sal_Int32 nEdgeY,
sal_Int32 TableLayouter::getHorizontalEdge( int nEdgeY, sal_Int32* pnMin /*= 0*/, sal_Int32* pnMax /*= 0*/ )
{
sal_Int32 nRet = 0;
- if( (nEdgeY >= 0) && (nEdgeY <= getRowCount() ) )
- nRet = maRows[std::min((sal_Int32)nEdgeY,getRowCount()-1)].mnPos;
+ const sal_Int32 nRowCount = getRowCount();
+ if( (nEdgeY >= 0) && (nEdgeY <= nRowCount ) )
+ nRet = maRows[std::min((sal_Int32)nEdgeY,nRowCount-1)].mnPos;
- if( nEdgeY == getRowCount() )
+ if( nEdgeY == nRowCount )
nRet += maRows[nEdgeY - 1].mnSize;
if( pnMin )
{
- if( (nEdgeY > 0) && (nEdgeY <= getRowCount() ) )
+ if( (nEdgeY > 0) && (nEdgeY <= nRowCount ) )
{
*pnMin = maRows[nEdgeY-1].mnPos + 600; // todo
}
@@ -265,7 +266,7 @@ sal_Int32 TableLayouter::getVerticalEdge( int nEdgeX, sal_Int32* pnMin /*= 0*/,
}
else
{
- if( nEdgeX == getColumnCount() )
+ if( nEdgeX == nColCount )
nRet += maColumns[nEdgeX - 1].mnSize;
}