diff options
-rw-r--r-- | sw/source/core/frmedt/tblsel.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index e69b80f7c9df..8aa024e81da6 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -2110,7 +2110,7 @@ void _FndBox::SetTableLines( const SwSelBoxes &rBoxes, const SwTable &rTable ) if( nEndPos < nPos ) nEndPos = nPos; } - if ( nStPos > 1 ) + if (USHRT_MAX != nStPos && nStPos > 1) pLineBefore = rTable.GetTabLines()[nStPos - 2]; if ( nEndPos < rTable.GetTabLines().size() ) pLineBehind = rTable.GetTabLines()[nEndPos]; @@ -2173,7 +2173,8 @@ void _FndBox::DelFrms( SwTable &rTable, bool bAccTableDispose ) nEndPos = rTable.GetTabLines().GetPos( (const SwTableLine*&)pLineBehind ); OSL_ENSURE( nEndPos != USHRT_MAX, "The fox stole the line!" ); - --nEndPos; + if (nEndPos != 0) + --nEndPos; } for ( sal_uInt16 i = nStPos; i <= nEndPos; ++i) |