Kaydet (Commit) 7c87db6a authored tarafından Matteo Casalin's avatar Matteo Casalin

Fix memory leak a simplify code

Change-Id: I84ae9025d53d1544aa8ba0a56a2316cbf77561ea
üst 81da8a36
......@@ -516,16 +516,14 @@ bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
}
if ( !bRet )
{
Point *pPoint = pCMS && pCMS->pFill ? new Point( rPoint ) : NULL;
const bool bFill = pCMS && pCMS->pFill;
Point aPoint( rPoint );
const SwCntntFrm *pCnt = GetCntntPos( rPoint, true );
if( pPoint && pCnt->IsTxtFrm() )
if( bFill && pCnt->IsTxtFrm() )
{
pCnt->GetCrsrOfst( pPos, *pPoint, pCMS );
rPoint = *pPoint;
rPoint = aPoint;
}
else
pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
delete pPoint;
pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
}
return true;
}
......@@ -599,18 +597,16 @@ bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
}
if ( !bRet )
{
Point *pPoint = pCMS && pCMS->pFill ? new Point( rPoint ) : NULL;
const bool bFill = pCMS && pCMS->pFill;
Point aPoint( rPoint );
const SwCntntFrm *pCnt = GetCntntPos( rPoint, true, false, false, pCMS );
if ( pCMS && pCMS->bStop )
return false;
if( pPoint && pCnt->IsTxtFrm() )
if( bFill && pCnt->IsTxtFrm() )
{
pCnt->GetCrsrOfst( pPos, *pPoint, pCMS );
rPoint = *pPoint;
rPoint = aPoint;
}
else
pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
delete pPoint;
pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
bRet = true;
}
}
......
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