Index: sw/source/filter/ww8/ww8par.cxx =================================================================== --- sw/source/filter/ww8/ww8par.cxx (revision 1395446) +++ sw/source/filter/ww8/ww8par.cxx (working copy) @@ -2099,12 +2099,15 @@ WW8_TablePos *pTabPos=0; WW8_TablePos aTabPos; + WW8PLCFx_Cp_FKP* pPap = 0; + bool bTableHasPositionInfo = false; + if (nCellLevel && !bVer67) { WW8PLCFxSave1 aSave; pPlcxMan->GetPap()->Save( aSave ); rbReSync = true; - WW8PLCFx_Cp_FKP* pPap = pPlcxMan->GetPapPLCF(); + pPap = pPlcxMan->GetPapPLCF(); WW8_CP nMyStartCp=nStartCp; if (const sal_uInt8 *pLevel = pPlcxMan->HasParaSprm(0x6649)) @@ -2116,15 +2119,29 @@ if (!bHasRowEnd) nCellLevel = static_cast< sal_uInt8 >(nInTable); - if (bHasRowEnd && ParseTabPos(&aTabPos,pPap)) - pTabPos = &aTabPos; + sal_uLong idstart = rDoc.GetNodes().GetEndOfContent().StartOfSectionIndex(); // get the node index + sal_uLong idcur = 0; + if ( pPaM && pPaM->GetPoint() ) + idcur = pPaM->GetPoint()->nNode.GetIndex(); + + // Memory first table postion info + if ( !pFirstTablePap && idstart + 1 == idcur ) + pFirstTablePap = pPap; + if ( bHasRowEnd && ParseTabPos(&aTabPos,pPap) ) + { + // If table front don't have some content and it is doc first table, ignore table text wrapping property + bTableHasPositionInfo = true; + if ( pFirstTablePap != pPap ) + pTabPos = &aTabPos; + } + pPlcxMan->GetPap()->Restore( aSave ); } // then look if we are in an Apo - ApoTestResults aApo = TestApo(nCellLevel, bTableRowEnd, pTabPos); + ApoTestResults aApo = TestApo(nCellLevel, bTableRowEnd, pTabPos, !(pFirstTablePap == pPap && bTableHasPositionInfo)); //look to see if we are in a Table, but Table in foot/end note not allowed bool bStartTab = (nInTable < nCellLevel) && !bFtnEdn; Index: sw/source/filter/ww8/ww8par.hxx =================================================================== --- sw/source/filter/ww8/ww8par.hxx (revision 1395446) +++ sw/source/filter/ww8/ww8par.hxx (working copy) @@ -1103,6 +1103,8 @@ bool bBidi; bool bReadTable; boost::shared_ptr mpTableEndPaM; + WW8PLCFx_Cp_FKP* pFirstTablePap; + // Indicate that currently on loading a TOC, managed by Read_F_TOX() and End_Field() bool mbLoadingTOCCache; // Indicate that current on loading a hyperlink, which is inside a TOC; Managed by Read_F_Hyperlink() and End_Field() @@ -1239,8 +1241,8 @@ bool StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); void StopApo(); bool TestSameApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); - ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd, - const WW8_TablePos *pTabPos); + ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd, const WW8_TablePos *pTabPos, + bool bReadTablePos = true); void EndSpecial(); bool ProcessSpecial(bool &rbReSync, WW8_CP nStartCp); Index: sw/source/filter/ww8/ww8par2.cxx =================================================================== --- sw/source/filter/ww8/ww8par2.cxx (revision 1395446) +++ sw/source/filter/ww8/ww8par2.cxx (working copy) @@ -528,7 +528,7 @@ } ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd, - const WW8_TablePos *pTabPos) + const WW8_TablePos *pTabPos, bool bReadTablePos) { const WW8_TablePos *pTopLevelTable = nCellLevel <= 1 ? pTabPos : 0; ApoTestResults aRet; @@ -556,9 +556,13 @@ If we are already a table in a frame then we must grab the para properties to see if we are still in that frame. */ + // If table front don't have some content and it is doc first table, ignore table text wrapping property + if ( bReadTablePos ) + { + aRet.mpSprm37 = pPlcxMan->HasParaSprm( bVer67 ? 37 : 0x2423 ); + aRet.mpSprm29 = pPlcxMan->HasParaSprm( bVer67 ? 29 : 0x261B ); + } - aRet.mpSprm37 = pPlcxMan->HasParaSprm( bVer67 ? 37 : 0x2423 ); - aRet.mpSprm29 = pPlcxMan->HasParaSprm( bVer67 ? 29 : 0x261B ); // Is there some frame data here bool bNowApo = aRet.HasFrame() || pTopLevelTable;