incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1391367 - /incubator/ooo/trunk/main/sw/source/core/txtnode/ndtxt.cxx
Date Fri, 28 Sep 2012 08:48:06 GMT
Author: orw
Date: Fri Sep 28 08:48:06 2012
New Revision: 1391367

URL: http://svn.apache.org/viewvc?rev=1391367&view=rev
Log:
avoid assignments in if-conditions

Modified:
    incubator/ooo/trunk/main/sw/source/core/txtnode/ndtxt.cxx

Modified: incubator/ooo/trunk/main/sw/source/core/txtnode/ndtxt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/txtnode/ndtxt.cxx?rev=1391367&r1=1391366&r2=1391367&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/txtnode/ndtxt.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/txtnode/ndtxt.cxx Fri Sep 28 08:48:06 2012
@@ -5080,17 +5080,22 @@ SwTxtNode::MakeUnoObject()
 //Bug 120881:Modify here for Directly Page Numbering
 bool SwTxtNode::HasPageNumberField()
 {
-	xub_StrLen nEnd = Len();
-	for(xub_StrLen nStart=0;nStart<nEnd;nStart++)
-	{
-		SwTxtFld* pFld = GetTxtFld(nStart);
-		const SwField* pSwField = NULL;
-		const SwFieldType* pType = NULL;
-		if (pFld && (pSwField=pFld->GetFld().GetFld()) && 
-			(pType=pSwField->GetTyp()) && pType->Which()==RES_PAGENUMBERFLD)
-			return true;
-	}
-	return false;
+    xub_StrLen nEnd = Len();
+    for(xub_StrLen nStart=0;nStart<nEnd;nStart++)
+    {
+        SwTxtFld* pFld = GetTxtFld(nStart);
+        const SwField* pSwField = pFld
+            ? pFld->GetFld().GetFld()
+            : NULL;
+        const SwFieldType* pType = pSwField
+            ? pSwField->GetTyp()
+            : NULL;
+        if ( pType && pType->Which() == RES_PAGENUMBERFLD )
+        {
+            return true;
+        }
+    }
+    return false;
 
 }
 //Bug 120881(End)



Mime
View raw message