[Libreoffice-commits] .: sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri May 27 08:56:05 PDT 2011


 sw/source/core/crsr/swcrsr.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 23c4f82e9084f8b15f149b074a8ad4ff6a7a4204
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 27 15:33:40 2011 +0100

    Resolves: rhbz#707317 avoid crash in getRowSpan

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index e9e36ff..ba3d559 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:


More information about the Libreoffice-commits mailing list