diff -uNr sw.old/source/core/docnode/ndtbl1.cxx sw.new/source/core/docnode/ndtbl1.cxx --- sw.old/source/core/docnode/ndtbl1.cxx 2007-01-25 16:33:40.000000000 +0800 +++ sw.new/source/core/docnode/ndtbl1.cxx 2007-05-25 16:22:48.000000000 +0800 @@ -1470,7 +1470,7 @@ if ( bNotInCols ) ::lcl_CalcSubColValues( rToFill, rCols, pCell, pTab, bWishValues ); } - pCell = pCell->GetNextLayoutLeaf(); + pCell = pCell->GetNextLayoutCell(); } while ( pCell && const_cast(pCell)->ImplFindTabFrm() == pTab ); } diff -uNr sw.old/source/core/inc/frame.hxx sw.new/source/core/inc/frame.hxx --- sw.old/source/core/inc/frame.hxx 2006-11-01 19:10:56.000000000 +0800 +++ sw.new/source/core/inc/frame.hxx 2007-05-25 16:25:18.000000000 +0800 @@ -373,7 +373,7 @@ SwFrm( SwFrm & ); //Kopieren ist nicht erlaubt. const SwLayoutFrm* ImplGetNextLayoutLeaf( bool bFwd ) const; - + const SwLayoutFrm* ImplGetNextLayoutCell( bool bFwd ) const; protected: SwSortedObjs* pDrawObjs; //Hier haengen die DrawObjs, kann 0 sein @@ -732,6 +732,7 @@ inline const SwLayoutFrm *GetPrevLayoutLeaf() const; inline const SwLayoutFrm *GetNextLayoutLeaf() const; + inline const SwLayoutFrm *GetNextLayoutCell() const; inline SwLayoutFrm *GetPrevLayoutLeaf(); inline SwLayoutFrm *GetNextLayoutLeaf(); @@ -1011,6 +1012,11 @@ return ImplGetNextLayoutLeaf( true ); } +inline const SwLayoutFrm *SwFrm::GetNextLayoutCell() const +{ + return ImplGetNextLayoutCell( true ); +} + inline const SwLayoutFrm *SwFrm::GetPrevLayoutLeaf() const { return ImplGetNextLayoutLeaf( false ); diff -uNr sw.old/source/core/layout/findfrm.cxx sw.new/source/core/layout/findfrm.cxx --- sw.old/source/core/layout/findfrm.cxx 2006-11-01 19:10:58.000000000 +0800 +++ sw.new/source/core/layout/findfrm.cxx 2007-05-25 16:23:40.000000000 +0800 @@ -412,7 +412,47 @@ return pLayoutFrm; } +const SwLayoutFrm *SwFrm::ImplGetNextLayoutCell( bool bFwd ) const +{ + const SwFrm *pFrm = this; + const SwLayoutFrm *pLayoutFrm = 0; + const SwFrm *p; + bool bGoingUp = !bFwd; + do { + + bool bGoingFwdOrBwd = false, bGoingDown = false; + + p = lcl_GetLower( pFrm, bFwd ); + if( p && p->IsTabFrm()) + p = p->GetNext(); + + bGoingDown = ( !bGoingUp && 0 != p ); + if ( !bGoingDown ) + { + + bGoingFwdOrBwd = (0 != (p = lcl_FindLayoutFrame( pFrm, bFwd, true ) ) ); + if ( !bGoingFwdOrBwd ) + { + bGoingUp = (0 != (p = pFrm->GetUpper() ) ); + if ( !bGoingUp ) + { + return 0; + } + } + } + + bGoingUp = !bGoingFwdOrBwd && !bGoingDown; + + pFrm = p; + p = lcl_GetLower( pFrm, true ); + + } while( ( p && !p->IsFlowFrm() ) || + pFrm == this || + 0 == ( pLayoutFrm = pFrm->IsLayoutFrm() ? (SwLayoutFrm*)pFrm : 0 ) || + pLayoutFrm->IsAnLower( this ) ); + return pLayoutFrm; +}//lijian /*************************************************************************