[Libreoffice-commits] core.git: sw/source
Michael Stahl
mstahl at redhat.com
Mon Jun 30 14:47:18 PDT 2014
sw/source/core/frmedt/tblsel.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 2c157249207552e193e52f5ab7fad5b37ae0a748
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Jun 30 23:22:10 2014 +0200
fdo#80663: sw: fix crash on Undo of table row/column delete
The _FndBox appears to handle an empty table lines vector, but evidently
it does not check its indexes properly in this case, which crashes with
STL containers.
(regression from bc0c939270a45469b8f22008288b5e4a4d9c9861)
Change-Id: Id864ea12bc97e61c5251f470e446b6b8f69cb054
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index e69b80f..8aa024e 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)
More information about the Libreoffice-commits
mailing list