INTEGRATION: CWS swlists01 (1.74.144); FILE MERGED 2008/06/02 13:48:38 od 1.74.144.14: #i86732# correction on handling of reset of list style 2008/05/29 09:46:06 od 1.74.144.13: #i86732# method <HandleModifyAtTxtNode(..)> 	 - apply outline level as list level, if list style changes to 	   the outline style. 2008/05/27 13:39:53 od 1.74.144.12: #i71360# improvement for better performance 2008/05/26 12:04:31 od 1.74.144.11: #i86732# optimization due to bad performance of method 	 <SWTxtNode::_ChgTxtCollUpdateNum(..)> 2008/05/14 12:57:13 od 1.74.144.10: #i86732# remove no longer needed code 2008/05/14 10:54:45 od 1.74.144.9: #i86732# further changes/adjustments for new list handling 2008/05/09 07:13:29 od 1.74.144.8: #i86732# correction due to compiler warning 2008/05/08 16:33:02 od 1.74.144.7: RESYNC: (1.78-1.82); FILE MERGED 2008/05/07 07:46:58 od 1.74.144.6: #i86732# further changes/adjustments for new list handling 2008/04/16 08:51:15 od 1.74.144.5: #i86732# further changes/adjustments for new list handling 2008/03/20 16:34:15 od 1.74.144.4: correction of merge conflict solution 2008/03/20 14:24:48 od 1.74.144.3: RESYNC: (1.74-1.78); FILE MERGED 2008/03/20 08:27:10 od 1.74.144.2: #i86732# changes due to lists 2008/03/06 10:08:20 od 1.74.144.1: #i86732# class <SwTxtNode> 	 - refactoring due to new paragraph list attributes 	 - refactoring due to revised <SwTxtNode> interface 	 - refactoring due to revised <SwFmt> interface

--- sw/source/core/txtnode/ndtxt.cxx
+++ sw/source/core/txtnode/ndtxt.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ndtxt.cxx,v $
- * $Revision: 1.82 $
+ * $Revision: 1.83 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -96,6 +96,11 @@

 #include <swtable.hxx>
 #include <docsh.hxx>
+#include <SwNodeNum.hxx>
+// --> OD 2008-02-25 #refactorlists#
+#include <svtools/intitem.hxx>
+#include <list.hxx>
+// <--

 SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0, 4 )

@@ -222,36 +227,29 @@
                       const SfxItemSet* pAutoAttr )
     : SwCntntNode( rWhere, ND_TEXTNODE, pTxtColl ),
       pSwpHints( 0 ),
-      // --> OD 2005-11-02 #i51089 - TUNING#
-      mpNodeNum( 0L ),
-      // <--
-      bCounted( true ),
+      mpNodeNum( 0 ),
       bNotifiable( false ),
       bLastOutlineState( FALSE ),
-      nOutlineLevel( pTxtColl->GetOutlineLevel() )
-{
-    // --> OD 2005-11-02 #i51089 - TUNING#
-//    aNdNum.SetTxtNode(this);
-    // <--
-
+      nOutlineLevel( pTxtColl->GetOutlineLevel() ),
+      // --> OD 2008-05-06 #refactorlists#
+      mbInSetOrResetAttr( false ),
+      mpList( 0 )
+      // <--
+{
     InitSwParaStatistics( true );

     // soll eine Harte-Attributierung gesetzt werden?
     if( pAutoAttr )
-        SwCntntNode::SetAttr( *pAutoAttr );
-
-    SyncNumberAndNumRule();
+        SetAttr( *pAutoAttr );
+
+    // --> OD 2008-03-13 #refactorlists# - no longed needed
+//    SyncNumberAndNumRule();
+    if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 )
+    {
+        AddToList();
+    }
+    // <--
     GetNodes().UpdateOutlineNode(*this);
-
-    if( GetNodes().IsDocNodes())
-    {
-        SwNumRule* pRule = _GetNumRule();
-        if( pRule )
-        {
-            pRule->SetInvalidRule( TRUE );
-            bCounted = true;
-        }
-    }

     bNotifiable = true;

@@ -277,26 +275,14 @@
         delete pTmpHints;
     }

-    // --> OD 2005-11-02 #i51089 - TUNING#
-//    aNdNum.RemoveMe();
-//    aNdNum.SetTxtNode(NULL);
-    // <--
-
-    // --> FME 2004-11-02 #114798# Force the deletion of the pList member
-    // of the num rule, otherwise this may still be contained in pList.
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
-    if ( pRule )
-        pRule->SetInvalidRule( TRUE );
-    // <--
-
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    if ( mpNodeNum )
-    {
-        mpNodeNum->RemoveMe();
-        delete mpNodeNum;
-        mpNodeNum = 0L;
-    }
+    // --> OD 2008-03-13 #refactorlists#
+//    if ( mpNodeNum )
+//    {
+//        mpNodeNum->RemoveMe();
+//        delete mpNodeNum;
+//        mpNodeNum = 0L;
+//    }
+    RemoveFromList();
     // <--

     InitSwParaStatistics( false );
@@ -338,10 +324,6 @@
                 {
                     SwClientIter aNew( rNode );
                     pFrm = (SwCntntFrm*)aNew.First( TYPE(SwCntntFrm) );
-//JP 11.07.00: the assert's shows incorrect an error when nodes are converted
-//              to a table. Then no layout exist!
-//                  ASSERT( pFrm, "lcl_ChangeFtnRef: No TxtFrm" );
-//                  ASSERT( pFrm && !aNew.Next(),"lcl_ChangeFtnRef: Doublefault");
                     if( !pFrm )
                         return;
                 }
@@ -400,48 +382,26 @@
 SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
 {
     // lege den Node "vor" mir an
-    xub_StrLen nSplitPos = rPos.nContent.GetIndex(),
-                    nTxtLen = aText.Len();
-    // --> OD 2005-10-17 #i55459#
-    // Method <_MakeNewTxtNode(..)> may modify <IsCounted> attribute of <this>.
-    // Thus, remember its state before calling this method and set this state
-    // at the newly created text node.
-    const bool bIsCounted( IsCounted() );
-    // <--
-    // --> OD 2006-04-26 #i64660#
-    // Method <_MakeNewTxtNode(..)> may modify <GetLevel()> attribute of <this>.
-    // Thus, remember its value before calling this method and set this value
-    // at the newly created text node, if needed.
-    const int nLevel( GetLevel() );
-    // <--
-    // --> OD 2007-07-09 #i77372# - complete fixes i55459 and i64660
-    // keep all numbering attributes before calling <_MakeNewTxtNode>
-    const SwNumRule* pRule( GetNumRule() );
-    const bool bIsRestart( IsRestart() );
-    const SwNodeNum::tSwNumTreeNumber nRestartVal( GetStart() );
-    // <--
-
+    xub_StrLen nSplitPos = rPos.nContent.GetIndex();
+    xub_StrLen nTxtLen = aText.Len();
     SwTxtNode* pNode = _MakeNewTxtNode( rPos.nNode, FALSE, nSplitPos==nTxtLen );

-    // --> OD 2007-07-09 #i77372# - restore all numbering attributes at new text node
-    if ( pRule != NULL && pRule == pNode->GetNumRule() )
-    {
-        pNode->SetLevel( nLevel );
-        pNode->SetRestart( bIsRestart );
-        pNode->SetStart( nRestartVal );
-        pNode->SetCounted( bIsCounted );
-    }
-    // <--
-
-    //pNode->SetOutlineLevel(GetOutlineLevel());
-
-    // --> OD 2007-07-09 #i77372#
-    // reset numbering attribute at current node, only if it is numbered.
-    if ( GetNumRule() != NULL )
-    {
-        SetRestart(false);
-        SetStart(1);
-        SetCounted(true);
+    // --> OD 2008-03-27 #refactorlists#
+//    // --> OD 2007-07-09 #i77372#
+//    // reset numbering attribute at current node, only if it is numbered.
+//    if ( GetNumRule() != NULL )
+//    {
+//        SetRestart(false);
+//        SetStart(1);
+//        SetCounted(true);
+//    }
+    ResetAttr( RES_PARATR_LIST_ISRESTART );
+    ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
+    ResetAttr( RES_PARATR_LIST_ISCOUNTED );
+    if ( GetNumRule() == 0 )
+    {
+        ResetAttr( RES_PARATR_LIST_ID );
+        ResetAttr( RES_PARATR_LIST_LEVEL );
     }
     // <--

@@ -653,7 +613,7 @@
             break;

         if( !pHt->IsDontMoveAttr() &&
-            SwCntntNode::SetAttr( pHt->GetAttr() ) )
+            SetAttr( pHt->GetAttr() ) )
         {
             pSwpHints->DeleteAtPos(i);
             DestroyAttr( pHt );
@@ -1083,37 +1043,6 @@
     aTmpIdxReg.MoveTo( *this );
 }

-SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
-{
-    ASSERT( pNewColl,"ChgFmtColl: Collectionpointer ist 0." );
-    ASSERT( HAS_BASE( SwTxtFmtColl, pNewColl ),
-                "ChgFmtColl: ist kein Text-Collectionpointer." );
-
-    SwTxtFmtColl *pOldColl = GetTxtColl();
-    if( pNewColl != pOldColl )
-    {
-        SetCalcHiddenCharFlags();
-        SwCntntNode::ChgFmtColl( pNewColl );
-        NumRuleChgd();
-    }
-
-    SwTxtFmtColl * pNewTxtColl = static_cast<SwTxtFmtColl *>(pNewColl);
-
-    // nur wenn im normalen Nodes-Array
-    if( GetNodes().IsDocNodes() )
-        _ChgTxtCollUpdateNum( pOldColl, pNewTxtColl);
-
-    BYTE nNewLevel = pNewTxtColl->GetOutlineLevel();
-
-    if ( nNewLevel != NO_NUMBERING)
-        SetLevel(nNewLevel);
-
-    //SetOutlineLevel(nNewLevel);
-    GetNodes().UpdateOutlineNode(*this);
-
-    return pOldColl;
-}
-
 void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
                                         const SwTxtFmtColl *pNewColl)
 {
@@ -1124,12 +1053,9 @@
     const BYTE nOldLevel = pOldColl ? pOldColl->GetOutlineLevel():NO_NUMBERING;
     const BYTE nNewLevel = pNewColl ? pNewColl->GetOutlineLevel():NO_NUMBERING;

-    SyncNumberAndNumRule();
-
-    if (NO_NUMBERING != nNewLevel)
-    {
-        SetLevel(nNewLevel);
-        //SetOutlineLevel(nNewLevel);
+    if ( NO_NUMBERING != nNewLevel )
+    {
+        SetAttrListLevel(nNewLevel);
     }

     {
@@ -2095,9 +2021,9 @@

     // Frames benachrichtigen;
     SwInsTxt aInsHint( nDestStart, nLen );
-    pDest->SwCntntNode::Modify( 0, &aInsHint );
+    pDest->Modify( 0, &aInsHint );
     SwDelTxt aDelHint( nTxtStartIdx, nLen );
-    SwCntntNode::Modify( 0, &aDelHint );
+    Modify( 0, &aDelHint );
 }

@@ -2257,7 +2183,6 @@
 {
     SwNumRule* pRet = 0;

-    // --> OD 2005-11-01 #TUNING#
     const SfxPoolItem* pItem = GetNoCondAttr( RES_PARATR_NUMRULE, bInParent );
     bool bNoNumRule = false;
     if ( pItem )
@@ -2385,26 +2310,22 @@
 {
     SwNumRule * pRet = _GetNumRule(bInParent);

-    if (pRet && GetLevel() == -1)
-    {
-        ASSERT(FALSE, "Node with numrule but without number?");
-    }
-
     return pRet;
 }

-SwNumRule * SwTxtNode::GetNumRuleSync(BOOL)
-{
-    SwNumRule * pRet = _GetNumRule();
-
-    if (pRet && GetLevel() == -1)
-        SyncNumberAndNumRule();
-
-    return pRet;
-}
-
 void SwTxtNode::NumRuleChgd()
 {
+    // --> OD 2008-04-04 #refactorlists#
+    if ( IsInList() )
+    {
+        SwNumRule* pNumRule = GetNumRule();
+        if ( pNumRule && pNumRule != GetNum()->GetNumRule() )
+        {
+            mpNodeNum->ChangeNumRule( *pNumRule );
+        }
+    }
+    // <--
+
     if( IsInCache() )
     {
         SwFrm::GetCache().Delete( this );
@@ -2422,27 +2343,27 @@
 {
     BOOL bResult = FALSE;

-    // --> OD 2005-11-02 #i51089 - TUNING#
     SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
-    // <--
-    if ( pRule && IsCounted() )
+    if ( pRule && IsCountedInList() )
         bResult = TRUE;

     return bResult;
 }

-BOOL SwTxtNode::HasMarkedLabel() const
-{
-    BOOL bResult = FALSE;
-
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    SwNumRule* pNumRule = GetNum() ? GetNum()->GetNumRule() : 0L;
-    if ( pNumRule )
-        bResult = pNumRule->IsLevelMarked( static_cast<BYTE>(GetNum()->GetLevel()) );
-    // <--
+// --> OD 2008-04-02 #refactorlists#
+bool SwTxtNode::HasMarkedLabel() const
+{
+    bool bResult = false;
+
+    if ( IsInList() )
+    {
+        bResult =
+            GetDoc()->getListByName( GetListId() )->IsListLevelMarked( GetActualListLevel() );
+    }

     return bResult;
 }
+// <--
 // <- #i27615#

 SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, BOOL bNext,
@@ -2535,13 +2456,11 @@
     const SwNumRule* pRule = GetNumRule();
     if( pRule && pRule == pNode->GetNumRule() && rNds.IsDocNodes() ) // #115901#
     {
-        // Ein SplitNode erzeugt !!immer!! einen neuen Level, NO_NUM
-        // kann nur ueber eine entsprechende Methode erzeugt werden !!
         // --> OD 2005-10-18 #i55459#
         // - correction: parameter <bNext> has to be checked, as it was in the
         //   previous implementation.
-        if ( !bNext && !IsCounted() )
-            SetCounted(true);
+        if ( !bNext && !IsCountedInList() )
+            SetCountedInList(true);
         // <--
     }

@@ -2561,16 +2480,6 @@

     if (pNextColl != pColl)
     {
-        /* -> HB #i47372# */
-        BYTE nLevel = pNextColl->GetOutlineLevel();
-
-        if (nLevel != NO_NUMBERING)
-        {
-            SetLevel(nLevel);
-            //SetOutlineLevel(nLevel);
-        }
-        /* <- HB #i47372# */
-
         // --> OD 2007-07-10 #i75353#
         if ( bClearHardSetNumRuleWhenFmtCollChanges )
         {
@@ -2594,7 +2503,24 @@
     SwNodeIndex aIdx( rPos.nNode, 1 );
     SwTxtNode* pNew = _MakeNewTxtNode( aIdx, TRUE );

-    SyncNumberAndNumRule();
+    // --> OD 2008-05-14 #refactorlists#
+    // reset list attributes at appended text node
+    pNew->ResetAttr( RES_PARATR_LIST_ISRESTART );
+    pNew->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
+    pNew->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
+    if ( pNew->GetNumRule() == 0 )
+    {
+        pNew->ResetAttr( RES_PARATR_LIST_ID );
+        pNew->ResetAttr( RES_PARATR_LIST_LEVEL );
+    }
+    // <--
+    // --> OD 2008-03-13 #refactorlists#
+//    SyncNumberAndNumRule();
+    if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 )
+    {
+        AddToList();
+    }
+    // <--

     if( GetDepends() )
         MakeFrms( *pNew );
@@ -2638,14 +2564,10 @@
 {
     BOOL bResult = FALSE;

-    // --> OD 2005-11-02 #i51089 - TUNING#
     const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
-    // <--
     if ( pRule )
     {
-        // --> OD 2005-11-02 #i51089 - TUNING#
-        SwNumFmt aFmt(pRule->Get( static_cast<USHORT>(GetNum()->GetLevel())));
-        // <--
+        SwNumFmt aFmt(pRule->Get( static_cast<USHORT>(GetActualListLevel())));

         // #i40041#
         bResult = aFmt.IsEnumeration() &&
@@ -2659,14 +2581,10 @@
 {
     BOOL bResult = FALSE;

-    // --> OD 2005-11-02 #i51089 - TUNING#
     const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
-    // <--
     if ( pRule )
     {
-        // --> OD 2005-11-02 #i51089 - TUNING#
-        SwNumFmt aFmt(pRule->Get( static_cast<USHORT>(GetNum()->GetLevel())));
-        // <--
+        SwNumFmt aFmt(pRule->Get( static_cast<USHORT>(GetActualListLevel())));

         bResult = aFmt.IsItemize();
     }
@@ -2679,18 +2597,16 @@
 //i53420 added max outline parameter
 XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, const unsigned int _nRestrictToThisLevel ) const
 {
-    // --> OD 2005-11-02 #i51089 - TUNING#
     const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
     if ( pRule &&
-         GetNum()->IsCounted() &&
-         pRule->Get( static_cast<USHORT>(GetNum()->GetLevel()) ).IsTxtFmt() )
+         IsCountedInList() &&
+         pRule->Get( static_cast<USHORT>(GetActualListLevel()) ).IsTxtFmt() )
     {
         return pRule->MakeNumString( GetNum()->GetNumberVector(),
                                      _bInclPrefixAndSuffixStrings ? TRUE : FALSE,
                                      FALSE,
                                      _nRestrictToThisLevel );
     }
-    // <--

     return aEmptyStr;
 }
@@ -2698,14 +2614,10 @@
 long SwTxtNode::GetLeftMarginWithNum( BOOL bTxtLeft ) const
 {
     long nRet = 0;
-    // --> OD 2005-11-02 #i51089 - TUNING#
     const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
-    // <--
     if( pRule )
     {
-        // --> OD 2005-11-02 #i51089 - TUNING#
-        const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetNum()->GetLevel()));
-        // <--
+        const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel()));
         // --> OD 2008-01-16 #newlistlevelattrs#
         if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
         {
@@ -2746,23 +2658,19 @@

     // --> OD 2005-11-02 #i51089 - TUNING#
     const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
-    // <--
     if ( pRule )
     {
-        if ( IsCounted() )
+        if ( IsCountedInList() )
         {
             // --> OD 2008-01-16 #newlistlevelattrs#
-            const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetNum()->GetLevel()));
+            const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel()));
             if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
             {
-                // --> OD 2005-11-02 #i51089 - TUNING#
-                rFLOffset = pRule->Get( static_cast<USHORT>(GetNum()->GetLevel() )).GetFirstLineOffset();
-                // <--
+                rFLOffset = pRule->Get( static_cast<USHORT>(GetActualListLevel() )).GetFirstLineOffset();

                 if (!getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
                 {
                     SvxLRSpaceItem aItem = GetSwAttrSet().GetLRSpace();
-
                     rFLOffset = rFLOffset + aItem.GetTxtFirstLineOfst();
                 }
             }
@@ -2890,9 +2798,9 @@
         }
     }

-    if ( bWithSpacesForLevel && GetLevel() > 0 )
-    {
-        int nLevel( GetLevel() );
+    if ( bWithSpacesForLevel && GetActualListLevel() > 0 )
+    {
+        int nLevel( GetActualListLevel() );
         while ( nLevel > 0 )
         {
             const sal_Unicode aSpace = ' ';
@@ -3238,6 +3146,141 @@
     SwModify::Modify( 0, &aHint );
 }

+// --> OD 2008-03-27 #refactorlists#
+namespace {
+    // Helper method for special handling of modified attributes at text node.
+    // The following is handled:
+    // (1) on changing the paragraph style - RES_FMT_CHG:
+    // Check, if list style of the text node is changed. If yes, add respectively
+    // remove the text node to the corresponding list.
+    // (2) on changing the attributes - RES_ATTRSET_CHG:
+    // Same as (1).
+    // (3) on changing the list style - RES_PARATR_NUMRULE:
+    // Same as (1).
+    void HandleModifyAtTxtNode( SwTxtNode& rTxtNode,
+                                const SfxPoolItem* pOldValue,
+                                const SfxPoolItem* pNewValue )
+    {
+        const USHORT nWhich = pOldValue ? pOldValue->Which() :
+                              pNewValue ? pNewValue->Which() : 0 ;
+        bool bNumRuleSet = false;
+        bool bParagraphStyleChanged = false;
+        String sNumRule;
+        String sOldNumRule;
+        switch ( nWhich )
+        {
+            case RES_FMT_CHG:
+            {
+                bParagraphStyleChanged = true;
+                if( rTxtNode.GetNodes().IsDocNodes() )
+                {
+                    const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
+                    if ( pNumRuleAtTxtNode )
+                    {
+                        bNumRuleSet = true;
+                        sNumRule = pNumRuleAtTxtNode->GetName();
+                    }
+                    sOldNumRule =
+                        dynamic_cast<const SwFmtChg*>(pOldValue)->pChangedFmt->GetNumRule().GetValue();
+                }
+                break;
+            }
+            case RES_ATTRSET_CHG:
+            {
+                const SfxPoolItem* pItem = 0;
+                if ( dynamic_cast<const SwAttrSetChg*>(pNewValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) ==
+                        SFX_ITEM_SET )
+                {
+                    bNumRuleSet = true;
+                    sNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
+                }
+                if ( dynamic_cast<const SwAttrSetChg*>(pOldValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) ==
+                        SFX_ITEM_SET )
+                {
+                    sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
+                }
+                break;
+            }
+            case RES_PARATR_NUMRULE:
+            {
+                if ( rTxtNode.GetNodes().IsDocNodes() )
+                {
+                    if ( pNewValue )
+                    {
+                        bNumRuleSet = true;
+                        sNumRule = dynamic_cast<const SwNumRuleItem*>(pNewValue)->GetValue();
+                    }
+                    if ( pOldValue )
+                    {
+                        sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pOldValue)->GetValue();
+                    }
+                }
+                break;
+            }
+        }
+        if ( sNumRule != sOldNumRule )
+        {
+            if ( bNumRuleSet )
+            {
+                if ( sNumRule.Len() == 0 )
+                {
+                    rTxtNode.RemoveFromList();
+                    if ( bParagraphStyleChanged )
+                    {
+                        SvUShortsSort aResetAttrsArray;
+                        aResetAttrsArray.Insert( RES_PARATR_LIST_ID );
+                        aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL );
+                        aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART );
+                        aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE );
+                        aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
+                        SwPaM aPam( rTxtNode );
+                        rTxtNode.GetDoc()->ResetAttrs( aPam, sal_True, &aResetAttrsArray );
+                    }
+                }
+                else
+                {
+                    rTxtNode.RemoveFromList();
+                    // If new list style is the outline style, apply outline
+                    // level as the list level.
+                    if ( sNumRule ==
+                            String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ) )
+                    {
+                        int nNewListLevel =
+                                    rTxtNode.GetTxtColl()->GetOutlineLevel();
+                        if ( 0 <= nNewListLevel && nNewListLevel < MAXLEVEL )
+                        {
+                            rTxtNode.SetAttrListLevel( nNewListLevel );
+                        }
+                    }
+                    rTxtNode.AddToList();
+                }
+            }
+            else // <sNumRule.Len() == 0 && sOldNumRule.Len() != 0>
+            {
+                rTxtNode.RemoveFromList();
+                if ( bParagraphStyleChanged )
+                {
+                    SvUShortsSort aResetAttrsArray;
+                    aResetAttrsArray.Insert( RES_PARATR_LIST_ID );
+                    aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL );
+                    aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART );
+                    aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE );
+                    aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
+                    SwPaM aPam( rTxtNode );
+                    rTxtNode.GetDoc()->ResetAttrs( aPam, sal_True, &aResetAttrsArray );
+                }
+            }
+        }
+        else if ( sNumRule.Len() > 0 && !rTxtNode.IsInList() )
+        {
+            rTxtNode.AddToList();
+        }
+        // <--
+    }
+    // End of method <HandleModifyAtTxtNode>
+}
+// <--
+
 void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
 {
     bool bWasNotifiable = bNotifiable;
@@ -3251,11 +3294,18 @@
     if( pOldValue && pNewValue && RES_FMT_CHG == pOldValue->Which() &&
         pRegisteredIn == ((SwFmtChg*)pNewValue)->pChangedFmt &&
         GetNodes().IsDocNodes() )
+    {
         _ChgTxtCollUpdateNum(
                         (SwTxtFmtColl*)((SwFmtChg*)pOldValue)->pChangedFmt,
                         (SwTxtFmtColl*)((SwFmtChg*)pNewValue)->pChangedFmt );
-
-
+    }
+
+    // --> OD 2008-03-27 #refactorlists#
+    if ( !mbInSetOrResetAttr )
+    {
+        HandleModifyAtTxtNode( *this, pOldValue, pNewValue );
+    }
+    // <--

     SwCntntNode::Modify( pOldValue, pNewValue );

@@ -3270,6 +3320,43 @@
     bNotifiable = bWasNotifiable;
 }

+SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
+{
+    ASSERT( pNewColl,"ChgFmtColl: Collectionpointer ist 0." );
+    ASSERT( HAS_BASE( SwTxtFmtColl, pNewColl ),
+                "ChgFmtColl: ist kein Text-Collectionpointer." );
+
+    SwTxtFmtColl *pOldColl = GetTxtColl();
+    if( pNewColl != pOldColl )
+    {
+        SetCalcHiddenCharFlags();
+        SwCntntNode::ChgFmtColl( pNewColl );
+        // --> OD 2008-03-27 #refactorlists#
+//        NumRuleChgd();
+#if OSL_DEBUG_LEVEL > 1
+        ASSERT( !mbInSetOrResetAttr,
+                "DEBUG ASSERTION - <SwTxtNode::ChgFmtColl(..)> called during <Set/ResetAttr(..)>" )
+#endif
+        if ( !mbInSetOrResetAttr )
+        {
+            SwFmtChg aTmp1( pOldColl );
+            SwFmtChg aTmp2( pNewColl );
+            HandleModifyAtTxtNode( *this, &aTmp1, &aTmp2  );
+        }
+        // <--
+    }
+
+    // nur wenn im normalen Nodes-Array
+    if( GetNodes().IsDocNodes() )
+    {
+        _ChgTxtCollUpdateNum( pOldColl, static_cast<SwTxtFmtColl *>(pNewColl) );
+    }
+
+    GetNodes().UpdateOutlineNode(*this);
+
+    return pOldColl;
+}
+
 // #111840#
 SwPosition * SwTxtNode::GetPosition(const SwTxtAttr * pAttr)
 {
@@ -3288,31 +3375,34 @@
     return pResult;
 }

-SwNumberTreeNode::tNumberVector SwTxtNode::GetNumberVector() const
-{
-    // --> OD 2005-11-02 #i51089 - TUNING#
+SwNodeNum* SwTxtNode::CreateNum() const
+{
+    if ( !mpNodeNum )
+    {
+        // --> OD 2008-02-19 #refactorlists#
+        mpNodeNum = new SwNodeNum( const_cast<SwTxtNode*>(this) );
+        // <--
+    }
+    return mpNodeNum;
+}
+
+SwNumberTree::tNumberVector SwTxtNode::GetNumberVector() const
+{
     if ( GetNum() )
     {
         return GetNum()->GetNumberVector();
     }
     else
     {
-        SwNumberTreeNode::tNumberVector aResult;
+        SwNumberTree::tNumberVector aResult;
         return aResult;
     }
-    // <--
 }

 BOOL SwTxtNode::IsOutline() const
 {
     BOOL bResult = FALSE;
-    // --> OD 2005-11-02 #i51089 - TUNING#
-//    const SwNumRule * pRule = _GetNumRule();
-
-//    if ( ( ( pRule && pRule->IsOutlineRule() ) ||
-//           GetOutlineLevel() != NO_NUMBERING ) &&
-//         !IsInRedlines() )
-//        bResult = TRUE;
+
     if ( GetOutlineLevel() != NO_NUMBERING )
     {
         bResult = !IsInRedlines();
@@ -3325,7 +3415,6 @@
             bResult = !IsInRedlines();
         }
     }
-    // <--

     return bResult;
 }
@@ -3356,64 +3445,74 @@
 #endif
 }

-int SwTxtNode::GetLevel() const
-{
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    return GetNum() ? GetNum()->GetLevel() : -1;
-    // <--
-}
-
-void SwTxtNode::SetLevel(int nLevel)
-{
-    if (0 <= nLevel && nLevel < MAXLEVEL)
-    {
-        // --> OD 2005-11-02 #i51089 - TUNING#
-        CreateNum()->SetLevel( nLevel );
-        // <--
+// --> OD 2008-02-27 #refactorlists#
+void SwTxtNode::SetAttrListLevel( int nLevel )
+{
+    if ( nLevel < 0 || nLevel >= MAXLEVEL )
+    {
+        ASSERT( false,
+                "<SwTxtNode::SetAttrListLevel()> - value of parameter <nLevel> is out of valid range" );
+        return;
+    }
+
+    SfxInt16Item aNewListLevelItem( RES_PARATR_LIST_LEVEL,
+                                    static_cast<INT16>(nLevel) );
+    SetAttr( aNewListLevelItem );
+}
+// <--
+// --> OD 2008-02-27 #refactorlists#
+bool SwTxtNode::HasAttrListLevel() const
+{
+    return GetpSwAttrSet() &&
+           GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_LEVEL, FALSE ) == SFX_ITEM_SET;
+}
+// <--
+// --> OD 2008-02-27 #refactorlists#
+int SwTxtNode::GetAttrListLevel() const
+{
+    int nAttrListLevel = 0;
+
+    const SfxInt16Item& aListLevelItem =
+        dynamic_cast<const SfxInt16Item&>(GetAttr( RES_PARATR_LIST_LEVEL ));
+    nAttrListLevel = static_cast<int>(aListLevelItem.GetValue());
+
+    return nAttrListLevel;
+}
+// <--
+
+int SwTxtNode::GetActualListLevel() const
+{
+    return GetNum() ? GetNum()->GetLevelInListTree() : -1;
+}
+
+// --> OD 2008-02-25 #refactorlists#
+void SwTxtNode::SetListRestart( bool bRestart )
+{
+//    CreateNum()->SetRestart(bRestart);
+    if ( !bRestart )
+    {
+        // attribute not contained in paragraph style's attribute set. Thus,
+        // it can be reset to the attribute pool default by resetting the attribute.
+        ResetAttr( RES_PARATR_LIST_ISRESTART );
     }
     else
     {
-        if (0 <= nLevel && (nLevel & NO_NUMLEVEL))
-        {
-            nLevel &= ~NO_NUMLEVEL;
-
-            if (0 <= nLevel && nLevel < NO_NUMLEVEL)
-            {
-                ASSERT(false, "SetLevel(NO_NUMLEVEL) is deprecated");
-
-                SetCounted(false);
-                // --> OD 2005-11-02 #i51089 - TUNING#
-                CreateNum()->SetLevel(nLevel & ~NO_NUMLEVEL);
-                // <--
-            }
-
-        }
-        else if (nLevel == NO_NUMBERING)
-        {
-            ASSERT(false, "SetLevel(NO_NUMBERING) is deprecated");
-
-            SetCounted(false);
-        }
-        else
-        {
-            // --> OD 2005-11-02 #i51089 - TUNING#
-            if ( GetNum() )
-            {
-                mpNodeNum->RemoveMe();
-                delete mpNodeNum;
-                mpNodeNum = 0L;
-            }
-            // <--
-        }
-    }
-}
-
-void SwTxtNode::SetRestart(bool bRestart)
-{
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    CreateNum()->SetRestart(bRestart);
-    // <--
-}
+        SfxBoolItem aNewIsRestartItem( RES_PARATR_LIST_ISRESTART,
+                                       TRUE );
+        SetAttr( aNewIsRestartItem );
+    }
+}
+
+// --> OD 2008-02-25 #refactorlists#
+bool SwTxtNode::IsListRestart() const
+{
+//    return GetNum() ? GetNum()->IsRestart() : false;
+    const SfxBoolItem& aIsRestartItem =
+        dynamic_cast<const SfxBoolItem&>(GetAttr( RES_PARATR_LIST_ISRESTART ));
+
+    return aIsRestartItem.GetValue() ? true : false;
+}
+// <--

 /** Returns if the paragraph has a visible numbering or bullet.
     This includes all kinds of numbering/bullet/outlines.
@@ -3425,12 +3524,12 @@
     bool bRet = false;

     const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
-    if ( pRule && IsCounted())
+    if ( pRule && IsCountedInList())
     {
         // --> OD 2008-03-19 #i87154#
         // Correction of #newlistlevelattrs#:
         // The numbering type has to be checked for bullet lists.
-        const SwNumFmt& rFmt = pRule->Get( static_cast<USHORT>(GetNum()->GetLevel() ));
+        const SwNumFmt& rFmt = pRule->Get( static_cast<USHORT>(GetActualListLevel() ));
         if ( SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType() ||
              pRule->MakeNumString( *(GetNum()) ).Len() > 0 )
         {
@@ -3442,20 +3541,74 @@
     return bRet;
 }

-void SwTxtNode::SetStart(SwNodeNum::tSwNumTreeNumber nNumber)
-{
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    CreateNum()->SetStart(nNumber);
-    // <--
-}
-
-
-SwNodeNum::tSwNumTreeNumber SwTxtNode::GetStart() const
-{
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    return GetNum() ? GetNum()->GetStart() : 1;
-    // <--
-}
+// --> OD 2008-02-25 #refactorlists#
+void SwTxtNode::SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNumber )
+{
+//    CreateNum()->SetStart(nNumber);
+    const bool bChanged( HasAttrListRestartValue()
+                         ? GetAttrListRestartValue() != nNumber
+                         : nNumber != USHRT_MAX );
+
+    if ( bChanged || !HasAttrListRestartValue() )
+    {
+        if ( nNumber == USHRT_MAX )
+        {
+            ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
+        }
+        else
+        {
+            SfxInt16Item aNewListRestartValueItem( RES_PARATR_LIST_RESTARTVALUE,
+                                                   static_cast<INT16>(nNumber) );
+            SetAttr( aNewListRestartValueItem );
+        }
+    }
+}
+// <--
+
+// --> OD 2008-02-27 #refactorlists#
+bool SwTxtNode::HasAttrListRestartValue() const
+{
+    return GetpSwAttrSet() &&
+           GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_RESTARTVALUE, FALSE ) == SFX_ITEM_SET;
+}
+// <--
+SwNumberTree::tSwNumTreeNumber SwTxtNode::GetAttrListRestartValue() const
+{
+    ASSERT( HasAttrListRestartValue(),
+            "<SwTxtNode::GetAttrListRestartValue()> - only ask for list restart value, if attribute is set at text node." );
+
+    const SfxInt16Item& aListRestartValueItem =
+        dynamic_cast<const SfxInt16Item&>(GetAttr( RES_PARATR_LIST_RESTARTVALUE ));
+    return static_cast<SwNumberTree::tSwNumTreeNumber>(aListRestartValueItem.GetValue());
+}
+
+// --> OD 2008-02-25 #refactorlists#
+SwNumberTree::tSwNumTreeNumber SwTxtNode::GetActualListStartValue() const
+{
+//    return GetNum() ? GetNum()->GetStart() : 1;
+    SwNumberTree::tSwNumTreeNumber nListRestartValue = 1;
+
+    if ( IsListRestart() && HasAttrListRestartValue() )
+    {
+        nListRestartValue = GetAttrListRestartValue();
+    }
+    else
+    {
+        SwNumRule* pRule = GetNumRule();
+        if ( pRule )
+        {
+            const SwNumFmt* pFmt =
+                    pRule->GetNumFmt( static_cast<USHORT>(GetAttrListLevel()) );
+            if ( pFmt )
+            {
+                nListRestartValue = pFmt->GetStart();
+            }
+        }
+    }
+
+    return nListRestartValue;
+}
+// <--

 bool SwTxtNode::IsNotifiable() const
 {
@@ -3473,132 +3626,141 @@
     return bResult;
 }

-void SwTxtNode::SetCounted(bool _bCounted)
-{
-    // --> OD 2005-10-19 #126009#
-    // - improvement: invalidations only, if <IsCounted()> state changes.
-    const bool bInvalidate( bCounted != _bCounted );
-    // <--
-    bCounted = _bCounted;
-    // --> OD 2005-10-19 #126009#
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    if ( bInvalidate && GetNum() )
-    {
-        // --> OD 2006-04-26 #i64010# - invalidation and notification of
-        // complete numbering tree needed.
-        mpNodeNum->InvalidateAndNotifyTree();
-//        mpNodeNum->InvalidateMe();
-//        // --> OD 2005-10-19 #126009# - invalidation of children and not counted
-//        // parent needed.
-//        mpNodeNum->InvalidateChildren();
-//        mpNodeNum->InvalidateNotCountedParent();
-//        // <--
-//        // --> OD 2005-10-20 #126009# - notification of not counted parent needed.
-//        mpNodeNum->NotifyNotCountedParentSiblings();
-//        // <--
-//        mpNodeNum->NotifyInvalidSiblings();
-        // <--
-    }
-    // <--
-}
-
-bool SwTxtNode::IsCounted() const
-{
-    return bCounted;
-}
-
-void SwTxtNode::CopyNumber(SwTxtNode & rNode) const
-{
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    if ( GetNum() )
-    {
-        rNode.SetLevel(GetLevel());
-        rNode.SetCounted(IsCounted());
-        if ( rNode.GetNum() )
-        {
-            rNode.mpNodeNum->SetRestart( GetNum()->IsRestart() );
-            rNode.mpNodeNum->SetStart( GetNum()->GetStart() );
-        }
-    }
-    // <--
-}
-
-void SwTxtNode::SyncNumberAndNumRule()
-{
-    SwNumRule* pRule = _GetNumRule();
-
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    if ( pRule && !GetNum() )
-    {
-        CreateNum();
-    }
-    if ( GetNum() &&
-         GetNum()->GetNumRule() != pRule )
-    // <--
-    {
-        // --> OD 2005-10-26 #b6340308# - use outline level in the case that the
-        // new numbering rule is the outline rule.
-        int nLevel = pRule == GetDoc()->GetOutlineNumRule()
-                     ? GetOutlineLevel()
-                     : GetLevel();
-        // <--
-
-        // --> OD 2006-01-12 #i60395#
-        // Consider that <GetOutlineLevel()> could return NO_NUMBERING
-        if ( nLevel < 0 ||
-             nLevel == NO_NUMBERING )
-            nLevel = 0;
-        // <--
-
-        // --> OD 2006-01-12 #i60395#
-        // the valid numbering level range is [0, MAXLEVEL)
-        if (nLevel > MAXLEVEL)
-            nLevel = MAXLEVEL - 1;
-        // <--
-
-        // --> OD 2005-11-02 #i51089 - TUNING#
-        mpNodeNum->RemoveMe();
-        // <--
-
-        if (pRule)
-        {
-            // --> OD 2005-11-02 #i51089 - TUNING#
-            pRule->AddNumber( mpNodeNum, nLevel );
-            // <--
-        }
-        // --> OD 2005-11-03 #i51089 - TUNING#
-        else
-        {
-            delete mpNodeNum;
-            mpNodeNum = 0L;
-        }
-        // <--
-    }
-}
-
-void SwTxtNode::UnregisterNumber()
-{
-    // --> OD 2005-11-02 #i51089 - TUNING#
-    if ( GetNum() )
-    {
-        mpNodeNum->RemoveMe();
+// --> OD 2008-02-27 #refactorlists#
+void SwTxtNode::SetCountedInList( bool bCounted )
+{
+    if ( bCounted )
+    {
+        // attribute not contained in paragraph style's attribute set. Thus,
+        // it can be reset to the attribute pool default by resetting the attribute.
+        ResetAttr( RES_PARATR_LIST_ISCOUNTED );
+    }
+    else
+    {
+        SfxBoolItem aIsCountedInListItem( RES_PARATR_LIST_ISCOUNTED, FALSE );
+        SetAttr( aIsCountedInListItem );
+    }
+}
+// <--
+
+bool SwTxtNode::IsCountedInList() const
+{
+    const SfxBoolItem& aIsCountedInListItem =
+        dynamic_cast<const SfxBoolItem&>(GetAttr( RES_PARATR_LIST_ISCOUNTED ));
+
+    return aIsCountedInListItem.GetValue() ? true : false;
+}
+
+// --> OD 2008-03-13 #refactorlists#
+void SwTxtNode::AddToList()
+{
+    if ( IsInList() )
+    {
+        ASSERT( false,
+                "<SwTxtNode::AddToList()> - the text node is already added to a list. Serious defect -> please inform OD" );
+        return;
+    }
+
+    const String sListId = GetListId();
+    if ( sListId.Len() > 0 )
+    {
+        SwList* pList = GetDoc()->getListByName( sListId );
+        if ( pList == 0 )
+        {
+            // Create corresponding list.
+            SwNumRule* pNumRule = GetNumRule();
+            if ( pNumRule )
+            {
+                pList = GetDoc()->createList( sListId, GetNumRule()->GetName() );
+            }
+        }
+        ASSERT( pList != 0,
+                "<SwTxtNode::AddToList()> - no list for given list id. Serious defect -> please inform OD" );
+        if ( pList )
+        {
+            pList->InsertListItem( *CreateNum(), GetAttrListLevel() );
+            mpList = pList;
+        }
+    }
+}
+
+void SwTxtNode::RemoveFromList()
+{
+    if ( IsInList() )
+    {
+        mpList->RemoveListItem( *mpNodeNum );
+        mpList = 0;
         delete mpNodeNum;
         mpNodeNum = 0L;
     }
-    // <--
-}
+}
+
+bool SwTxtNode::IsInList() const
+{
+    return GetNum() != 0 && GetNum()->GetParent() != 0;
+}
+// <--

 bool SwTxtNode::IsFirstOfNumRule() const
 {
     bool bResult = false;

-    // --> OD 2005-11-02 #i51089 - TUNING#
     if ( GetNum() && GetNum()->GetNumRule())
         bResult = GetNum()->IsFirst();
-    // <--

     return bResult;
 }
+
+// --> OD 2008-02-20 #refactorlists#
+void SwTxtNode::SetListId( const String sListId )
+{
+    const SfxStringItem& rListIdItem =
+            dynamic_cast<const SfxStringItem&>(GetAttr( RES_PARATR_LIST_ID ));
+    if ( rListIdItem.GetValue() != sListId )
+    {
+        if ( sListId.Len() == 0 )
+        {
+            ResetAttr( RES_PARATR_LIST_ID );
+        }
+        else
+        {
+            SfxStringItem aNewListIdItem( RES_PARATR_LIST_ID, sListId );
+            SetAttr( aNewListIdItem );
+        }
+    }
+}
+
+String SwTxtNode::GetListId() const
+{
+    String sListId;
+
+    const SfxStringItem& rListIdItem =
+                dynamic_cast<const SfxStringItem&>(GetAttr( RES_PARATR_LIST_ID ));
+    sListId = rListIdItem.GetValue();
+
+    // As long as no explicit list id attribute is set, use the list id of
+    // the list, which has been created for the applied list style.
+    if ( sListId.Len() == 0 )
+    {
+        SwNumRule* pRule = GetNumRule();
+        if ( pRule )
+        {
+            sListId = pRule->GetDefaultListId();
+//#if OSL_DEBUG_LEVEL > 1
+//            ASSERT( false,
+//                    "DEBUG ASSERTION: default list id of list style is applied." );
+//#endif
+//            // setting list id directly using <SwCntntNode::SetAttr(..)>,
+//            // because no handling of this attribute set is needed and to avoid
+//            // recursive calls of <SwTxtNode::SetAttr(..)>
+//            SfxStringItem aNewListIdItem( RES_PARATR_LIST_ID, sListId );
+//            const_cast<SwTxtNode*>(this)->SwCntntNode::SetAttr( aNewListIdItem );
+        }
+    }
+
+    return sListId;
+}
+// <--

 /** Determines, if the list level indent attributes can be applied to the
     paragraph.
@@ -3689,9 +3851,9 @@
     bool bListTanStopPositionProvided( false );

     const SwNumRule* pNumRule = GetNum() ? GetNum()->GetNumRule() : 0;
-    if ( pNumRule && HasVisibleNumberingOrBullet() && GetLevel() >= 0 )
-    {
-        const SwNumFmt& rFmt = pNumRule->Get( static_cast<USHORT>(GetLevel()) );
+    if ( pNumRule && HasVisibleNumberingOrBullet() && GetActualListLevel() >= 0 )
+    {
+        const SwNumFmt& rFmt = pNumRule->Get( static_cast<USHORT>(GetActualListLevel()) );
         if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT &&
              rFmt.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
         {
@@ -3732,9 +3894,9 @@
     XubString aLabelFollowedBy;

     const SwNumRule* pNumRule = GetNum() ? GetNum()->GetNumRule() : 0;
-    if ( pNumRule && HasVisibleNumberingOrBullet() && GetLevel() >= 0 )
-    {
-        const SwNumFmt& rFmt = pNumRule->Get( static_cast<USHORT>(GetLevel()) );
+    if ( pNumRule && HasVisibleNumberingOrBullet() && GetActualListLevel() >= 0 )
+    {
+        const SwNumFmt& rFmt = pNumRule->Get( static_cast<USHORT>(GetActualListLevel()) );
         if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
         {
             switch ( rFmt.GetLabelFollowedBy() )
@@ -3789,3 +3951,571 @@
     return false;
 }
 // <--
+
+// --> OD 2008-03-13 #refactorlists#
+namespace {
+    // Helper class for special handling of setting attributes at text node:
+    // In constructor an instance of the helper class recognize whose attributes
+    // are set and perform corresponding actions before the intrinsic set of
+    // attributes has been taken place.
+    // In the destructor - after the attributes have been set at the text
+    // node - corresponding actions are performed.
+    // The following is handled:
+    // (1) When the list style attribute - RES_PARATR_NUMRULE - is set,
+    //     (A) list style attribute is empty -> the text node is removed from
+    //         its list.
+    //     (B) list style attribute is not empty
+    //         (a) text node has no list style -> add text node to its list after
+    //             the attributes have been set.
+    //         (b) text node has list style -> change of list style is notified
+    //             after the attributes have been set.
+    // (2) When the list id attribute - RES_PARATR_LIST_ID - is set and changed,
+    //     the text node is removed from its current list before the attributes
+    //     are set and added to its new list after the attributes have been set.
+    // (3) Notify list tree, if list level - RES_PARATR_LIST_LEVEL - is set
+    //     and changed after the attributes have been set
+    // (4) Notify list tree, if list restart - RES_PARATR_LIST_ISRESTART - is set
+    //     and changed after the attributes have been set
+    // (5) Notify list tree, if list restart value - RES_PARATR_LIST_RESTARTVALUE -
+    //     is set and changed after the attributes have been set
+    // (6) Notify list tree, if count in list - RES_PARATR_LIST_ISCOUNTED - is set
+    //     and changed after the attributes have been set
+    class HandleSetAttrAtTxtNode
+    {
+        public:
+            HandleSetAttrAtTxtNode( SwTxtNode& rTxtNode,
+                                    const SfxPoolItem& pItem );
+            HandleSetAttrAtTxtNode( SwTxtNode& rTxtNode,
+                                    const SfxItemSet& rItemSet );
+            ~HandleSetAttrAtTxtNode();
+
+        private:
+            SwTxtNode& mrTxtNode;
+            bool mbAddTxtNodeToList;
+            bool mbUpdateListLevel;
+            bool mbUpdateListRestart;
+            bool mbUpdateListCount;
+    };
+
+    HandleSetAttrAtTxtNode::HandleSetAttrAtTxtNode( SwTxtNode& rTxtNode,
+                                                    const SfxPoolItem& pItem )
+        : mrTxtNode( rTxtNode ),
+          mbAddTxtNodeToList( false ),
+          mbUpdateListLevel( false ),
+          mbUpdateListRestart( false ),
+          mbUpdateListCount( false )
+    {
+        switch ( pItem.Which() )
+        {
+            // handle RES_PARATR_NUMRULE
+            case RES_PARATR_NUMRULE:
+            {
+                mrTxtNode.RemoveFromList();
+
+                const SwNumRuleItem& pNumRuleItem =
+                                dynamic_cast<const SwNumRuleItem&>(pItem);
+                if ( pNumRuleItem.GetValue().Len() > 0 )
+                {
+                    mbAddTxtNodeToList = true;
+                }
+            }
+            break;
+
+            // handle RES_PARATR_LIST_ID
+            case RES_PARATR_LIST_ID:
+            {
+                const SfxStringItem& pListIdItem =
+                                        dynamic_cast<const SfxStringItem&>(pItem);
+                ASSERT( pListIdItem.GetValue().Len() > 0,
+                        "<HandleSetAttrAtTxtNode(..)> - empty list id attribute not excepted. Serious defect -> please inform OD." );
+//                const SfxStringItem& rListIdItemOfTxtNode =
+//                                    dynamic_cast<const SfxStringItem&>(
+//                                        rTxtNode.GetAttr( RES_PARATR_LIST_ID ));
+//                if ( pListIdItem.GetValue() != rListIdItemOfTxtNode.GetValue() )
+                const String sListIdOfTxtNode = rTxtNode.GetListId();
+                if ( pListIdItem.GetValue() != sListIdOfTxtNode )
+                {
+                    mbAddTxtNodeToList = true;
+                    if ( mrTxtNode.IsInList() )
+                    {
+                        mrTxtNode.RemoveFromList();
+                    }
+                }
+            }
+            break;
+
+            // handle RES_PARATR_LIST_LEVEL
+            case RES_PARATR_LIST_LEVEL:
+            {
+                const SfxInt16Item& aListLevelItem =
+                                    dynamic_cast<const SfxInt16Item&>(pItem);
+                if ( aListLevelItem.GetValue() != mrTxtNode.GetAttrListLevel() )
+                {
+                    mbUpdateListLevel = true;
+                }
+            }
+            break;
+
+            // handle RES_PARATR_LIST_ISRESTART
+            case RES_PARATR_LIST_ISRESTART:
+            {
+                const SfxBoolItem& aListIsRestartItem =
+                                    dynamic_cast<const SfxBoolItem&>(pItem);
+                if ( aListIsRestartItem.GetValue() !=
+                                    (mrTxtNode.IsListRestart() ? TRUE : FALSE) )
+                {
+                    mbUpdateListRestart = true;
+                }
+            }
+            break;
+
+            // handle RES_PARATR_LIST_RESTARTVALUE
+            case RES_PARATR_LIST_RESTARTVALUE:
+            {
+                const SfxInt16Item& aListRestartValueItem =
+                                    dynamic_cast<const SfxInt16Item&>(pItem);
+                if ( !mrTxtNode.HasAttrListRestartValue() ||
+                     aListRestartValueItem.GetValue() != mrTxtNode.GetAttrListRestartValue() )
+                {
+                    mbUpdateListRestart = true;
+                }
+            }
+            break;
+
+            // handle RES_PARATR_LIST_ISCOUNTED
+            case RES_PARATR_LIST_ISCOUNTED:
+            {
+                const SfxBoolItem& aIsCountedInListItem =
+                                    dynamic_cast<const SfxBoolItem&>(pItem);
+                if ( aIsCountedInListItem.GetValue() !=
+                                    (mrTxtNode.IsCountedInList() ? TRUE : FALSE) )
+                {
+                    mbUpdateListCount = true;
+                }
+            }
+            break;
+        }
+
+    }
+
+    HandleSetAttrAtTxtNode::HandleSetAttrAtTxtNode( SwTxtNode& rTxtNode,
+                                                    const SfxItemSet& rItemSet )
+        : mrTxtNode( rTxtNode ),
+          mbAddTxtNodeToList( false ),
+          mbUpdateListLevel( false ),
+          mbUpdateListRestart( false ),
+          mbUpdateListCount( false )
+    {
+        const SfxPoolItem* pItem = 0;
+        // handle RES_PARATR_NUMRULE
+        if ( rItemSet.GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) == SFX_ITEM_SET )
+        {
+            mrTxtNode.RemoveFromList();
+
+            const SwNumRuleItem* pNumRuleItem =
+                            dynamic_cast<const SwNumRuleItem*>(pItem);
+            if ( pNumRuleItem->GetValue().Len() > 0 )
+            {
+                mbAddTxtNodeToList = true;
+            }
+        }
+
+        // handle RES_PARATR_LIST_ID
+        if ( rItemSet.GetItemState( RES_PARATR_LIST_ID, FALSE, &pItem ) == SFX_ITEM_SET )
+        {
+            const SfxStringItem* pListIdItem =
+                                    dynamic_cast<const SfxStringItem*>(pItem);
+//            const SfxStringItem& rListIdItemOfTxtNode =
+//                                    dynamic_cast<const SfxStringItem&>(
+//                                        mrTxtNode.GetAttr( RES_PARATR_LIST_ID ));
+//            if ( pListIdItem &&
+//                 pListIdItem->GetValue() != rListIdItemOfTxtNode.GetValue() )
+            const String sListIdOfTxtNode = mrTxtNode.GetListId();
+            if ( pListIdItem &&
+                 pListIdItem->GetValue() != sListIdOfTxtNode )
+            {
+                mbAddTxtNodeToList = true;
+                if ( mrTxtNode.IsInList() )
+                {
+                    mrTxtNode.RemoveFromList();
+                }
+            }
+        }
+
+        // handle RES_PARATR_LIST_LEVEL
+        if ( rItemSet.GetItemState( RES_PARATR_LIST_LEVEL, FALSE, &pItem ) == SFX_ITEM_SET )
+        {
+            const SfxInt16Item* pListLevelItem =
+                                dynamic_cast<const SfxInt16Item*>(pItem);
+            if ( pListLevelItem->GetValue() != mrTxtNode.GetAttrListLevel() )
+            {
+                mbUpdateListLevel = true;
+            }
+        }
+
+        // handle RES_PARATR_LIST_ISRESTART
+        if ( rItemSet.GetItemState( RES_PARATR_LIST_ISRESTART, FALSE, &pItem ) == SFX_ITEM_SET )
+        {
+            const SfxBoolItem* pListIsRestartItem =
+                                dynamic_cast<const SfxBoolItem*>(pItem);
+            if ( pListIsRestartItem->GetValue() !=
+                                    (mrTxtNode.IsListRestart() ? TRUE : FALSE) )
+            {
+                mbUpdateListRestart = true;
+            }
+        }
+
+        // handle RES_PARATR_LIST_RESTARTVALUE
+        if ( rItemSet.GetItemState( RES_PARATR_LIST_RESTARTVALUE, FALSE, &pItem ) == SFX_ITEM_SET )
+        {
+            const SfxInt16Item* pListRestartValueItem =
+                                dynamic_cast<const SfxInt16Item*>(pItem);
+            if ( !mrTxtNode.HasAttrListRestartValue() ||
+                 pListRestartValueItem->GetValue() != mrTxtNode.GetAttrListRestartValue() )
+            {
+                mbUpdateListRestart = true;
+            }
+        }
+
+        // handle RES_PARATR_LIST_ISCOUNTED
+        if ( rItemSet.GetItemState( RES_PARATR_LIST_ISCOUNTED, FALSE, &pItem ) == SFX_ITEM_SET )
+        {
+            const SfxBoolItem* pIsCountedInListItem =
+                                dynamic_cast<const SfxBoolItem*>(pItem);
+            if ( pIsCountedInListItem->GetValue() !=
+                                (mrTxtNode.IsCountedInList() ? TRUE : FALSE) )
+            {
+                mbUpdateListCount = true;
+            }
+        }
+    }
+
+    HandleSetAttrAtTxtNode::~HandleSetAttrAtTxtNode()
+    {
+        if ( mbAddTxtNodeToList )
+        {
+            SwNumRule* pNumRuleAtTxtNode = mrTxtNode.GetNumRule();
+            if ( pNumRuleAtTxtNode )
+            {
+                mrTxtNode.AddToList();
+            }
+        }
+        else
+        {
+            if ( mbUpdateListLevel && mrTxtNode.IsInList() )
+            {
+                const_cast<SwNodeNum*>(mrTxtNode.GetNum())->SetLevelInListTree(
+                                                    mrTxtNode.GetAttrListLevel() );
+            }
+
+            if ( mbUpdateListRestart && mrTxtNode.IsInList() )
+            {
+                SwNodeNum* pNodeNum = const_cast<SwNodeNum*>(mrTxtNode.GetNum());
+                pNodeNum->InvalidateMe();
+                pNodeNum->NotifyInvalidSiblings();
+            }
+
+            if ( mbUpdateListCount && mrTxtNode.IsInList() )
+            {
+                const_cast<SwNodeNum*>(mrTxtNode.GetNum())->InvalidateAndNotifyTree();
+            }
+        }
+    }
+    // End of class <HandleSetAttrAtTxtNode>
+}
+
+BOOL SwTxtNode::SetAttr( const SfxPoolItem& pItem )
+{
+    const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
+    mbInSetOrResetAttr = true;
+
+    HandleSetAttrAtTxtNode aHandleSetAttr( *this, pItem );
+
+    BOOL bRet = SwCntntNode::SetAttr( pItem );
+
+    mbInSetOrResetAttr = bOldIsSetOrResetAttr;
+
+    return bRet;
+}
+
+BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet )
+{
+    const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
+    mbInSetOrResetAttr = true;
+
+    HandleSetAttrAtTxtNode aHandleSetAttr( *this, rSet );
+
+    BOOL bRet = SwCntntNode::SetAttr( rSet );
+
+    mbInSetOrResetAttr = bOldIsSetOrResetAttr;
+
+    return bRet;
+}
+
+namespace {
+    // Helper class for special handling of resetting attributes at text node:
+    // In constructor an instance of the helper class recognize whose attributes
+    // are reset and perform corresponding actions before the intrinsic reset of
+    // attributes has been taken place.
+    // In the destructor - after the attributes have been reset at the text
+    // node - corresponding actions are performed.
+    // The following is handled:
+    // (1) When the list style attribute - RES_PARATR_NUMRULE - is reset,
+    //     the text is removed from its list before the attributes have been reset.
+    // (2) When the list id attribute - RES_PARATR_LIST_ID - is reset,
+    //     the text is removed from its list before the attributes have been reset.
+    // (3) Notify list tree, if list level - RES_PARATR_LIST_LEVEL - is reset.
+    // (4) Notify list tree, if list restart - RES_PARATR_LIST_ISRESTART - is reset.
+    // (5) Notify list tree, if list restart value - RES_PARATR_LIST_RESTARTVALUE - is reset.
+    // (6) Notify list tree, if count in list - RES_PARATR_LIST_ISCOUNTED - is reset.
+    class HandleResetAttrAtTxtNode
+    {
+        public:
+            HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
+                                      const USHORT nWhich1,
+                                      const USHORT nWhich2 );
+            HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
+                                      const SvUShorts& rWhichArr );
+            HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode );
+
+            ~HandleResetAttrAtTxtNode();
+
+        private:
+            SwTxtNode& mrTxtNode;
+            bool mbListStyleReset;
+            bool mbUpdateListLevel;
+            bool mbUpdateListRestart;
+            bool mbUpdateListCount;
+    };
+
+    HandleResetAttrAtTxtNode::HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
+                                                        const USHORT nWhich1,
+                                                        const USHORT nWhich2 )
+        : mrTxtNode( rTxtNode ),
+          mbListStyleReset( false ),
+          mbUpdateListLevel( false ),
+          mbUpdateListRestart( false ),
+          mbUpdateListCount( false )
+    {
+        bool bRemoveFromList( false );
+        if ( nWhich2 != 0 && nWhich2 > nWhich1 )
+        {
+            // RES_PARATR_NUMRULE and RES_PARATR_LIST_ID
+            if ( nWhich1 <= RES_PARATR_NUMRULE && RES_PARATR_NUMRULE <= nWhich2 )
+            {
+                bRemoveFromList = mrTxtNode.GetNumRule() != 0;
+                mbListStyleReset = true;
+            }
+            else if ( nWhich1 <= RES_PARATR_LIST_ID && RES_PARATR_LIST_ID <= nWhich2 )
+            {
+                bRemoveFromList = mrTxtNode.GetpSwAttrSet() &&
+                    mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, FALSE ) == SFX_ITEM_SET;
+            }
+
+            if ( !bRemoveFromList )
+            {
+                // RES_PARATR_LIST_LEVEL
+                mbUpdateListLevel = ( nWhich1 <= RES_PARATR_LIST_LEVEL &&
+                                      RES_PARATR_LIST_LEVEL <= nWhich2 &&
+                                      mrTxtNode.HasAttrListLevel() );
+
+                // RES_PARATR_LIST_ISRESTART and RES_PARATR_LIST_RESTARTVALUE
+                mbUpdateListRestart =
+                    ( nWhich1 <= RES_PARATR_LIST_ISRESTART && RES_PARATR_LIST_ISRESTART <= nWhich2 &&
+                      mrTxtNode.IsListRestart() ) ||
+                    ( nWhich1 <= RES_PARATR_LIST_RESTARTVALUE && RES_PARATR_LIST_RESTARTVALUE <= nWhich2 &&
+                      mrTxtNode.HasAttrListRestartValue() );
+
+                // RES_PARATR_LIST_ISCOUNTED
+                mbUpdateListCount =
+                    ( nWhich1 <= RES_PARATR_LIST_ISCOUNTED && RES_PARATR_LIST_ISCOUNTED <= nWhich2 &&
+                      !mrTxtNode.IsCountedInList() );
+            }
+        }
+        else
+        {
+            // RES_PARATR_NUMRULE and RES_PARATR_LIST_ID
+            if ( nWhich1 == RES_PARATR_NUMRULE )
+            {
+                bRemoveFromList = mrTxtNode.GetNumRule() != 0;
+                mbListStyleReset = true;
+            }
+            else if ( nWhich1 == RES_PARATR_LIST_ID )
+            {
+                bRemoveFromList = mrTxtNode.GetpSwAttrSet() &&
+                    mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, FALSE ) == SFX_ITEM_SET;
+            }
+
+            if ( !bRemoveFromList )
+            {
+                // RES_PARATR_LIST_LEVEL
+                mbUpdateListLevel = nWhich1 == RES_PARATR_LIST_LEVEL &&
+                                    mrTxtNode.HasAttrListLevel();
+
+                // RES_PARATR_LIST_ISRESTART and RES_PARATR_LIST_RESTARTVALUE
+                mbUpdateListRestart = ( nWhich1 == RES_PARATR_LIST_ISRESTART &&
+                                        mrTxtNode.IsListRestart() ) ||
+                                      ( nWhich1 == RES_PARATR_LIST_RESTARTVALUE &&
+                                        mrTxtNode.HasAttrListRestartValue() );
+
+                // RES_PARATR_LIST_ISCOUNTED
+                mbUpdateListCount = nWhich1 == RES_PARATR_LIST_ISCOUNTED &&
+                                    !mrTxtNode.IsCountedInList();
+            }
+        }
+
+        if ( bRemoveFromList && mrTxtNode.IsInList() )
+        {
+            mrTxtNode.RemoveFromList();
+        }
+    }
+
+    HandleResetAttrAtTxtNode::HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
+                                                        const SvUShorts& rWhichArr )
+        : mrTxtNode( rTxtNode ),
+          mbListStyleReset( false ),
+          mbUpdateListLevel( false ),
+          mbUpdateListRestart( false ),
+          mbUpdateListCount( false )
+    {
+        bool bRemoveFromList( false );
+        {
+            const USHORT nEnd = rWhichArr.Count();
+            for ( USHORT n = 0; n < nEnd; ++n )
+            {
+                // RES_PARATR_NUMRULE and RES_PARATR_LIST_ID
+                if ( rWhichArr[ n ] == RES_PARATR_NUMRULE )
+                {
+                    bRemoveFromList = bRemoveFromList ||
+                                      mrTxtNode.GetNumRule() != 0;
+                    mbListStyleReset = true;
+                }
+                else if ( rWhichArr[ n ] == RES_PARATR_LIST_ID )
+                {
+                    bRemoveFromList = bRemoveFromList ||
+                        ( mrTxtNode.GetpSwAttrSet() &&
+                          mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, FALSE ) == SFX_ITEM_SET );
+                }
+
+                if ( !bRemoveFromList )
+                {
+                    // RES_PARATR_LIST_LEVEL
+                    mbUpdateListLevel = mbUpdateListLevel ||
+                                        ( rWhichArr[ n ] == RES_PARATR_LIST_LEVEL &&
+                                          mrTxtNode.HasAttrListLevel() );
+
+                    // RES_PARATR_LIST_ISRESTART and RES_PARATR_LIST_RESTARTVALUE
+                    mbUpdateListRestart = mbUpdateListRestart ||
+                                          ( rWhichArr[ n ] == RES_PARATR_LIST_ISRESTART &&
+                                            mrTxtNode.IsListRestart() ) ||
+                                          ( rWhichArr[ n ] == RES_PARATR_LIST_RESTARTVALUE &&
+                                            mrTxtNode.HasAttrListRestartValue() );
+
+                    // RES_PARATR_LIST_ISCOUNTED
+                    mbUpdateListCount = mbUpdateListCount ||
+                                        ( rWhichArr[ n ] == RES_PARATR_LIST_ISCOUNTED &&
+                                          !mrTxtNode.IsCountedInList() );
+                }
+            }
+        }
+
+        if ( bRemoveFromList && mrTxtNode.IsInList() )
+        {
+            mrTxtNode.RemoveFromList();
+        }
+    }
+
+    HandleResetAttrAtTxtNode::HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode )
+        : mrTxtNode( rTxtNode ),
+          mbListStyleReset( false ),
+          mbUpdateListLevel( false ),
+          mbUpdateListRestart( false ),
+          mbUpdateListCount( false )
+    {
+        mbListStyleReset = true;
+        if ( rTxtNode.IsInList() )
+        {
+            rTxtNode.RemoveFromList();
+        }
+    }
+
+    HandleResetAttrAtTxtNode::~HandleResetAttrAtTxtNode()
+    {
+        if ( mbListStyleReset && !mrTxtNode.IsInList() )
+        {
+            // check, if via reset of list style, the paragraph now has
+            // a list style applied via its paragraph style.
+            if ( mrTxtNode.GetNumRule() &&
+                 mrTxtNode.GetListId().Len() > 0 )
+            {
+                mrTxtNode.AddToList();
+            }
+        }
+
+        if ( mrTxtNode.IsInList() )
+        {
+            if ( mbUpdateListLevel )
+            {
+                SwNodeNum* pNodeNum = const_cast<SwNodeNum*>(mrTxtNode.GetNum());
+                pNodeNum->SetLevelInListTree( mrTxtNode.GetAttrListLevel() );
+            }
+
+            if ( mbUpdateListRestart )
+            {
+                SwNodeNum* pNodeNum = const_cast<SwNodeNum*>(mrTxtNode.GetNum());
+                pNodeNum->InvalidateMe();
+                pNodeNum->NotifyInvalidSiblings();
+            }
+
+            if ( mbUpdateListCount )
+            {
+                SwNodeNum* pNodeNum = const_cast<SwNodeNum*>(mrTxtNode.GetNum());
+                pNodeNum->InvalidateAndNotifyTree();
+            }
+        }
+    }
+    // End of class <HandleResetAttrAtTxtNode>
+}
+
+BOOL SwTxtNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 )
+{
+    const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
+    mbInSetOrResetAttr = true;
+
+    HandleResetAttrAtTxtNode aHandleResetAttr( *this, nWhich1, nWhich2 );
+
+    BOOL bRet = SwCntntNode::ResetAttr( nWhich1, nWhich2 );
+
+    mbInSetOrResetAttr = bOldIsSetOrResetAttr;
+
+    return bRet;
+}
+
+BOOL SwTxtNode::ResetAttr( const SvUShorts& rWhichArr )
+{
+    const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
+    mbInSetOrResetAttr = true;
+
+    HandleResetAttrAtTxtNode aHandleResetAttr( *this, rWhichArr );
+
+    BOOL bRet = SwCntntNode::ResetAttr( rWhichArr );
+
+    mbInSetOrResetAttr = bOldIsSetOrResetAttr;
+
+    return bRet;
+}
+
+USHORT SwTxtNode::ResetAllAttr()
+{
+    const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
+    mbInSetOrResetAttr = true;
+
+    HandleResetAttrAtTxtNode aHandleResetAttr( *this );
+
+    USHORT nRet = SwCntntNode::ResetAllAttr();
+
+    mbInSetOrResetAttr = bOldIsSetOrResetAttr;
+
+    return nRet;
+}
+// <--


when there are duplicate includes we'll typically need at least one of them

--- sw/source/core/txtnode/ndtxt.cxx
+++ sw/source/core/txtnode/ndtxt.cxx
@@ -90,6 +90,7 @@
 #include <swtable.hxx>
 #include <docsh.hxx>
 #include <SwNodeNum.hxx>
+#include <svl/intitem.hxx>
 #include <list.hxx>

 SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0, 4 )


INTEGRATION: CWS mullingarfilterteam18 (1.91.16); FILE MERGED 2003/12/15 14:52:36 cmc 1.91.16.9: #113434# I went to such effort to get the right cell to compare against, and then didn't use the index I tested :-( 2003/12/15 14:19:21 cmc 1.91.16.8: #113434# outline ctor/dtor 2003/12/11 13:48:53 cmc 1.91.16.7: RESYNC: (1.91-1.92); FILE MERGED 2003/12/09 16:03:56 cmc 1.91.16.6: #i23022# / #i18644# difficulties in mapping word position of after row end mark to suitable equivalent location in writer 2003/12/05 09:47:25 cmc 1.91.16.5: #113434# only merge cells if they *exist* 2003/12/04 13:18:11 cmc 1.91.16.4: #i20540# Seeing as the SdrOle2Obj is hellbent on inserting stuff into the persist that we want to do instead, then give it no persist to work with 2003/12/03 09:03:00 cmc 1.91.16.3: #113365# put a bandaid on a reported crash 2003/11/17 17:09:52 cmc 1.91.16.2: #i9055# add in some defaults to case statements, etc 2003/11/17 08:50:41 cmc 1.91.16.1: #i9055# unused variable

--- sw/source/filter/ww8/ww8par2.cxx
+++ sw/source/filter/ww8/ww8par2.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: ww8par2.cxx,v $
  *
- *  $Revision: 1.94 $
+ *  $Revision: 1.95 $
  *
- *  last change: $Author: obo $ $Date: 2004-01-13 13:16:58 $
+ *  last change: $Author: obo $ $Date: 2004-01-13 17:50:01 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -62,8 +62,6 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */

-#pragma hdrstop
-
 #ifndef _SOLAR_H
 #include <tools/solar.h>
 #endif
@@ -249,9 +247,9 @@
     bool bExist[MAX_COL];           // Existiert diese Zelle ?
     UINT8 nTransCell[MAX_COL + 2];  // UEbersetzung WW-Index -> SW-Index

-    WW8TabBandDesc() {  memset( this, 0, sizeof( *this ) ); };
-    WW8TabBandDesc( WW8TabBandDesc& rBand );    // tief kopieren
-    ~WW8TabBandDesc() { delete[] pTCs; delete[] pSHDs; delete[] pNewSHDs;};
+    WW8TabBandDesc();
+    WW8TabBandDesc(WW8TabBandDesc& rBand);    // tief kopieren
+    ~WW8TabBandDesc();
     static void setcelldefaults(WW8_TCell *pCells, short nCells);
     void ReadDef(bool bVer67, const BYTE* pS);
     void ProcessSprmTSetBRC(bool bVer67, const BYTE* pParamsTSetBRC);
@@ -265,6 +263,18 @@

     enum wwDIR {wwTOP = 0, wwLEFT = 1, wwBOTTOM = 2, wwRIGHT = 3};
 };
+
+WW8TabBandDesc::WW8TabBandDesc()
+{
+    memset(this, 0, sizeof(*this));
+}
+
+WW8TabBandDesc::~WW8TabBandDesc()
+{
+    delete[] pTCs;
+    delete[] pSHDs;
+    delete[] pNewSHDs;
+}

 class WW8TabDesc
 {
@@ -344,6 +354,7 @@
     void SetSizePosition(SwFrmFmt* pFrmFmt);
     void TableCellEnd();
     void MoveOutsideTable();
+    void ParkPaM();
     void FinishSwTable();
     void MergeCells();
     short GetMinLeft() const { return nConvertedLeft; }
@@ -519,8 +530,7 @@
     }

     FtnDescriptor aDesc;
-    bool bAutoNum = true;
-    if( eEDN == pRes->nSprmId )
+    if (eEDN == pRes->nSprmId)
     {
         aDesc.meType = MAN_EDN;
         if (pPlcxMan->GetEdn())
@@ -2183,7 +2193,7 @@
                 if ((nLowerLeft < nUpperLeft) || (nLowerRight > nUpperRight))
                     continue;

-                WW8_BRC &rBelow = pNext->pTCs[k].rgbrc[WW8_TOP];
+                WW8_BRC &rBelow = pNext->pTCs[l].rgbrc[WW8_TOP];
                 short nBelowThick = rBelow.IsEmpty(pIo->bVer67) ?
                     0 : rBelow.DetermineBorderProperties(pIo->bVer67);
                 if (nAboveThick > nBelowThick)
@@ -2233,7 +2243,7 @@

 void WW8TabDesc::CreateSwTable()
 {
-    ::SetProgressState( pIo->nProgress, pIo->rDoc.GetDocShell() );   // Update
+    ::SetProgressState(pIo->nProgress, pIo->mpDocShell);   // Update

     // if there is already some content on the Node append new node to ensure
     // that this content remains ABOVE the table
@@ -2414,6 +2424,8 @@
                     pTabBoxes = &pTabLine->GetTabBoxes();

                     USHORT nCol = pActBand->nTransCell[ i ];
+                    if (!pActBand->bExist[nCol])    //#113434#
+                        continue;
                     ASSERT(nCol < pTabBoxes->Count(),
                         "Too few columns, table ended early");
                     if (nCol >= pTabBoxes->Count())
@@ -2455,6 +2467,7 @@
                         }
                     }

+
                     if (bMerge)
                     {
                         short nX1    = pActBand->nCenter[ i ];
@@ -2526,7 +2539,38 @@
                     // sein)
                     UpdateTableMergeGroup( rCell, pActMGroup, pTabBox, i );
                 }
-        }
+            }
+    }
+}
+
+//There is a limbo area in word at the end of the row marker
+//where properties can live in word, there is no location in
+//writer equivalent, so try and park the cursor in the best
+//match, see #i23022#/#i18644#
+void WW8TabDesc::ParkPaM()
+{
+    SwTableBox *pTabBox = 0;
+    short nRow = nAktRow + 1;
+    if (nRow < pTabLines->Count())
+    {
+        if (SwTableLine *pLine = (*pTabLines)[nRow])
+        {
+            SwTableBoxes &rBoxes = pLine->GetTabBoxes();
+            pTabBox = rBoxes.Count() ? rBoxes[0] : 0;
+        }
+    }
+
+    if (!pTabBox || !pTabBox->GetSttNd())
+    {
+        MoveOutsideTable();
+        return;
+    }
+
+    if (pIo->pPaM->GetPoint()->nNode != pTabBox->GetSttIdx() + 1)
+    {
+        pIo->pPaM->GetPoint()->nNode = pTabBox->GetSttIdx() + 1;
+        pIo->pPaM->GetPoint()->nContent.Assign(pIo->pPaM->GetCntntNode(), 0);
+        pIo->rDoc.SetTxtFmtColl(*pIo->pPaM, (SwTxtFmtColl*)pIo->pDfltTxtFmtColl);
     }
 }

@@ -2565,7 +2609,7 @@
         SwTableBox*    pTargetBox;
         WW8SelBoxInfo* pActMGroup;
         USHORT         nActBoxCount;
-        for( USHORT iGr = 0; iGr < pMergeGroups->Count(); iGr++ )
+        for (USHORT iGr = 0; iGr < pMergeGroups->Count(); ++iGr)
         {
             pActMGroup   = (*pMergeGroups)[ iGr ];
             // Anzahl der zu mergenden Boxen PLUS Eins (fuer die TargetBox)
@@ -2835,7 +2879,7 @@
     if (nCol >= pTabBoxes->Count())
     {
         if (bPam)
-            MoveOutsideTable();
+            ParkPaM();
         return false;
     }
     pTabBox = (*pTabBoxes)[nCol];
@@ -2846,7 +2890,7 @@
             MoveOutsideTable();
         return false;
     }
-    if( bPam )
+    if (bPam)
     {
         pAktWWCell = &pActBand->pTCs[ nWwCol ];
         //We need to set the pPaM on the first cell, invalid
@@ -2856,11 +2900,11 @@
         if (pIo->pPaM->GetPoint()->nNode != pTabBox->GetSttIdx() + 1)
         {
             pIo->pPaM->GetPoint()->nNode = pTabBox->GetSttIdx() + 1;
-            pIo->pPaM->GetPoint()->nContent.Assign( pIo->pPaM->GetCntntNode(), 0 );
+            pIo->pPaM->GetPoint()->nContent.Assign(pIo->pPaM->GetCntntNode(), 0);
             // Zur Sicherheit schon jetzt setzen, da bei den Zellen, die
             // zum Randausgleich eingefuegt werden, sonst der Style
             // nicht gesetzt wird.
-            pIo->rDoc.SetTxtFmtColl( *pIo->pPaM, (SwTxtFmtColl*)pIo->pDfltTxtFmtColl );
+            pIo->rDoc.SetTxtFmtColl(*pIo->pPaM, (SwTxtFmtColl*)pIo->pDfltTxtFmtColl);
             // uebrigens: da diese Zellen unsichtbare Hilfskonstruktionen sind,
             //            und nur dazu dienen, zerfranste Aussehen der WW-Tabelle
             //            nachzuahmen, braucht NICHT SetTxtFmtCollAndListLevel()
@@ -3076,7 +3120,7 @@

 void WW8TabDesc::TableCellEnd()
 {
-    ::SetProgressState( pIo->nProgress, pIo->rDoc.GetDocShell() );   // Update
+    ::SetProgressState(pIo->nProgress, pIo->mpDocShell);   // Update

     // neue Zeile
     if( pIo->bWasTabRowEnd )
@@ -3291,6 +3335,9 @@
 void SwWW8ImplReader::StopTable()
 {
     maTracer.LeaveEnvironment(sw::log::eTable);
+    ASSERT(pTableDesc, "Panic, stop table with no table!");
+    if (!pTableDesc)
+        return;

     pTableDesc->FinishSwTable();
     PopTableDesc();
@@ -3658,6 +3705,7 @@
             pSI->eCJKFontSrcCharSet = pj->eCJKFontSrcCharSet;
             pSI->n81Flags = pj->n81Flags;
             pSI->n81BiDiFlags = pj->n81BiDiFlags;
+            pSI->nOutlineLevel = pj->nOutlineLevel;
             pSI->bInvisFlag = pj->bInvisFlag;
             pSI->bParaAutoBefore = pj->bParaAutoBefore;
             pSI->bParaAutoAfter = pj->bParaAutoAfter;


INTEGRATION: CWS wordtwo01 (1.69.86); FILE MERGED 2005/12/21 12:19:51 cmc 1.69.86.2: RESYNC: (1.69-1.72); FILE MERGED 2005/11/04 10:48:03 cmc 1.69.86.1: #i2535# add word 2 import support

--- sw/source/filter/ww8/ww8par3.cxx
+++ sw/source/filter/ww8/ww8par3.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ww8par3.cxx,v $
  *
- *  $Revision: 1.73 $
+ *  $Revision: 1.74 $
  *
- *  last change: $Author: hr $ $Date: 2006-01-25 13:41:19 $
+ *  last change: $Author: hr $ $Date: 2006-01-26 18:21:17 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1012,7 +1012,7 @@
 // oeffentliche Methoden /////////////////////////////////////////////////////
 //
 WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
-    : maSprmParser(rReader_.GetFib().nVersion), rReader(rReader_),
+    : maSprmParser(rReader_.GetFib().GetFIBVersion()), rReader(rReader_),
     rDoc(rReader.GetDoc()), rFib(rReader.GetFib()), rSt(rSt_), pLFOInfos(0),
     nUniqueList(1)
 {


INTEGRATION: CWS pchfix02 (1.34.2); FILE MERGED 2006/09/01 17:53:19 kaib 1.34.2.1: #i68856# Added header markers and pch files

--- sw/source/ui/shells/drwtxtex.cxx
+++ sw/source/ui/shells/drwtxtex.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: drwtxtex.cxx,v $
  *
- *  $Revision: 1.34 $
- *
- *  last change: $Author: hr $ $Date: 2006-08-14 17:53:45 $
+ *  $Revision: 1.35 $
+ *
+ *  last change: $Author: obo $ $Date: 2006-09-16 23:14:23 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -32,7 +32,9 @@
  *    MA  02111-1307  USA
  *
  ************************************************************************/
-#pragma hdrstop
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sw.hxx"

 #ifndef _HINTIDS_HXX
 #include <hintids.hxx>


INTEGRATION: CWS os8 (1.16.138); FILE MERGED 2003/04/03 07:15:02 os 1.16.138.1: #108583# precompiled headers removed

--- sw/source/ui/shells/drwtxtsh.cxx
+++ sw/source/ui/shells/drwtxtsh.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: drwtxtsh.cxx,v $
  *
- *  $Revision: 1.16 $
- *
- *  last change: $Author: os $ $Date: 2002-11-15 10:27:02 $
+ *  $Revision: 1.17 $
+ *
+ *  last change: $Author: vg $ $Date: 2003-04-17 15:41:48 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -58,9 +58,6 @@
  *
  *
  ************************************************************************/
-#ifdef PRECOMPILED
-#include "ui_pch.hxx"
-#endif

 #pragma hdrstop


plat2d: swap red and blue in fillrect. This must be a bug in SDL but red and blue seem to be in the wrong order.

--- plat2d/play.cc
+++ plat2d/play.cc
@@ -163,5 +163,5 @@
 	unsigned char r = color.getred255();
 	unsigned char g = color.getgreen255();
 	unsigned char b = color.getblue255();
-	SDL_FillRect(screen, rect, SDL_MapRGB(screen->format, r, g, b));
+	SDL_FillRect(screen, rect, SDL_MapRGB(screen->format, b, g, r));
 }


testing ex1

testing ex1

--- applications/MPM_FEM/ex1/ex1.cpp
+++ applications/MPM_FEM/ex1/ex1.cpp
@@ -202,11 +202,12 @@
   mlSol.GetWriter()->SetDebugOutput(true);
   mlSol.GetWriter()->Write(DEFAULT_OUTPUTDIR, "biquadratic", print_vars, 0);

-  gravity[0] = 9.81 * sqrt(2.) / 2.;
-  gravity[1] = -9.81 * sqrt(2.) / 2.;
+  double theta = PI/8;
+  gravity[0] = 9.81 * sin(theta);
+  gravity[1] = -9.81 * cos(theta);

   system.AttachGetTimeIntervalFunction(SetVariableTimeStep);
-  unsigned n_timesteps = 200;
+  unsigned n_timesteps = 300;
   for (unsigned time_step = 1; time_step <= n_timesteps; time_step++) {

     system.CopySolutionToOldSolution();


non ranna ancora un ...

non ranna ancora un ...

--- applications/MPM_FEM/ex2/ex2.cpp
+++ applications/MPM_FEM/ex2/ex2.cpp
@@ -270,7 +270,7 @@
     mov_vars.push_back("DX");
     mov_vars.push_back("DY");
     mov_vars.push_back("DZ");
-   // mlSol.GetWriter()->SetMovingMesh(mov_vars);
+    mlSol.GetWriter()->SetMovingMesh(mov_vars);

     std::vector<std::string> print_vars;
     print_vars.push_back("All");
@@ -430,9 +430,11 @@
     bool particlesInElement = false;
     for (unsigned iMarker = markerOffset1; iMarker < markerOffset2; iMarker++) {
       //element of particle iMarker
-      int iel2 = particles[iMarker]->GetMarkerElement();
-      if (iel == iel2) particlesInElement = true;
+      unsigned iel2 = particles[iMarker]->GetMarkerElement();
+      if (iel == iel2) {
+	particlesInElement = true;
       break;
+      }
     }
 //END

@@ -446,16 +448,16 @@
     std::vector <int> sysDof(nDofs);

     unsigned  material = 0;  // solid = 2, interface =1, fluid =0;
-//     unsigned counter = 0;
-//     for(unsigned i = 0; i < nDofsM; i++) {
-//       unsigned idof = mymsh->GetSolutionDof(i, iel, solTypeM);    // global to global mapping between solution node and solution dof
-//       double value = (*mysolution->_Sol[indexSolM])(idof);
-//       if (fabs(value) > 1.0e-14) {
-// 	material = 2;
-// 	counter++;
-//       }
-//     }
-    //if ( material == 2 && counter != nDofsM)  material = 1;
+    unsigned counter = 0;
+    for(unsigned i = 0; i < nDofsM; i++) {
+      unsigned idof = mymsh->GetSolutionDof(i, iel, solTypeM);    // global to global mapping between solution node and solution dof
+      double value = (*mysolution->_Sol[indexSolM])(idof);
+      if (fabs(value) > 1.0e-14) {
+	material = 2;
+	counter++;
+      }
+    }
+    if ( material == 2 && counter != nDofsM)  material = 1;

  //BEGIN to remove
     if (particlesInElement == true) material = 2;
@@ -536,7 +538,7 @@
       distance = sqrt(distance);
       double scalingFactor;// / (1. + 100. * distance);
       if(material == 0) scalingFactor = 0.00001;
-   //   if(material == 1) scalingFactor = 0.001;
+      if(material == 1) scalingFactor = 0.01;
       if(material == 2) scalingFactor = 0.01;
       for(unsigned i = 0; i < nDofsD; i++) {
         vector < adept::adouble > softStiffness(dim, 0.);


Update camera_pipe to statically bound color loop

--- apps/camera_pipe/camera_pipe.cpp
+++ apps/camera_pipe/camera_pipe.cpp
@@ -254,9 +254,17 @@
     Func curved = apply_curve(corrected, result_type, gamma, contrast);

     // Schedule
-    Var co, ci;
-    processed(tx, ty, c) = curved(tx, ty, c);
-    //processed.split(c, co, ci, 3); // bound color loop to 0-3
+    Var co, ci;
+    //#define USE_CI_HACK
+    #ifndef USE_CI_HACK
+    ci = c;
+    #endif
+    processed(tx, ty, c) = curved(tx, ty, ci);
+    #ifdef USE_CI_HACK
+    processed.split(c, co, ci, 3); // bound color loop to 0-3
+    #else
+    processed.bound(c, 0, 3); // bound color loop 0-3, properly
+    #endif
     if (schedule == 0) {
         // Compute in chunks over tiles, vectorized by 8
         denoised.chunk(tx).vectorize(x, 8);
@@ -308,8 +316,8 @@
     // Build the pipeline
     Func processed = process(shifted, result_type, matrix_3200, matrix_7000, color_temp, gamma, contrast);

-    string s = processed.serialize();
-    printf("%s\n", s.c_str());
+    //string s = processed.serialize();
+    //printf("%s\n", s.c_str());

     // In C++-11, this can be done as a simple initializer_list {color_temp,gamma,etc.} in place.
     Func::Arg args[] = {color_temp, gamma, contrast, input, matrix_3200, matrix_7000};


Removed glcdfont references (handled in Adafruit_GFX)

--- Adafruit_SSD1306.cpp
+++ Adafruit_SSD1306.cpp
@@ -24,11 +24,6 @@

 #include "Adafruit_GFX.h"
 #include "Adafruit_SSD1306.h"
-
-#include "glcdfont.c"
-
-// a 5x7 font table
-extern uint8_t PROGMEM font[];

 // the memory buffer for the LCD


fixed compile error: COPASI/copasi/math/CMathDependencyGraph.cpp:156: error: jump to label 'finish' COPASI/copasi/math/CMathDependencyGraph.cpp:103: error:   from here COPASI/copasi/math/CMathDependencyGraph.cpp:124: error:   crosses initialization of 'std::ofstream GetUpdateSequence' *** [copasi/CMakeFiles/libCOPASI.dir/math/CMathDependencyGraph.cpp.o] Error code 1

--- copasi/math/CMathDependencyGraph.cpp
+++ copasi/math/CMathDependencyGraph.cpp
@@ -1,7 +1,7 @@
-// Copyright (C) 2011 - 2013 by Pedro Mendes, Virginia Tech Intellectual
-// Properties, Inc., University of Heidelberg, and The University
-// of Manchester.
-// All rights reserved.
+// Copyright (C) 2011 - 2013 by Pedro Mendes, Virginia Tech Intellectual
+// Properties, Inc., University of Heidelberg, and The University
+// of Manchester.
+// All rights reserved.

 #include <sstream>

@@ -121,9 +121,11 @@
     }

 #ifdef COPASI_DEBUG_TRACE
+{
   std::ofstream GetUpdateSequence("GetUpdateSequence.dot");
   exportDOTFormat(GetUpdateSequence, "GetUpdateSequence");
   GetUpdateSequence.close();
+}
 #endif //COPASI_DEBUG_TRACE

   if (!success) goto finish;


Fix for the initial Git Status command path error

 - converted GameDir path to Absolute

--- Source/GitSourceControl/Private/GitSourceControlOperations.cpp
+++ Source/GitSourceControl/Private/GitSourceControlOperations.cpp
@@ -1,172 +1,172 @@
-// Copyright (c) 2014 Sebastien Rombauts (sebastien.rombauts@gmail.com)
-//
-// Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
-// or copy at http://opensource.org/licenses/MIT)
-
-#include "GitSourceControlPrivatePCH.h"
-#include "GitSourceControlOperations.h"
-#include "GitSourceControlState.h"
-#include "GitSourceControlCommand.h"
-#include "GitSourceControlModule.h"
-#include "GitSourceControlUtils.h"
-
-#define LOCTEXT_NAMESPACE "GitSourceControl"
-
-FName FGitConnectWorker::GetName() const
-{
-	return "Connect";
-}
-
-bool FGitConnectWorker::Execute(FGitSourceControlCommand& InCommand)
-{
-	check(InCommand.Operation->GetName() == "Connect");
-
-	InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("status"), TArray<FString>(), TArray<FString>(), InCommand.InfoMessages, InCommand.ErrorMessages);
-	if(!InCommand.bCommandSuccessful || InCommand.ErrorMessages.Num() > 0 || InCommand.InfoMessages.Num() == 0)
-	{
-		// @todo popup to propose to initialize the git repository
-		TSharedRef<FConnect, ESPMode::ThreadSafe> Operation = StaticCastSharedRef<FConnect>(InCommand.Operation);
-		Operation->SetErrorText(LOCTEXT("NotAWorkingCopyError", "Project is not part of a Git working copy."));
-		InCommand.ErrorMessages.Add(LOCTEXT("NotAWorkingCopyErrorHelp", "You should check out a working copy into your project directory.").ToString());
-		InCommand.bCommandSuccessful = false;
-	}
-	return InCommand.bCommandSuccessful;
-}
-
-bool FGitConnectWorker::UpdateStates() const
-{
-	return false;
-}
-
-FName FGitRevertWorker::GetName() const
-{
-	return "Revert";
-}
-
-bool FGitRevertWorker::Execute(FGitSourceControlCommand& InCommand)
-{
-	// reset any changes already added in index
-	{
-		TArray<FString> Parameters;
-		InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("reset"), Parameters, InCommand.Files, InCommand.InfoMessages, InCommand.ErrorMessages);
-	}
-
-	// revert any changes in working copy
-	{
-		TArray<FString> Parameters;
-		InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("checkout"), Parameters, InCommand.Files, InCommand.InfoMessages, InCommand.ErrorMessages);
-	}
-
-	// now update the status of our files
-	{
-		TArray<FString> Results;
-		TArray<FString> Parameters;
-		Parameters.Add(TEXT("--porcelain"));
-		Parameters.Add(TEXT("--ignored"));
-
-		InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("status"), Parameters, InCommand.Files, Results, InCommand.ErrorMessages);
-		GitSourceControlUtils::ParseStatusResults(InCommand.Files, Results, States);
-	}
-
-	return InCommand.bCommandSuccessful;
-}
-
-bool FGitRevertWorker::UpdateStates() const
-{
-	return GitSourceControlUtils::UpdateCachedStates(States);
-}
-
-FName FGitUpdateStatusWorker::GetName() const
-{
-	return "UpdateStatus";
-}
-
-bool FGitUpdateStatusWorker::Execute(FGitSourceControlCommand& InCommand)
-{
-	check(InCommand.Operation->GetName() == "UpdateStatus");
-
-	// @todo cleanup the following if/else if if conditions (see mercurial plugin)
-	if(InCommand.Files.Num() > 0)
-	{
-		TArray<FString> Results;
-		TArray<FString> Parameters;
-		Parameters.Add(TEXT("--porcelain"));
-		Parameters.Add(TEXT("--ignored"));
-
-		InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("status"), Parameters, InCommand.Files, Results, InCommand.ErrorMessages);
-		GitSourceControlUtils::ParseStatusResults(InCommand.Files, Results, States);
-	}
-	else
-	{
-		InCommand.bCommandSuccessful = true; // nothing to do
-	}
-
-	TSharedRef<FUpdateStatus, ESPMode::ThreadSafe> Operation = StaticCastSharedRef<FUpdateStatus>(InCommand.Operation);
-
-	if(Operation->ShouldUpdateHistory())
-	{
-		for(const auto& ItFile : InCommand.Files)
-		{
-			TArray<FString> Results;
-			TArray<FString> Parameters;
-
-			Parameters.Add(TEXT("--max-count 100"));
-			Parameters.Add(TEXT("--follow")); // follow file renames
-			Parameters.Add(TEXT("--date=raw"));
-			Parameters.Add(TEXT("--name-status")); // relative filename at this revision, preceded by a status character
-
-			TArray<FString> Files;
-			Files.Add(*ItFile);
-
-			InCommand.bCommandSuccessful &= GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("log"), Parameters, Files, Results, InCommand.ErrorMessages);
-			TGitSourceControlHistory History;
-			GitSourceControlUtils::ParseLogResults(Results, History);
-			Histories.Add(*ItFile, History);
-		}
-	}
-
-	if(Operation->ShouldGetOpenedOnly())
-	{
-		// "Open files" are those that have been modified (or added/deleted)
-
-		TArray<FString> Results;
-		TArray<FString> Parameters;
-		Parameters.Add(TEXT("--porcelain"));
-		Parameters.Add(TEXT("--ignored"));
-
-		TArray<FString> Files;
-		Files.Add(FPaths::GameDir());
-
-		InCommand.bCommandSuccessful &= GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("status"), Parameters, Files, Results, InCommand.ErrorMessages);
-		GitSourceControlUtils::ParseStatusResults(InCommand.Files, Results, States);
-	}
-
-	if(Operation->ShouldUpdateModifiedState())
-	{
-		// @todo: we dont use the ShouldUpdateModifiedState() hint here as a normal Git status will tell us this information?
-		TArray<FString> Results;
-	}
-
-	return InCommand.bCommandSuccessful;
-}
-
-bool FGitUpdateStatusWorker::UpdateStates() const
-{
-	bool bUpdated = GitSourceControlUtils::UpdateCachedStates(States);
-
-	FGitSourceControlModule& GitSourceControl = FModuleManager::LoadModuleChecked<FGitSourceControlModule>( "GitSourceControl" );
-	FGitSourceControlProvider& Provider = GitSourceControl.GetProvider();
-
-	// add history, if any
-	for(const auto& ItHistory : Histories)
-	{
-		TSharedRef<FGitSourceControlState, ESPMode::ThreadSafe> State = Provider.GetStateInternal(ItHistory.Key);
-		State->History = ItHistory.Value;
-		State->TimeStamp = FDateTime::Now();
-		bUpdated = true;
-	}
-
-	return bUpdated;
-}
-
-#undef LOCTEXT_NAMESPACE
+// Copyright (c) 2014 Sebastien Rombauts (sebastien.rombauts@gmail.com)
+//
+// Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
+// or copy at http://opensource.org/licenses/MIT)
+
+#include "GitSourceControlPrivatePCH.h"
+#include "GitSourceControlOperations.h"
+#include "GitSourceControlState.h"
+#include "GitSourceControlCommand.h"
+#include "GitSourceControlModule.h"
+#include "GitSourceControlUtils.h"
+
+#define LOCTEXT_NAMESPACE "GitSourceControl"
+
+FName FGitConnectWorker::GetName() const
+{
+	return "Connect";
+}
+
+bool FGitConnectWorker::Execute(FGitSourceControlCommand& InCommand)
+{
+	check(InCommand.Operation->GetName() == "Connect");
+
+	InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("status"), TArray<FString>(), TArray<FString>(), InCommand.InfoMessages, InCommand.ErrorMessages);
+	if(!InCommand.bCommandSuccessful || InCommand.ErrorMessages.Num() > 0 || InCommand.InfoMessages.Num() == 0)
+	{
+		// @todo popup to propose to initialize the git repository
+		TSharedRef<FConnect, ESPMode::ThreadSafe> Operation = StaticCastSharedRef<FConnect>(InCommand.Operation);
+		Operation->SetErrorText(LOCTEXT("NotAWorkingCopyError", "Project is not part of a Git working copy."));
+		InCommand.ErrorMessages.Add(LOCTEXT("NotAWorkingCopyErrorHelp", "You should check out a working copy into your project directory.").ToString());
+		InCommand.bCommandSuccessful = false;
+	}
+	return InCommand.bCommandSuccessful;
+}
+
+bool FGitConnectWorker::UpdateStates() const
+{
+	return false;
+}
+
+FName FGitRevertWorker::GetName() const
+{
+	return "Revert";
+}
+
+bool FGitRevertWorker::Execute(FGitSourceControlCommand& InCommand)
+{
+	// reset any changes already added in index
+	{
+		TArray<FString> Parameters;
+		InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("reset"), Parameters, InCommand.Files, InCommand.InfoMessages, InCommand.ErrorMessages);
+	}
+
+	// revert any changes in working copy
+	{
+		TArray<FString> Parameters;
+		InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("checkout"), Parameters, InCommand.Files, InCommand.InfoMessages, InCommand.ErrorMessages);
+	}
+
+	// now update the status of our files
+	{
+		TArray<FString> Results;
+		TArray<FString> Parameters;
+		Parameters.Add(TEXT("--porcelain"));
+		Parameters.Add(TEXT("--ignored"));
+
+		InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("status"), Parameters, InCommand.Files, Results, InCommand.ErrorMessages);
+		GitSourceControlUtils::ParseStatusResults(InCommand.Files, Results, States);
+	}
+
+	return InCommand.bCommandSuccessful;
+}
+
+bool FGitRevertWorker::UpdateStates() const
+{
+	return GitSourceControlUtils::UpdateCachedStates(States);
+}
+
+FName FGitUpdateStatusWorker::GetName() const
+{
+	return "UpdateStatus";
+}
+
+bool FGitUpdateStatusWorker::Execute(FGitSourceControlCommand& InCommand)
+{
+	check(InCommand.Operation->GetName() == "UpdateStatus");
+
+	// @todo cleanup the following if/else if if conditions (see mercurial plugin)
+	if(InCommand.Files.Num() > 0)
+	{
+		TArray<FString> Results;
+		TArray<FString> Parameters;
+		Parameters.Add(TEXT("--porcelain"));
+		Parameters.Add(TEXT("--ignored"));
+
+		InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("status"), Parameters, InCommand.Files, Results, InCommand.ErrorMessages);
+		GitSourceControlUtils::ParseStatusResults(InCommand.Files, Results, States);
+	}
+	else
+	{
+		InCommand.bCommandSuccessful = true; // nothing to do
+	}
+
+	TSharedRef<FUpdateStatus, ESPMode::ThreadSafe> Operation = StaticCastSharedRef<FUpdateStatus>(InCommand.Operation);
+
+	if(Operation->ShouldUpdateHistory())
+	{
+		for(const auto& ItFile : InCommand.Files)
+		{
+			TArray<FString> Results;
+			TArray<FString> Parameters;
+
+			Parameters.Add(TEXT("--max-count 100"));
+			Parameters.Add(TEXT("--follow")); // follow file renames
+			Parameters.Add(TEXT("--date=raw"));
+			Parameters.Add(TEXT("--name-status")); // relative filename at this revision, preceded by a status character
+
+			TArray<FString> Files;
+			Files.Add(*ItFile);
+
+			InCommand.bCommandSuccessful &= GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("log"), Parameters, Files, Results, InCommand.ErrorMessages);
+			TGitSourceControlHistory History;
+			GitSourceControlUtils::ParseLogResults(Results, History);
+			Histories.Add(*ItFile, History);
+		}
+	}
+
+	if(Operation->ShouldGetOpenedOnly())
+	{
+		// "Open files" are those that have been modified (or added/deleted)
+
+		TArray<FString> Results;
+		TArray<FString> Parameters;
+		Parameters.Add(TEXT("--porcelain"));
+		Parameters.Add(TEXT("--ignored"));
+
+		TArray<FString> Files;
+		Files.Add(FPaths::ConvertRelativePathToFull(FPaths::GameDir()));
+
+		InCommand.bCommandSuccessful &= GitSourceControlUtils::RunCommand(InCommand.PathToGitBinary, InCommand.PathToGameDir, TEXT("status"), Parameters, Files, Results, InCommand.ErrorMessages);
+		GitSourceControlUtils::ParseStatusResults(InCommand.Files, Results, States);
+	}
+
+	if(Operation->ShouldUpdateModifiedState())
+	{
+		// @todo: we dont use the ShouldUpdateModifiedState() hint here as a normal Git status will tell us this information?
+		TArray<FString> Results;
+	}
+
+	return InCommand.bCommandSuccessful;
+}
+
+bool FGitUpdateStatusWorker::UpdateStates() const
+{
+	bool bUpdated = GitSourceControlUtils::UpdateCachedStates(States);
+
+	FGitSourceControlModule& GitSourceControl = FModuleManager::LoadModuleChecked<FGitSourceControlModule>( "GitSourceControl" );
+	FGitSourceControlProvider& Provider = GitSourceControl.GetProvider();
+
+	// add history, if any
+	for(const auto& ItHistory : Histories)
+	{
+		TSharedRef<FGitSourceControlState, ESPMode::ThreadSafe> State = Provider.GetStateInternal(ItHistory.Key);
+		State->History = ItHistory.Value;
+		State->TimeStamp = FDateTime::Now();
+		bUpdated = true;
+	}
+
+	return bUpdated;
+}
+
+#undef LOCTEXT_NAMESPACE


Improve log message on successful CheckIn

--- Source/GitSourceControl/Private/GitSourceControlOperations.cpp
+++ Source/GitSourceControl/Private/GitSourceControlOperations.cpp
@@ -96,7 +96,7 @@
 			}

 			Operation->SetSuccessMessage(ParseCommitResults(InCommand.InfoMessages));
-			UE_LOG(LogSourceControl, Log, TEXT("FGitCheckInWorker: commit successful"));
+			UE_LOG(LogSourceControl, Log, TEXT("commit successful: %s"), *InCommand.InfoMessages[0]);
 		}
 	}


fix: proper horizontal scrolling

fix: proper horizontal scrolling

--- libs/ride/src/ride/view.cc
+++ libs/ride/src/ride/view.cc
@@ -296,7 +296,7 @@
     for(std::size_t index = 0; index < get_number_of_lines(); index+=1)
     {
         draw_line(cache, index,
-            body_rect.x + scroll.x,
+            body_rect.x - scroll.x,
             body_rect.y + line_number_to_y(index) + scroll.y
         );
     }


minor documentation fix

minor documentation fix

--- src/matrix.cpp
+++ src/matrix.cpp
@@ -6,7 +6,7 @@
  * version of the matrix 'scrolling streams of text' animation. It's really
  * fairly simple but also kinda nice to see how the vt100 output is performing.
  *
- * \image html matrix.png "screenshot of the programme running in Terminal"
+ * \image html matrix.png "Screenshot of the programme running in Terminal.app"
  *
  * \copyright
  * Copyright (c) 2012-2013, ef.gy Project Members


Adds DDR4 hybrid NV-RDIMM support

Adds DDR4 hybrid NV-RDIMM support

Change-Id: I144567d88dc7ce44a6abef08a592bc6f4e4fdf68
Original-Change-Id: Ie5cc0ed4dc6337c35df2e222cc4e220e5720f0bd
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44974
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <65293609e29ccd0ac899f5f3f03aea95be1b215f@us.ibm.com>
Reviewed-by: Louis Stermole <a2bef96d502debd02962600aef4d81d949c35039@us.ibm.com>
Reviewed-by: JACOB L. HARVEY <3228c361e36065d481020c968085ab1d20e47d22@us.ibm.com>
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.H
+++ src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.H
@@ -52,6 +52,11 @@
 ///
 enum raw_card_rev : uint8_t
 {
+
+    // TODO:RTC178807 - Update how NVDIMMs are handled once more are up and running in the lab
+    // NVDIMM's have the same RC value as custom DIMMs, but are defined by SPD byte 03 differently
+    NVDIMM = 0x1F,
+
     A1 = 0x20,
     B1 = 0x21,

@@ -76,12 +81,14 @@
 }// rdimm

 // Exposed so we can test them.
-extern rcw_settings rdimm_rc_c1;
-extern rcw_settings rdimm_rc_c2;
+// Alphabetized list below
 extern rcw_settings rdimm_rc_a1;
 extern rcw_settings rdimm_rc_b1;
 extern rcw_settings rdimm_rc_b2;
+extern rcw_settings rdimm_rc_c1;
+extern rcw_settings rdimm_rc_c2;
 extern rcw_settings rdimm_rc_custom;
+extern rcw_settings rdimm_rc_nvdimm;
 extern rcw_settings rdimm_rc_vbu;

 }// mss


Use artificial identifiers.

Use artificial identifiers.

--- src/mc/work.cc
+++ src/mc/work.cc
@@ -29,13 +29,15 @@
 struct mk_order_visitor
   : public boost::static_visitor<std::pair<std::string, sdd::order_builder<sdd_conf>>>
 {
-  using result_type = std::pair<std::string, sdd::order_builder<sdd_conf>>;
+  using order_identifier = sdd::order_identifier<sdd_conf>;
+  using result_type = std::pair<order_identifier, sdd::order_builder<sdd_conf>>;
   using order_builder = sdd::order_builder<sdd_conf>;

   const conf::pnmc_configuration& conf;
+  mutable unsigned int artificial_id_counter;

   mk_order_visitor(const conf::pnmc_configuration& c)
-    : conf(c)
+    : conf(c), artificial_id_counter(0)
   {}

   // Place: base case of the recursion, there's no more possible nested hierarchies.
@@ -43,7 +45,7 @@
   operator()(const pn::place* p)
   const noexcept
   {
-    return make_pair(p->id, order_builder());
+    return std::make_pair(order_identifier(p->id), order_builder());
   }

   // Hierarchy.
@@ -74,20 +76,18 @@
       }
     }

-    sdd::order_builder<sdd_conf> ob;
+    order_builder ob;
     if (height <= conf.order_min_height)
     {
-      std::string id;
+      order_identifier id;
       for (const auto& p : tmp)
       {
         if (not p.second.empty())
         {
-          id += p.first;
           ob = p.second << ob;
         }
         else // place
         {
-          id += p.first;
           ob.push(p.first, p.second);
         }
       }
@@ -101,7 +101,7 @@
       }
     }

-    return make_pair(m.id , ob);
+    return std::make_pair(order_identifier(m.id) , ob);
   }
 };


Removed duplicated line of code in Canvas2DLayerBridge due to merge conflict resolution error

TBR=senorblanco
BUG=240881, 226928, 237799

Review URL: https://codereview.chromium.org/19117003

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@154144 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp
+++ Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp
@@ -85,7 +85,6 @@
     ASSERT(m_canvas);
     // Used by browser tests to detect the use of a Canvas2DLayerBridge.
     TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation");
-    m_canvas->setNotificationClient(this);
     m_layer = adoptPtr(WebKit::Platform::current()->compositorSupport()->createExternalTextureLayer(this));
     m_layer->setOpaque(opacityMode == Opaque);
     GraphicsLayer::registerContentsLayer(m_layer->layer());