[Libreoffice-commits] core.git: sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Nov 19 00:04:19 PST 2014


 sw/qa/extras/uiwriter/uiwriter.cxx                      |    4 +-
 sw/source/core/crsr/callnk.cxx                          |   10 ++---
 sw/source/core/crsr/crsrsh.cxx                          |    4 +-
 sw/source/core/crsr/crstrvl.cxx                         |    8 ++--
 sw/source/core/crsr/findattr.cxx                        |    6 +--
 sw/source/core/crsr/findtxt.cxx                         |   12 +++----
 sw/source/core/crsr/swcrsr.cxx                          |    7 +---
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   16 ++++-----
 sw/source/core/doc/doc.cxx                              |    9 ++---
 sw/source/core/doc/doccomp.cxx                          |   10 ++---
 sw/source/core/doc/docedt.cxx                           |   27 +++++++---------
 sw/source/core/doc/docfld.cxx                           |    3 -
 sw/source/core/doc/docglbl.cxx                          |    4 +-
 sw/source/core/doc/docnum.cxx                           |    4 +-
 sw/source/core/doc/docredln.cxx                         |   17 ++++------
 sw/source/core/doc/docsort.cxx                          |    2 -
 sw/source/core/docnode/ndtbl.cxx                        |    2 -
 sw/source/core/docnode/node.cxx                         |    5 +-
 sw/source/core/docnode/nodes.cxx                        |   10 ++---
 sw/source/core/edit/edattr.cxx                          |    4 +-
 sw/source/core/edit/edfmt.cxx                           |    2 -
 sw/source/core/edit/editsh.cxx                          |    2 -
 sw/source/core/text/EnhancedPDFExportHelper.cxx         |    3 -
 sw/source/core/tox/txmsrt.cxx                           |    2 -
 sw/source/core/undo/rolbck.cxx                          |    3 -
 sw/source/core/undo/unattr.cxx                          |    3 -
 sw/source/core/undo/undobj1.cxx                         |    6 +--
 sw/source/core/undo/unins.cxx                           |    4 +-
 sw/source/core/unocore/unoobj2.cxx                      |    5 +-
 sw/source/filter/ww8/docxsdrexport.cxx                  |    2 -
 sw/source/filter/ww8/ww8par.cxx                         |    2 -
 31 files changed, 90 insertions(+), 108 deletions(-)

New commits:
commit 3c95503cefaf996faec1adb87e296c1b8a71d221
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 19 09:03:34 2014 +0100

    Use SwNode::GetTxtNode()
    
    Change-Id: Icf3e1013d5eba5702badf19aa6c1f5e6708ed154

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 4fa1680..d79b6b3 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -239,8 +239,8 @@ void SwUiWriterTest::testImportRTF()
     CPPUNIT_ASSERT_EQUAL(sal_uLong(0), aReader.Read(*pRTFReader));
 
     sal_uLong nIndex = pWrtShell->GetCrsr()->GetNode().GetIndex();
-    CPPUNIT_ASSERT_EQUAL(OUString("fooHello world!"), static_cast<SwTxtNode*>(pDoc->GetNodes()[nIndex - 1])->GetTxt());
-    CPPUNIT_ASSERT_EQUAL(OUString("bar"), static_cast<SwTxtNode*>(pDoc->GetNodes()[nIndex])->GetTxt());
+    CPPUNIT_ASSERT_EQUAL(OUString("fooHello world!"), pDoc->GetNodes()[nIndex - 1]->GetTxtNode()->GetTxt());
+    CPPUNIT_ASSERT_EQUAL(OUString("bar"), pDoc->GetNodes()[nIndex]->GetTxtNode()->GetTxt());
 }
 
 void SwUiWriterTest::testExportRTF()
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 6c036c3..6725f43 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -56,7 +56,7 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
     bHasSelection = ( *pCrsr->GetPoint() != *pCrsr->GetMark() );
 
     if( rNd.IsTxtNode() )
-        nLeftFrmPos = SwCallLink::getLayoutFrm( rShell.GetLayout(), static_cast<SwTxtNode&>(rNd), nCntnt,
+        nLeftFrmPos = SwCallLink::getLayoutFrm( rShell.GetLayout(), *rNd.GetTxtNode(), nCntnt,
                                             !rShell.ActionPend() );
     else
     {
@@ -151,7 +151,7 @@ SwCallLink::~SwCallLink()
     {
         // If travelling with left/right only and the frame is
         // unchanged (columns!) then check text hints.
-        if( nLeftFrmPos == SwCallLink::getLayoutFrm( rShell.GetLayout(), static_cast<SwTxtNode&>(*pCNd), nAktCntnt,
+        if( nLeftFrmPos == SwCallLink::getLayoutFrm( rShell.GetLayout(), *pCNd->GetTxtNode(), nAktCntnt,
                                                     !rShell.ActionPend() ) &&
             (( nCmp = nCntnt ) + 1 == nAktCntnt ||          // Right
             nCntnt -1 == ( nCmp = nAktCntnt )) )            // Left
@@ -159,9 +159,9 @@ SwCallLink::~SwCallLink()
             if( nCmp == nAktCntnt && pCurCrsr->HasMark() ) // left & select
                 ++nCmp;
 
-            if ( static_cast<SwTxtNode*>(pCNd)->HasHints() )
+            if ( pCNd->GetTxtNode()->HasHints() )
             {
-                const SwpHints &rHts = static_cast<SwTxtNode*>(pCNd)->GetSwpHints();
+                const SwpHints &rHts = pCNd->GetTxtNode()->GetSwpHints();
 
                 for( size_t n = 0; n < rHts.Count(); ++n )
                 {
@@ -193,7 +193,7 @@ SwCallLink::~SwCallLink()
 
             if( g_pBreakIt->GetBreakIter().is() )
             {
-                const OUString rTxt = static_cast<SwTxtNode*>(pCNd)->GetTxt();
+                const OUString rTxt = pCNd->GetTxtNode()->GetTxt();
                 if( !nCmp ||
                     g_pBreakIt->GetBreakIter()->getScriptType( rTxt, nCmp )
                      != g_pBreakIt->GetBreakIter()->getScriptType( rTxt, nCmp - 1 ))
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 28ab12c..4c133e4 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -222,7 +222,7 @@ void SwCrsrShell::StartAction()
         m_nAktNdTyp = rNd.GetNodeType();
         m_bAktSelection = *m_pCurCrsr->GetPoint() != *m_pCurCrsr->GetMark();
         if( rNd.IsTxtNode() )
-            m_nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), const_cast<SwTxtNode&>(static_cast<const SwTxtNode&>(rNd)), m_nAktCntnt, true );
+            m_nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), const_cast<SwTxtNode&>(*rNd.GetTxtNode()), m_nAktCntnt, true );
         else
             m_nLeftFrmPos = 0;
     }
@@ -1352,7 +1352,7 @@ static void lcl_CheckHiddenPara( SwPosition& rPos )
     {
         SwCntntNode* pCntnt = aTmp.GetNodes().GoNext( &aTmp );
         if ( pCntnt && pCntnt->IsTxtNode() )
-            pTxtNd = static_cast<SwTxtNode*>(pCntnt);
+            pTxtNd = pCntnt->GetTxtNode();
         else
             pTxtNd = 0;
     }
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 54cbf25..cfc67b2 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -967,7 +967,7 @@ bool SwCrsrShell::GotoNextOutline()
     SwCallLink aLk( *this ); // watch Crsr-Moves
     SwCrsrSaveState aSaveState( *pCrsr );
     pCrsr->GetPoint()->nNode = *pNd;
-    pCrsr->GetPoint()->nContent.Assign( static_cast<SwTxtNode*>(pNd), 0 );
+    pCrsr->GetPoint()->nContent.Assign( pNd->GetTxtNode(), 0 );
 
     bool bRet = !pCrsr->IsSelOvr();
     if( bRet )
@@ -996,7 +996,7 @@ bool SwCrsrShell::GotoPrevOutline()
         SwCallLink aLk( *this ); // watch Crsr-Moves
         SwCrsrSaveState aSaveState( *pCrsr );
         pCrsr->GetPoint()->nNode = *pNd;
-        pCrsr->GetPoint()->nContent.Assign( static_cast<SwTxtNode*>(pNd), 0 );
+        pCrsr->GetPoint()->nContent.Assign( pNd->GetTxtNode(), 0 );
 
         bRet = !pCrsr->IsSelOvr();
         if( bRet )
@@ -1020,7 +1020,7 @@ sal_uInt16 SwCrsrShell::GetOutlinePos( sal_uInt8 nLevel )
     {
         pNd = rNds.GetOutLineNds()[ nPos ];
 
-        if( static_cast<SwTxtNode*>(pNd)->GetAttrOutlineLevel()-1 <= nLevel )
+        if( pNd->GetTxtNode()->GetAttrOutlineLevel()-1 <= nLevel )
             return nPos;
 
     }
@@ -1705,7 +1705,7 @@ bool SwContentAtPos::IsInRTLText()const
             aTemp.Move(fnMoveForward, fnGoNode);
             SwCntntNode* pCntntNode = aTemp.GetCntntNode();
             if(pCntntNode && pCntntNode->IsTxtNode())
-                pNd = static_cast<SwTxtNode*>(pCntntNode);
+                pNd = pCntntNode->GetTxtNode();
         }
     }
     if(pNd)
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 9ac06aa..a0439d8 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -915,8 +915,8 @@ bool SwPaM::Find( const SfxPoolItem& rAttr, bool bValue, SwMoveFn fnMove,
             if( !pNode->IsTxtNode() ) // CharAttr are only in text nodes
                 continue;
 
-            if( static_cast<SwTxtNode*>(pNode)->HasHints() &&
-                lcl_Search( *static_cast<SwTxtNode*>(pNode), *pPam, rAttr, fnMove,  bValue ))
+            if( pNode->GetTxtNode()->HasHints() &&
+                lcl_Search( *pNode->GetTxtNode(), *pPam, rAttr, fnMove,  bValue ))
             {
                 // set to the values of the attribute
                 SetMark();
@@ -1005,7 +1005,7 @@ bool SwPaM::Find( const SfxItemSet& rSet, bool bNoColls, SwMoveFn fnMove,
 
             if( (!aOtherSet.Count() ||
                 lcl_Search( *pNode, aOtherSet, bNoColls )) &&
-                (*fnSearch)( *static_cast<SwTxtNode*>(pNode), aCmpArr, *pPam ))
+                (*fnSearch)( *pNode->GetTxtNode(), aCmpArr, *pPam ))
             {
                 // set to the values of the attribute
                 SetMark();
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 42f7d7f..c7ac144 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -241,7 +241,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
     {
         if( pNode->IsTxtNode() )
         {
-            sal_Int32 nTxtLen = static_cast<SwTxtNode*>(pNode)->GetTxt().getLength();
+            sal_Int32 nTxtLen = pNode->GetTxtNode()->GetTxt().getLength();
             sal_Int32 nEnd;
             if( rNdIdx == pPam->GetMark()->nNode )
                 nEnd = pPam->GetMark()->nContent.GetIndex();
@@ -253,7 +253,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
             // if there are SwPostItFields inside our current node text, we
             // split the text into separate pieces and search for text inside
             // the pieces as well as inside the fields
-            const SwpHints *pHts = static_cast<SwTxtNode*>(pNode)->GetpSwpHints();
+            const SwpHints *pHts = pNode->GetTxtNode()->GetpSwpHints();
 
             // count PostItFields by looping over all fields
             sal_Int32 aNumberPostits = 0;
@@ -414,10 +414,10 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
     }
 
     if( bSrchForward )
-        sCleanStr = lcl_CleanStr(*static_cast<SwTxtNode*>(pNode), nStart, nEnd,
+        sCleanStr = lcl_CleanStr(*pNode->GetTxtNode(), nStart, nEnd,
                         aFltArr, bRemoveSoftHyphens);
     else
-        sCleanStr = lcl_CleanStr(*static_cast<SwTxtNode*>(pNode), nEnd, nStart,
+        sCleanStr = lcl_CleanStr(*pNode->GetTxtNode(), nEnd, nStart,
                         aFltArr, bRemoveSoftHyphens);
 
     SwScriptIterator* pScriptIter = 0;
@@ -446,7 +446,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
             if ( nSearchScript == nCurrScript )
             {
                 const LanguageType eCurrLang =
-                        static_cast<SwTxtNode*>(pNode)->GetLang( bSrchForward ?
+                        pNode->GetTxtNode()->GetLang( bSrchForward ?
                                                       nStart :
                                                       nEnd );
 
@@ -653,7 +653,7 @@ OUString *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam )
         if( pTxtNode && pTxtNode->IsTxtNode() && pTxtNode == pPam->GetCntntNode( false ) )
         {
             utl::TextSearch aSTxt( rSearchOpt );
-            const OUString& rStr = static_cast<const SwTxtNode*>(pTxtNode)->GetTxt();
+            const OUString& rStr = pTxtNode->GetTxtNode()->GetTxt();
             sal_Int32 nStart = pPam->Start()->nContent.GetIndex();
             sal_Int32 nEnd = pPam->End()->nContent.GetIndex();
             SearchResult aResult;
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index e92818fa..071d51b 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1706,7 +1706,7 @@ bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
         if ( &rTmpNode != &rNode && rTmpNode.IsTxtNode() )
         {
             Point aPt;
-            const SwCntntFrm* pEndFrm = static_cast<SwTxtNode&>(rTmpNode).getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, GetPoint() );
+            const SwCntntFrm* pEndFrm = rTmpNode.GetTxtNode()->getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, GetPoint() );
             if ( pEndFrm )
             {
                 if ( ! pEndFrm->IsRightToLeft() != ! pSttFrm->IsRightToLeft() )
@@ -1732,14 +1732,13 @@ void SwCursor::DoSetBidiLevelUpDown()
     if ( rNode.IsTxtNode() )
     {
         const SwScriptInfo* pSI =
-            SwScriptInfo::GetScriptInfo( static_cast<SwTxtNode&>(rNode) );
+            SwScriptInfo::GetScriptInfo( *rNode.GetTxtNode() );
         if ( pSI )
         {
             SwIndex& rIdx = GetPoint()->nContent;
             const sal_Int32 nPos = rIdx.GetIndex();
 
-            if (nPos && nPos <
-                    static_cast<SwTxtNode&>(rNode).GetTxt().getLength())
+            if (nPos && nPos < rNode.GetTxtNode()->GetTxt().getLength())
             {
                 const sal_uInt8 nCurrLevel = pSI->DirType( nPos );
                 const sal_uInt8 nPrevLevel = pSI->DirType( nPos - 1 );
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index a39b961..cd25464 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -894,8 +894,7 @@ namespace
                 SwNode* pNode = &aIdx.GetNode();
                 if( pNode->IsTxtNode() ) // Looking for text nodes...
                 {
-                    SwpHints *pHints =
-                        static_cast<SwTxtNode*>(pNode)->GetpSwpHints();
+                    SwpHints *pHints = pNode->GetTxtNode()->GetpSwpHints();
                     if( pHints && pHints->HasFtn() ) //...with footnotes
                     {
                         bUpdateFtn = true; // Heureka
@@ -1294,7 +1293,7 @@ namespace //local functions originally from docfmt.cxx
 
             if( pNode->IsTxtNode() && pCharSet && pCharSet->Count() )
             {
-                SwTxtNode* pTxtNd = static_cast<SwTxtNode*>(pNode);
+                SwTxtNode* pTxtNd = pNode->GetTxtNode();
                 const SwIndex& rSt = pStt->nContent;
                 sal_Int32 nMkPos, nPtPos = rSt.GetIndex();
                 const OUString& rStr = pTxtNd->GetTxt();
@@ -1559,7 +1558,7 @@ namespace //local functions originally from docfmt.cxx
                 SwNode* pNd = pDoc->GetNodes()[ nStart ];
                 if (!pNd || !pNd->IsTxtNode())
                     continue;
-                SwTxtNode *pCurrentNd = static_cast<SwTxtNode*>(pNd);
+                SwTxtNode *pCurrentNd = pNd->GetTxtNode();
                 pCurrentNd->TryCharSetExpandToNum(*pCharSet);
             }
         }
@@ -1964,7 +1963,7 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos,
         const boost::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create());
         pCntntStore->Save( &m_rDoc, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(), true );
 
-        pTNd = static_cast<SwTxtNode*>(pTNd->SplitCntntNode( rPos ));
+        pTNd = pTNd->SplitCntntNode( rPos )->GetTxtNode();
 
         if( !pCntntStore->Empty() )
             pCntntStore->Restore( &m_rDoc, rPos.nNode.GetIndex()-1, 0, true );
@@ -2919,7 +2918,7 @@ bool DocumentContentOperationsManager::AppendTxtNode( SwPosition& rPos )
                         m_rDoc.getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_STANDARD ));
     }
     else
-        pCurNode = static_cast<SwTxtNode*>(pCurNode->AppendNode( rPos ));
+        pCurNode = pCurNode->AppendNode( rPos )->GetTxtNode();
 
     rPos.nNode++;
     rPos.nContent.Assign( pCurNode, 0 );
@@ -3354,8 +3353,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
         if ((FLY_AT_CHAR == aAnchor.GetAnchorId()) &&
              newPos.nNode.GetNode().IsTxtNode() )
         {
-            newPos.nContent.Assign( static_cast<SwTxtNode*>(&newPos.nNode.GetNode()),
-                                        newPos.nContent.GetIndex() );
+            newPos.nContent.Assign( newPos.nNode.GetNode().GetTxtNode(), newPos.nContent.GetIndex() );
         }
         else
         {
@@ -4182,7 +4180,7 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos,
                             pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD));
                     else
                     {
-                        pDestTxtNd = static_cast<SwTxtNode*>(pSttTxtNd->MakeCopy( pDoc, aInsPos ));
+                        pDestTxtNd = pSttTxtNd->MakeCopy( pDoc, aInsPos )->GetTxtNode();
                         bCopyOk = true;
                     }
                     aDestIdx.Assign( pDestTxtNd, 0 );
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 74b1aa0..b6531be 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1198,7 +1198,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bIm
             ::SetProgressState( i, GetDocShell() );
             const sal_uLong nIndex = rOutNds[ i ]->GetIndex();
 
-            const int nLvl = static_cast<SwTxtNode*>(GetNodes()[ nIndex ])->GetAttrOutlineLevel()-1;
+            const int nLvl = GetNodes()[ nIndex ]->GetTxtNode()->GetAttrOutlineLevel()-1;
             if( nLvl > nLevel )
                 continue;
             sal_uInt16 nEndOfs = 1;
@@ -1209,7 +1209,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bIm
             while( ( nWish || bKeep ) && nIndex + nEndOfs < nNextOutNd &&
                    GetNodes()[ nIndex + nEndOfs ]->IsTxtNode() )
             {
-                SwTxtNode* pTxtNode = static_cast<SwTxtNode*>(GetNodes()[ nIndex+nEndOfs ]);
+                SwTxtNode* pTxtNode = GetNodes()[ nIndex+nEndOfs ]->GetTxtNode();
                 if (pTxtNode->GetTxt().getLength() && nWish)
                     --nWish;
                 bKeep = pTxtNode->GetSwAttrSet().GetKeep().GetValue();
@@ -1230,7 +1230,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bIm
             bool bDelete = false;
             if( (pNode = &aIndx.GetNode())->IsTxtNode() )
             {
-                SwTxtNode *pNd = static_cast<SwTxtNode*>(pNode);
+                SwTxtNode *pNd = pNode->GetTxtNode();
                 if( pNd->HasSwAttrSet() )
                     pNd->ResetAttr( RES_PAGEDESC, RES_BREAK );
                 if( bImpress )
@@ -1675,8 +1675,7 @@ bool SwDoc::ContainsHiddenChars() const
     for( sal_uLong n = GetNodes().Count(); n; )
     {
         SwNode* pNd = GetNodes()[ --n ];
-        if ( pNd->IsTxtNode() &&
-             static_cast<SwTxtNode*>(pNd)->HasHiddenCharAttribute( false ) )
+        if ( pNd->IsTxtNode() && pNd->GetTxtNode()->HasHiddenCharAttribute( false ) )
             return true;
     }
 
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 2e477fb..8634835 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1011,7 +1011,7 @@ sal_uLong SwCompareLine::GetHashValue() const
     switch( rNode.GetNodeType() )
     {
     case ND_TEXTNODE:
-        nRet = GetTxtNodeHashValue( static_cast<const SwTxtNode&>(rNode), nRet );
+        nRet = GetTxtNodeHashValue( *rNode.GetTxtNode(), nRet );
         break;
 
     case ND_TABLENODE:
@@ -1021,7 +1021,7 @@ sal_uLong SwCompareLine::GetHashValue() const
             while( &aIdx.GetNode() != pEndNd )
             {
                 if( aIdx.GetNode().IsTxtNode() )
-                    nRet = GetTxtNodeHashValue( static_cast<SwTxtNode&>(aIdx.GetNode()), nRet );
+                    nRet = GetTxtNodeHashValue( *aIdx.GetNode().GetTxtNode(), nRet );
                 ++aIdx;
             }
         }
@@ -1102,8 +1102,8 @@ bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
     switch( rDstNd.GetNodeType() )
     {
     case ND_TEXTNODE:
-        bRet = CompareTxtNd( static_cast<const SwTxtNode&>(rDstNd), static_cast<const SwTxtNode&>(rSrcNd) )
-            && ( !CmpOptions.bUseRsid || static_cast<const SwTxtNode&>(rDstNd).CompareParRsid( static_cast<const SwTxtNode&>(rSrcNd) ) );
+        bRet = CompareTxtNd( *rDstNd.GetTxtNode(), *rSrcNd.GetTxtNode() )
+            && ( !CmpOptions.bUseRsid || rDstNd.GetTxtNode()->CompareParRsid( *rSrcNd.GetTxtNode() ) );
         break;
 
     case ND_TABLENODE:
@@ -1191,7 +1191,7 @@ OUString SwCompareLine::GetText() const
     switch( rNode.GetNodeType() )
     {
     case ND_TEXTNODE:
-        sRet = static_cast<const SwTxtNode&>(rNode).GetExpandTxt();
+        sRet = rNode.GetTxtNode()->GetExpandTxt();
         break;
 
     case ND_TABLENODE:
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 4646ecc..e411935 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -512,7 +512,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
             switch( pNd->GetNodeType() )
             {
             case ND_TEXTNODE:
-                if( 0 != ( pCntFrm = static_cast<SwTxtNode*>(pNd)->getLayoutFrm( getIDocumentLayoutAccess().GetCurrentLayout() )) )
+                if( 0 != ( pCntFrm = pNd->GetTxtNode()->getLayoutFrm( getIDocumentLayoutAccess().GetCurrentLayout() )) )
                 {
                     // skip protected and hidden Cells and Flys
                     if( pCntFrm->IsProtected() )
@@ -558,16 +558,13 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
                             }
                             nEndGrammarCheck = (pSpellArgs->pEndNode == pNd)
                                 ? pSpellArgs->pEndIdx->GetIndex()
-                                : static_cast<SwTxtNode const*>(pNd)
+                                : pNd->GetTxtNode()
                                     ->GetTxt().getLength();
                         }
 
-                        sal_Int32 nSpellErrorPosition =
-                            static_cast<SwTxtNode const*>(pNd)->GetTxt().getLength();
-                        if( (!pConvArgs &&
-                                static_cast<SwTxtNode*>(pNd)->Spell( pSpellArgs )) ||
-                            ( pConvArgs &&
-                                static_cast<SwTxtNode*>(pNd)->Convert( *pConvArgs )))
+                        sal_Int32 nSpellErrorPosition = pNd->GetTxtNode()->GetTxt().getLength();
+                        if( (!pConvArgs && pNd->GetTxtNode()->Spell( pSpellArgs )) ||
+                            ( pConvArgs && pNd->GetTxtNode()->Convert( *pConvArgs )))
                         {
                             // Cancel and remember position
                             pSttPos->nNode = nCurrNd;
@@ -586,11 +583,11 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
                             {
                                 uno::Reference< lang::XComponent > xDoc( ((SwDocShell*)GetDocShell())->GetBaseModel(), uno::UNO_QUERY );
                                 // Expand the string:
-                                const ModelToViewHelper aConversionMap(*static_cast<SwTxtNode*>(pNd));
+                                const ModelToViewHelper aConversionMap(*pNd->GetTxtNode());
                                 OUString aExpandText = aConversionMap.getViewText();
 
                                 // get XFlatParagraph to use...
-                                uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *static_cast<SwTxtNode*>(pNd), aExpandText, aConversionMap );
+                                uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *pNd->GetTxtNode(), aExpandText, aConversionMap );
 
                                 // get error position of cursor in XFlatParagraph
                                 linguistic2::ProofreadingResult aResult;
@@ -601,7 +598,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
                                     aResult = xGCIterator->checkSentenceAtPosition(
                                             xDoc, xFlatPara, aExpandText, lang::Locale(), nBeginGrammarCheck, -1, -1 );
 
-                                    lcl_syncGrammarError( *static_cast<SwTxtNode*>(pNd), aResult, aConversionMap );
+                                    lcl_syncGrammarError( *pNd->GetTxtNode(), aResult, aConversionMap );
 
                                     // get suggestions to use for the specific error position
                                     nGrammarErrors = aResult.aErrors.getLength();
@@ -621,10 +618,10 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
                                     nCurrNd = pNd->GetIndex();
                                     pSttPos->nNode = nCurrNd;
                                     pEndPos->nNode = nCurrNd;
-                                    pSpellArgs->pStartNode = static_cast<SwTxtNode*>(pNd);
-                                    pSpellArgs->pEndNode = static_cast<SwTxtNode*>(pNd);
-                                    pSpellArgs->pStartIdx->Assign(static_cast<SwTxtNode*>(pNd), aConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos );
-                                    pSpellArgs->pEndIdx->Assign(static_cast<SwTxtNode*>(pNd), aConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength ).mnPos );
+                                    pSpellArgs->pStartNode = pNd->GetTxtNode();
+                                    pSpellArgs->pEndNode = pNd->GetTxtNode();
+                                    pSpellArgs->pStartIdx->Assign(pNd->GetTxtNode(), aConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos );
+                                    pSpellArgs->pEndIdx->Assign(pNd->GetTxtNode(), aConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength ).mnPos );
                                     nCurrNd = nEndNd;
                                 }
                             }
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 45fa05b..138ef10 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -257,8 +257,7 @@ bool _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const
             if( pFirst->IsTxtNode() && pNext->IsTxtNode() &&
                 ( pFirst->FindFlyStartNode() || pNext->FindFlyStartNode() ))
             {
-                return ::IsFrameBehind( *static_cast<const SwTxtNode*>(pNext), nCntnt,
-                                        *static_cast<const SwTxtNode*>(pFirst), nCntnt );
+                return ::IsFrameBehind( *pNext->GetTxtNode(), nCntnt, *pFirst->GetTxtNode(), nCntnt );
             }
             return pFirstStt->GetIndex() < pNextStt->GetIndex();
         }
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 2e45d54..294f4d2 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -294,7 +294,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline,
                     OUString sTitle( xDocProps->getTitle() );
                     if (!sTitle.isEmpty())
                         sTitle += ": ";
-                    sTitle += static_cast<SwTxtNode*>(pStartNd)->GetExpandTxt();
+                    sTitle += pStartNd->GetTxtNode()->GetExpandTxt();
                     xDocProps->setTitle( sTitle );
 
                     // Replace template
@@ -398,7 +398,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline,
 
                         // set the link in the StartNode
                         SwFmtINetFmt aINet( sFileName , OUString() );
-                        SwTxtNode* pTNd = static_cast<SwTxtNode*>(pStartNd);
+                        SwTxtNode* pTNd = pStartNd->GetTxtNode();
                         pTNd->InsertItem(aINet, 0, pTNd->GetTxt().getLength());
 
                         // If the link cannot be found anymore,
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 3915fa8..ebd6f46 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -437,7 +437,7 @@ bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
     SwNode* pSrch = &aSttRg.GetNode();
 
    if( pSrch->IsTxtNode())
-        nOutLineLevel = static_cast<sal_uInt8>(static_cast<SwTxtNode*>(pSrch)->GetAttrOutlineLevel()-1);
+        nOutLineLevel = static_cast<sal_uInt8>(pSrch->GetTxtNode()->GetAttrOutlineLevel()-1);
     SwNode* pEndSrch = &aEndRg.GetNode();
     if( !GetNodes().GetOutLineNds().Seek_Entry( pSrch, &nAktPos ) )
     {
@@ -459,7 +459,7 @@ bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
     if( GetNodes().GetOutLineNds().Seek_Entry( pEndSrch, &nTmpPos ) )
     {
         if( !pEndSrch->IsTxtNode() || pEndSrch == pSrch ||
-            nOutLineLevel < static_cast<SwTxtNode*>(pEndSrch)->GetAttrOutlineLevel()-1 )
+            nOutLineLevel < pEndSrch->GetTxtNode()->GetAttrOutlineLevel()-1 )
             ++nTmpPos; // For sub outlines only!
     }
 
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 4ee3d92..62b1f7d 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1045,7 +1045,7 @@ void SwRangeRedline::InvalidateRange()       // trigger the Layout
 
         if (pNode && pNode->IsTxtNode())
         {
-            SwTxtNode* pNd = static_cast< SwTxtNode* >(pNode);
+            SwTxtNode* pNd = pNode->GetTxtNode();
             SwUpdateAttr aHt(
                 n == nSttNd ? nSttCnt : 0,
                 n == nEndNd ? nEndCnt : pNd->GetTxt().getLength(),
@@ -1123,11 +1123,10 @@ void SwRangeRedline::MoveToSection()
         if( pCSttNd || pCEndNd )
         {
             SwTxtFmtColl* pColl = (pCSttNd && pCSttNd->IsTxtNode() )
-                                    ? static_cast<SwTxtNode*>(pCSttNd)->GetTxtColl()
+                                    ? pCSttNd->GetTxtNode()->GetTxtColl()
                                     : (pCEndNd && pCEndNd->IsTxtNode() )
-                                        ? static_cast<SwTxtNode*>(pCEndNd)->GetTxtColl()
-                                        : pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool(
-                                                RES_POOLCOLL_STANDARD );
+                                        ? pCEndNd->GetTxtNode()->GetTxtColl()
+                                        : pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
 
             pSttNd = rNds.MakeTextSection( SwNodeIndex( rNds.GetEndOfRedlines() ),
                                             SwNormalStartNode, pColl );
@@ -1193,9 +1192,8 @@ void SwRangeRedline::CopyToSection()
         if( pCSttNd )
         {
             SwTxtFmtColl* pColl = (pCSttNd && pCSttNd->IsTxtNode() )
-                                    ? static_cast<SwTxtNode*>(pCSttNd)->GetTxtColl()
-                                    : pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool(
-                                                RES_POOLCOLL_STANDARD );
+                                    ? pCSttNd->GetTxtNode()->GetTxtColl()
+                                    : pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
 
             pSttNd = rNds.MakeTextSection( SwNodeIndex( rNds.GetEndOfRedlines() ),
                                             SwNormalStartNode, pColl );
@@ -1213,8 +1211,7 @@ void SwRangeRedline::CopyToSection()
                 if( pDestNd )
                 {
                     if( pDestNd->IsTxtNode() && pCEndNd->IsTxtNode() )
-                        static_cast<SwTxtNode*>(pCEndNd)->CopyCollFmt(
-                                            *static_cast<SwTxtNode*>(pDestNd) );
+                        pCEndNd->GetTxtNode()->CopyCollFmt(*pDestNd->GetTxtNode());
                     else
                         pDestNd->ChgFmtColl( pCEndNd->GetFmtColl() );
                 }
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 7f113a8..9b722e0 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -258,7 +258,7 @@ OUString SwSortBoxElement::GetKey(sal_uInt16 nKey) const
             const SwNode *pNd = 0, *pEndNd = pMyBox->GetSttNd()->EndOfSectionNode();
             for( sal_uLong nIdx = pMyBox->GetSttIdx() + 1; pNd != pEndNd; ++nIdx )
                 if( ( pNd = pDoc->GetNodes()[ nIdx ])->IsTxtNode() )
-                    aRetStr += static_cast<const SwTxtNode*>(pNd)->GetTxt();
+                    aRetStr += pNd->GetTxtNode()->GetTxt();
         }
     }
     return aRetStr;
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index f61083b..bdd3b9c 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -891,7 +891,7 @@ static void lcl_RemoveBreaks(SwCntntNode & rNode, SwTableFmt *const pTableFmt)
         return;
     }
 
-    SwTxtNode & rTxtNode = static_cast<SwTxtNode&>(rNode);
+    SwTxtNode & rTxtNode = *rNode.GetTxtNode();
     // remove PageBreaks/PageDesc/ColBreak
     SfxItemSet const* pSet = rTxtNode.GetpSwAttrSet();
     if (pSet)
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index eab82da2..2103ffd 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1288,7 +1288,7 @@ void SwCntntNode::DelFrms( bool bIsDisposeAccTable )
 
     if( bIsDisposeAccTable && IsTxtNode() )
     {
-        static_cast<SwTxtNode *>(this)->DelFrms_TxtNodePart();
+        GetTxtNode()->DelFrms_TxtNodePart();
     }
 }
 
@@ -1639,8 +1639,7 @@ static bool lcl_CheckMaxLength(SwNode const& rPrev, SwNode const& rNext)
     }
 
     // Check if a node can contain the other (order is not significant)
-    return static_cast<const SwTxtNode&>(rPrev).GetSpaceLeft() >
-           static_cast<const SwTxtNode&>(rNext).Len();
+    return rPrev.GetTxtNode()->GetSpaceLeft() > rNext.GetTxtNode()->Len();
 }
 
 /// Can we join two Nodes?
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index a8f87b9..24da3ef 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -512,8 +512,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
                                     static_cast<SwTxtNode*>(pTmpNd)->RemoveFromList();
 
                                 // remove outline index from old nodes array
-                                if (pCNd->IsTxtNode() &&
-                                    static_cast<SwTxtNode*>(pCNd)->IsOutline())
+                                if (pCNd->IsTxtNode() && pCNd->GetTxtNode()->IsOutline())
                                 {
                                     pOutlineNds->erase( pCNd );
                                 }
@@ -545,8 +544,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
                         {
                             SwNode* pNd = &aMvIdx.GetNode();
 
-                            const bool bOutlNd = pNd->IsTxtNode() &&
-                                static_cast<SwTxtNode*>(pNd)->IsOutline();
+                            const bool bOutlNd = pNd->IsTxtNode() && pNd->GetTxtNode()->IsOutline();
                             // delete outline indices from old node array
                             if( bOutlNd )
                                 pOutlineNds->erase( pNd );
@@ -1127,7 +1125,7 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes)
 
                     if( pNd->IsTxtNode() )
                     {
-                        SwTxtNode *const pTxtNode(static_cast<SwTxtNode*>(pNd));
+                        SwTxtNode *const pTxtNode(pNd->GetTxtNode());
                         if (pTxtNode->IsOutline() &&
                                 pOutlineNds->Seek_Entry( pNd, &nIdxPos ))
                         {
@@ -1384,7 +1382,7 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, sal_uLong nCnt )
         {
             SwNode* pNd = (*this)[ n ];
 
-            if (pNd->IsTxtNode() && static_cast<SwTxtNode*>(pNd)->IsOutline())
+            if (pNd->IsTxtNode() && pNd->GetTxtNode()->IsOutline())
             {
                 // remove the outline indices
                 sal_uInt16 nIdxPos;
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 6a3cc47..92f2569 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -139,7 +139,7 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
                     const sal_Int32 nStt = (n == nSttNd) ? nSttCnt : 0;
                     const sal_Int32 nEnd = (n == nEndNd)
                         ? nEndCnt
-                        : static_cast<SwTxtNode*>(pNd)->GetTxt().getLength();
+                        : pNd->GetTxtNode()->GetTxt().getLength();
 
                     ((SwTxtNode*)pNd)->GetAttr( *pSet, nStt, nEnd,
                                                 false, true,
@@ -270,7 +270,7 @@ SwTxtFmtColl* SwEditShell::GetPaMTxtFmtColl( SwPaM* pPaM ) const
             if( pNd->IsTxtNode() )
             {
                 // if it's a text node get its named paragraph format
-                SwTxtFmtColl* pFmt = static_cast<SwTxtNode*>(pNd)->GetTxtColl();
+                SwTxtFmtColl* pFmt = pNd->GetTxtNode()->GetTxtColl();
 
                 // if the paragraph format exist stop here and return it
                 if( pFmt != NULL )
diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx
index 9632453..3f2f31a 100644
--- a/sw/source/core/edit/edfmt.cxx
+++ b/sw/source/core/edit/edfmt.cxx
@@ -63,7 +63,7 @@ void SwEditShell::FillByEx(SwCharFmt* pCharFmt, bool bReset)
     const SwCntntNode* pCNd = pPam->GetCntntNode();
     if( pCNd->IsTxtNode() )
     {
-        SwTxtNode const*const pTxtNode(static_cast<SwTxtNode const*>(pCNd));
+        SwTxtNode const*const pTxtNode(pCNd->GetTxtNode());
         sal_Int32 nStt;
         sal_Int32 nEnd;
         if( pPam->HasMark() )
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index f9df512..a73b37b 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -763,7 +763,7 @@ void SwEditShell::SetNumberingRestart()
 
                             // get the node num
                             // OD 2005-11-09
-                            SwTxtNode* pTxtNd( static_cast<SwTxtNode*>(pNd) );
+                            SwTxtNode* pTxtNd( pNd->GetTxtNode() );
                             SwNumRule* pNumRule( pTxtNd->GetNumRule() );
 
                             bool bIsNodeNum =
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index d394165..a9e174e 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1920,8 +1920,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
 
             // 1. Check if the whole paragraph is hidden
             // 2. Check for hidden text attribute
-            if ( static_cast<const SwTxtNode&>(rTNd).IsHidden() ||
-                 mrSh.SelectHiddenRange() )
+            if ( rTNd.GetTxtNode()->IsHidden() || mrSh.SelectHiddenRange() )
                 continue;
 
             SwCrsrSaveState aSaveState( *mrSh._GetCrsr() );
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 794c46e..50b576b 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -568,7 +568,7 @@ OUString SwTOXPara::GetURL() const
     case nsSwTOXElement::TOX_TEMPLATE:
     case nsSwTOXElement::TOX_OUTLINELEVEL:
         {
-            const SwTxtNode * pTxtNd = static_cast<const SwTxtNode *>(pNd);
+            const SwTxtNode * pTxtNd = pNd->GetTxtNode();
 
             SwDoc* pDoc = const_cast<SwDoc*>( pTxtNd->GetDoc() );
             ::sw::mark::IMark const * const pMark = pDoc->getIDocumentMarkAccess()->getMarkForTxtNode(
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index a8429e8..6ccd46d 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -853,8 +853,7 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
             // area: use TextNode
             for ( it = m_Array.begin(); it != m_Array.end(); ++it )
             {
-                static_cast<SwTxtNode*>(pCntntNd)->
-                    DeleteAttributes( *it, m_nStart, m_nEnd );
+                pCntntNd->GetTxtNode()-> DeleteAttributes( *it, m_nStart, m_nEnd );
             }
         }
     }
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index a4f0e21..497d48b 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -472,8 +472,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
             (FLY_AT_CHAR == rAnchor.GetAnchorId()))
         {
             aPos.nContent.Assign( (SwTxtNode*)pNd, rAnchor.GetPageNum() );
-            if ( aPos.nContent.GetIndex() >
-                    static_cast<SwTxtNode*>(pNd)->GetTxt().getLength())
+            if ( aPos.nContent.GetIndex() > pNd->GetTxtNode()->GetTxt().getLength())
             {
                 // #i35443# - invalid position.
                 // Thus, anchor attribute not restored
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 13a0c12..4321e99 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -114,7 +114,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
         SwCntntNode* pCNd = aAnchor.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
         OSL_ENSURE( pCNd->IsTxtNode(), "no Text Node at position." );
         SwFmtFlyCnt aFmt( pFrmFmt );
-        static_cast<SwTxtNode*>(pCNd)->InsertItem( aFmt, nCntPos, nCntPos );
+        pCNd->GetTxtNode()->InsertItem( aFmt, nCntPos, nCntPos );
     }
 
     pFrmFmt->MakeFrms();
@@ -506,13 +506,13 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
             if ((FLY_AS_CHAR == nAnchorTyp) ||
                 (FLY_AT_CHAR == nAnchorTyp))
             {
-                if (nCntnt > static_cast<SwTxtNode*>(pNd)->GetTxt().getLength())
+                if (nCntnt > pNd->GetTxtNode()->GetTxt().getLength())
                 {
                     pNd = 0;    // invalid position
                 }
                 else
                 {
-                    aPos.nContent.Assign(static_cast<SwTxtNode*>(pNd), nCntnt);
+                    aPos.nContent.Assign(pNd->GetTxtNode(), nCntnt);
                 }
             }
             if ( pNd )
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index cd9c856..c1bccf5 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -72,7 +72,7 @@ OUString * SwUndoInsert::GetTxtFromDoc() const
 
     if( pCNd->IsTxtNode() )
     {
-        OUString sTxt = static_cast<SwTxtNode*>(pCNd)->GetTxt();
+        OUString sTxt = pCNd->GetTxtNode()->GetTxt();
 
         sal_Int32 nStart = nCntnt-nLen;
         sal_Int32 nLength = nLen;
@@ -406,7 +406,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
         }
         else
         {
-            OUString const aTxt( static_cast<SwTxtNode*>(pCNd)->GetTxt() );
+            OUString const aTxt( pCNd->GetTxtNode()->GetTxt() );
             ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
             rDoc.getIDocumentContentOperations().InsertString( rContext.GetRepeatPaM(),
                 aTxt.copy(nCntnt - nLen, nLen) );
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index adc6bd0..4a465a2 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -381,9 +381,8 @@ void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam,
                         ? rStart.nContent.GetIndex() : 0;
                     const sal_Int32 nEnd   = (n == nEndNd)
                         ? rEnd.nContent.GetIndex()
-                        : static_cast<SwTxtNode*>(pNd)->GetTxt().getLength();
-                    static_cast<SwTxtNode*>(pNd)->GetAttr(
-                        *pSet, nStart, nEnd, bOnlyTxtAttr, bGetFromChrFmt);
+                        : pNd->GetTxtNode()->GetTxt().getLength();
+                    pNd->GetTxtNode()->GetAttr(*pSet, nStart, nEnd, bOnlyTxtAttr, bGetFromChrFmt);
                 }
                 break;
 
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index f691432..a7dc475 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1655,7 +1655,7 @@ bool DocxSdrExport::checkFrameBtlr(SwNode* pStartNode, sax_fastparser::FastAttri
     if (!pStartNode->IsTxtNode())
         return false;
 
-    SwTxtNode* pTxtNode = static_cast<SwTxtNode*>(pStartNode);
+    SwTxtNode* pTxtNode = pStartNode->GetTxtNode();
 
     const SfxPoolItem* pItem = 0; // explicitly init to avoid warnings
     bool bItemSet = false;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d264ce4..61e4b09 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1549,7 +1549,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFmtAttr(const SwPosition& rPos,
             {
                 const sal_Int32 nPos = rPos.nContent.GetIndex();
                 SfxItemSet aSet(pDoc->GetAttrPool(), nWhich, nWhich);
-                if (static_cast<const SwTxtNode*>(pNd)->GetAttr(aSet, nPos, nPos))
+                if (pNd->GetTxtNode()->GetAttr(aSet, nPos, nPos))
                     pItem = aSet.GetItem(nWhich);
             }
 


More information about the Libreoffice-commits mailing list