[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Thu Dec 8 11:13:59 PST 2011


 sw/source/core/crsr/callnk.cxx |    2 +-
 sw/source/core/crsr/crsrsh.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 16fbfaaa2da85415944f1a3f3e16f48ee30505f6
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Thu Dec 8 22:55:27 2011 +0400

    fdo#42147: fix crash
    
    it is not valid to use (type & ND_TEXTNODE) before casting to SwTxtNode,
    type of SwCntntNode has the ND_TEXTNODE bit as well, but SwCntntNode is not
    derived from SwTxtNode.

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 66e7f45..a6373da 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -70,7 +70,7 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
     nNdTyp = rNd.GetNodeType();
     bHasSelection = ( *pCrsr->GetPoint() != *pCrsr->GetMark() );
 
-    if( ND_TEXTNODE & nNdTyp )
+    if( rNd.IsTxtNode() )
         nLeftFrmPos = SwCallLink::getLayoutFrm( rShell.GetLayout(), (SwTxtNode&)rNd, nCntnt,
                                             !rShell.ActionPend() );
     else
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index ca32947..5617665 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -223,7 +223,7 @@ void SwCrsrShell::StartAction()
         nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex();
         nAktNdTyp = rNd.GetNodeType();
         bAktSelection = *pCurCrsr->GetPoint() != *pCurCrsr->GetMark();
-        if( ND_TEXTNODE & nAktNdTyp )
+        if( rNd.IsTxtNode() )
             nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), (SwTxtNode&)rNd, nAktCntnt, sal_True );
         else
             nLeftFrmPos = 0;


More information about the Libreoffice-commits mailing list