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

Michael Stahl mstahl at redhat.com
Wed Jun 26 08:20:00 PDT 2013


 sw/source/core/doc/docfmt.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 19694e844942d44d2c2d5e1d1b95b49d03916573
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 26 14:52:18 2013 +0200

    SetFmtItemByAutoFmt/SetTxtFmtCollByAutoFmt called with SwTxtNode
    
    ... always so don't need to check for it.
    
    Change-Id: I4bbc2a44a9c3d4ebde766a64a6ab78f7ead9c7af

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index c94b913..18bad13 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2411,8 +2411,9 @@ void SwDoc::SetTxtFmtCollByAutoFmt( const SwPosition& rPos, sal_uInt16 nPoolId,
 {
     SwPaM aPam( rPos );
     SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode();
+    assert(pTNd);
 
-    if( mbIsAutoFmtRedline && pTNd )
+    if (mbIsAutoFmtRedline)
     {
         // create the redline object
         const SwTxtFmtColl& rColl = *pTNd->GetTxtColl();
@@ -2442,7 +2443,7 @@ void SwDoc::SetTxtFmtCollByAutoFmt( const SwPosition& rPos, sal_uInt16 nPoolId,
 
     SetTxtFmtColl( aPam, GetTxtCollFromPool( nPoolId ) );
 
-    if( pSet && pTNd && pSet->Count() )
+    if (pSet && pSet->Count())
     {
         aPam.SetMark();
         aPam.GetMark()->nContent.Assign(pTNd, pTNd->GetTxt().getLength());
@@ -2453,10 +2454,11 @@ void SwDoc::SetTxtFmtCollByAutoFmt( const SwPosition& rPos, sal_uInt16 nPoolId,
 void SwDoc::SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& rSet )
 {
     SwTxtNode* pTNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode();
+    assert(pTNd);
 
     RedlineMode_t eOld = GetRedlineMode();
 
-    if( mbIsAutoFmtRedline && pTNd )
+    if (mbIsAutoFmtRedline)
     {
         // create the redline object
         SwRedline* pRedl = new SwRedline( nsRedlineType_t::REDLINE_FORMAT, rPam );


More information about the Libreoffice-commits mailing list