Kaydet (Commit) a01a5376 authored tarafından K_Karthikeyan's avatar K_Karthikeyan Kaydeden (comit) Radek Doulík

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/1777Reviewed-by: 's avatarRadek Doulík <rodo@novell.com>
Tested-by: 's avatarRadek Doulík <rodo@novell.com>
üst 439ac459
...@@ -222,15 +222,16 @@ SvxBorderLine* TableLayouter::getBorderLine( sal_Int32 nEdgeX, sal_Int32 nEdgeY, ...@@ -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 TableLayouter::getHorizontalEdge( int nEdgeY, sal_Int32* pnMin /*= 0*/, sal_Int32* pnMax /*= 0*/ )
{ {
sal_Int32 nRet = 0; sal_Int32 nRet = 0;
if( (nEdgeY >= 0) && (nEdgeY <= getRowCount() ) ) const sal_Int32 nRowCount = getRowCount();
nRet = maRows[std::min((sal_Int32)nEdgeY,getRowCount()-1)].mnPos; 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; nRet += maRows[nEdgeY - 1].mnSize;
if( pnMin ) if( pnMin )
{ {
if( (nEdgeY > 0) && (nEdgeY <= getRowCount() ) ) if( (nEdgeY > 0) && (nEdgeY <= nRowCount ) )
{ {
*pnMin = maRows[nEdgeY-1].mnPos + 600; // todo *pnMin = maRows[nEdgeY-1].mnPos + 600; // todo
} }
...@@ -265,7 +266,7 @@ sal_Int32 TableLayouter::getVerticalEdge( int nEdgeX, sal_Int32* pnMin /*= 0*/, ...@@ -265,7 +266,7 @@ sal_Int32 TableLayouter::getVerticalEdge( int nEdgeX, sal_Int32* pnMin /*= 0*/,
} }
else else
{ {
if( nEdgeX == getColumnCount() ) if( nEdgeX == nColCount )
nRet += maColumns[nEdgeX - 1].mnSize; nRet += maColumns[nEdgeX - 1].mnSize;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment