1. mst
  2. ooo340

Commits

hjs  committed 71d204c

CWS-TOOLING: integrate CWS sw31bf09_DEV300
2009-03-18 12:46:54 +0100 od r269652 : #i100277# Assure that under all circumstances paragraph styles, whose
parent paragraph style is assigned to a list level of the outline style,
does not inherit the outline level attribute.

  • Participants
  • Parent commits 01ace29
  • Branches default

Comments (0)

Files changed (2)

File sw/source/core/doc/fmtcol.cxx

View file
 
 void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
 {
-
 	mbAssignedToOutlineStyle = true;
 	SetAttrOutlineLevel(nAssignedListLevel+1);
+
+    // --> OD 2009-03-18 #i100277#
+    SwClientIter aIter( *this );
+    SwTxtFmtColl* pDerivedTxtFmtColl =
+                dynamic_cast<SwTxtFmtColl*>(aIter.First( TYPE( SwTxtFmtColl ) ));
+    while ( pDerivedTxtFmtColl != 0 )
+    {
+        if ( !pDerivedTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
+        {
+            if ( pDerivedTxtFmtColl->GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_DEFAULT )
+            {
+                SwNumRuleItem aItem(aEmptyStr);
+                pDerivedTxtFmtColl->SetFmtAttr( aItem );
+            }
+            if ( pDerivedTxtFmtColl->GetItemState( RES_PARATR_OUTLINELEVEL, FALSE ) == SFX_ITEM_DEFAULT )
+            {
+                pDerivedTxtFmtColl->SetAttrOutlineLevel( 0 );
+            }
+        }
+
+        pDerivedTxtFmtColl = dynamic_cast<SwTxtFmtColl*>(aIter.Next());
+    }
+    // <--
 }
 
 void SwTxtFmtColl::DeleteAssignmentToListLevelOfOutlineStyle()

File sw/source/ui/misc/outline.cxx

View file
         }
     }
 
-	//#outline level,add by zhaojianwei
-	/* When a paragraph style is assigned to a list level of the outline style,
-	   the outline level attribute and the list style attribute of its existing
-	   child paragraph styles have to be set to 0 respectively "".*/
-	nCount = rWrtSh.GetTxtFmtCollCount();
-	for( i = 0; i < nCount; ++i )
-	{
-		SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
-		if( !rTxtColl.IsDefault() )
-		{
-			SwTxtFmtColl *pDerFrom = ( SwTxtFmtColl* )rTxtColl.DerivedFrom();
-			if( pDerFrom->IsAssignedToListLevelOfOutlineStyle())
-			{
-				if(rTxtColl.GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_DEFAULT )
-				{
-					SwNumRuleItem aItem(aEmptyStr);
-					rTxtColl.SetFmtAttr( aItem );
-				}
-				if(rTxtColl.GetItemState( RES_PARATR_OUTLINELEVEL, FALSE ) == SFX_ITEM_DEFAULT )
-				{
-					int nOutlineLevel = 0;;
-					rTxtColl.SetAttrOutlineLevel( nOutlineLevel );
-				}
-			}
-		}
-	}
-	//<-end,zhaojianwei
-
 	rWrtSh.SetOutlineNumRule( *pNumRule);
 
     // --> OD 2006-12-11 #130443#