summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-05-27 15:33:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-05-27 16:55:54 +0100
commit2cdaa46e92e81593880537c6f931b4df347763c5 (patch)
tree819dbc29b2fe2bff8d602d00d33a5207b15e84c1 /sw
parent90b4217602ad9edb035f22b0ee14c27b61044f96 (diff)
Resolves: rhbz#707317 avoid crash in getRowSpan
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/swcrsr.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b938c19ec3a8..736961db3ee8 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1664,8 +1664,7 @@ sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
{
// Set cursor to start/end of covered cell:
SwTableBox* pTableBox = pOldTabBoxSttNode->GetTblBox();
- const long nRowSpan = pTableBox->getRowSpan();
- if ( nRowSpan > 1 )
+ if ( pTableBox && pTableBox->getRowSpan() > 1 )
{
pTableBox = & pTableBox->FindEndOfRowSpan( pOldTabSttNode->GetTable(), (sal_uInt16)(pTableBox->getRowSpan() + mnRowSpanOffset ) );
SwNodeIndex& rPtIdx = GetPoint()->nNode;
@@ -1952,7 +1951,7 @@ sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt )
// proceeding:
if ( mnRowSpanOffset )
{
- if ( pTableBox->getRowSpan() > 1 )
+ if ( pTableBox && pTableBox->getRowSpan() > 1 )
{
pTableBox = & pTableBox->FindEndOfRowSpan( pTblNd->GetTable(), (sal_uInt16)(pTableBox->getRowSpan() + mnRowSpanOffset) );
SwNodeIndex aNewIdx( *pTableBox->GetSttNd() );
@@ -1975,7 +1974,7 @@ sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt )
pTableBoxStartNode = rPtIdx.GetNode().FindTableBoxStartNode();
pTableBox = pTableBoxStartNode->GetTblBox();
- if ( pTableBox->getRowSpan() < 1 )
+ if ( pTableBox && pTableBox->getRowSpan() < 1 )
{
mnRowSpanOffset = pTableBox->getRowSpan();
// move cursor to non-covered cell: