Kaydet (Commit) a68012ca authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert local method lcl_GetLayTree from using Svptrarr to std::vector

Change-Id: I806788657a250cccb3740b8b064315e94f58d2f5
üst 51bf3fb3
...@@ -77,7 +77,7 @@ using ::rtl::OUString; ...@@ -77,7 +77,7 @@ using ::rtl::OUString;
extern void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 ); extern void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 );
void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr ) void lcl_GetLayTree( const SwFrm* pFrm, std::vector<const SwFrm*>& rArr )
{ {
while( pFrm ) while( pFrm )
{ {
...@@ -85,8 +85,7 @@ void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr ) ...@@ -85,8 +85,7 @@ void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr )
pFrm = pFrm->GetUpper(); pFrm = pFrm->GetUpper();
else else
{ {
void* p = (void*)pFrm; rArr.push_back( pFrm );
rArr.Insert( p, rArr.Count() );
// bei der Seite ist schluss // bei der Seite ist schluss
if( pFrm->IsPageFrm() ) if( pFrm->IsPageFrm() )
...@@ -115,18 +114,18 @@ sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, ...@@ -115,18 +114,18 @@ sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
if( !pFrm || !pMyFrm || pFrm == pMyFrm ) if( !pFrm || !pMyFrm || pFrm == pMyFrm )
return sal_False; return sal_False;
SvPtrarr aRefArr( 10 ), aArr( 10 ); std::vector<const SwFrm*> aRefArr, aArr;
::lcl_GetLayTree( pFrm, aRefArr ); ::lcl_GetLayTree( pFrm, aRefArr );
::lcl_GetLayTree( pMyFrm, aArr ); ::lcl_GetLayTree( pMyFrm, aArr );
sal_uInt16 nRefCnt = aRefArr.Count() - 1, nCnt = aArr.Count() - 1; sal_uInt16 nRefCnt = aRefArr.size() - 1, nCnt = aArr.size() - 1;
sal_Bool bVert = sal_False; sal_Bool bVert = sal_False;
sal_Bool bR2L = sal_False; sal_Bool bR2L = sal_False;
// solange bis ein Frame ungleich ist ? // solange bis ein Frame ungleich ist ?
while( nRefCnt && nCnt && aRefArr[ nRefCnt ] == aArr[ nCnt ] ) while( nRefCnt && nCnt && aRefArr[ nRefCnt ] == aArr[ nCnt ] )
{ {
const SwFrm* pTmpFrm = (const SwFrm*)aArr[ nCnt ]; const SwFrm* pTmpFrm = aArr[ nCnt ];
bVert = pTmpFrm->IsVertical(); bVert = pTmpFrm->IsVertical();
bR2L = pTmpFrm->IsRightToLeft(); bR2L = pTmpFrm->IsRightToLeft();
--nCnt, --nRefCnt; --nCnt, --nRefCnt;
...@@ -141,8 +140,8 @@ sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, ...@@ -141,8 +140,8 @@ sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
--nRefCnt; --nRefCnt;
} }
const SwFrm* pRefFrm = (const SwFrm*)aRefArr[ nRefCnt ]; const SwFrm* pRefFrm = aRefArr[ nRefCnt ];
const SwFrm* pFldFrm = (const SwFrm*)aArr[ nCnt ]; const SwFrm* pFldFrm = aArr[ nCnt ];
// unterschiedliche Frames, dann ueberpruefe deren Y-/X-Position // unterschiedliche Frames, dann ueberpruefe deren Y-/X-Position
sal_Bool bRefIsLower = sal_False; sal_Bool bRefIsLower = sal_False;
...@@ -174,9 +173,9 @@ sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, ...@@ -174,9 +173,9 @@ sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
pRefFrm = 0; pRefFrm = 0;
} }
else if( ( FRM_COLUMN | FRM_CELL ) & pFldFrm->GetType() ) else if( ( FRM_COLUMN | FRM_CELL ) & pFldFrm->GetType() )
pFldFrm = (const SwFrm*)aArr[ nCnt - 1 ]; pFldFrm = aArr[ nCnt - 1 ];
else else
pRefFrm = (const SwFrm*)aRefArr[ nRefCnt - 1 ]; pRefFrm = aRefArr[ nRefCnt - 1 ];
} }
if( pRefFrm ) // als Flag missbrauchen if( pRefFrm ) // als Flag missbrauchen
......
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