summaryrefslogtreecommitdiff
path: root/sw/source/core/docnode/ndtbl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/docnode/ndtbl.cxx')
-rw-r--r--sw/source/core/docnode/ndtbl.cxx8
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