diff options
author | Henning Brinkmann <hbrinkm@openoffice.org> | 2010-09-20 16:52:57 +0200 |
---|---|---|
committer | Henning Brinkmann <hbrinkm@openoffice.org> | 2010-09-20 16:52:57 +0200 |
commit | 4fd0835170a4175aec8b1345580921d6161a3761 (patch) | |
tree | dad0ba26b0d1a000ddfe425a5c9961f71c570e88 /sw | |
parent | e8206d063b6eac570e38834b58923420e55dda99 (diff) |
#b6986082# InsBoxen: Do not insert a new cell beyond the end
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index b213eb1d075d..f0683ae700a5 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -334,7 +334,13 @@ BOOL SwNodes::InsBoxen( SwTableNode* pTblNd, new SwEndNode( aEndIdx, *pSttNd ); pPrvBox = new SwTableBox( pBoxFmt, *pSttNd, pLine ); - pLine->GetTabBoxes().C40_INSERT( SwTableBox, pPrvBox, nInsPos + n ); + + SwTableBoxes & rTabBoxes = pLine->GetTabBoxes(); + USHORT nRealInsPos = nInsPos + n; + if (nRealInsPos > rTabBoxes.Count()) + nRealInsPos = rTabBoxes.Count(); + + rTabBoxes.C40_INSERT( SwTableBox, pPrvBox, nRealInsPos ); //if( NO_NUMBERING == pTxtColl->GetOutlineLevel()//#outline level,zhaojianwei if( ! pTxtColl->IsAssignedToListLevelOfOutlineStyle()//<-end,zhaojianwei |