Commits

Anonymous committed d21dc2e

CWS-TOOLING: integrate CWS sw32numbf01
2009-09-04 10:01:07 +0200 od r275780 : #i95907# method <SwWrtShell::NumOfBulletOn(..)>
- adjust indentation of newly created automatic list style
--> due to MRU add actual paragraph indentation to created automatic list style's indentation
2009-09-02 11:57:40 +0200 od r275703 : #i95907# method <SwTxtMargin::CtorInitTxtMargin(..)>
- correct handling of paragraph indents, when list level indents are applicable.
2009-09-01 16:59:47 +0200 od r275671 : CWS-TOOLING: rebase CWS sw32numbf01 to trunk@275331 (milestone: DEV300:m56)
2009-08-28 16:42:34 +0200 od r275540 : #i102458# method <SwFlowFrm::CalcUpperSpace(..)>
- correct handling of leading line spacing
method <GetSpacingValuesOfFrm(..)>
- add output parameter <obIsLineSpacingProportional>
2009-08-27 17:03:07 +0200 od r275496 : #i101516# method <SwTxtNode::SwTxtNode(..)>
- in case that the paragraph is add to a list, apply paragraph style's assigned
outline style list level as list level, if paragraph has no list level set already.
2009-08-27 15:23:34 +0200 od r275489 : #i101234# method <SwWrtShell::NumOrBulletOn(..)>
- check before activation of certain list level of outline numbering,
a numbering format is already set. In this only continue the outline numbering.
2009-08-27 14:15:07 +0200 od r275483 : #i95907# method <SwWrtShell::NumOrBulletOn(..)>
- consider leading tab stops and intentation of paragraph first text line,
when a new list style is created for its application to the selection.
2009-08-26 09:51:39 +0200 od r275401 : #i86492# Adjust copy of text nodes regarding lists
- copy of part of paragraph in list does not copy list style and list id
- copy of paragraphs in list into another list continues destination list
- copy of paragraphs (at least one not in a list) at empty paragraph following a list
does not continue the destination list.
2009-08-25 10:30:53 +0200 od r275339 : #i101349# method <XMLTextImportHelper::SetStyleAndAttrs(..)
- assure that list style of automatic paragraph style is applied at paragraph.

Comments (0)

Files changed (13)

     // <--
     void SetCounted( const SwPaM&, bool bCounted);
 
-    /**
-       Replace numbering rules in a PaM by another numbering rule.
+    // --> OD 2009-08-25 #i86492#
+    // no longer needed.
+    // SwDoc::SetNumRule( rPaM, rNumRule, false, <ListId>, sal_True, true ) have to be used instead.
+//    /**
+//       Replace numbering rules in a PaM by another numbering rule.
 
-       \param rPaM         PaM to replace the numbering rules in
-       \param rNumRule     numbering rule to replace the present numbering rules
-     */
-    void ReplaceNumRule(const SwPaM & rPaM, const SwNumRule & rNumRule);
+//       \param rPaM         PaM to replace the numbering rules in
+//       \param rNumRule     numbering rule to replace the present numbering rules
+//     */
+//    void ReplaceNumRule(const SwPaM & rPaM, const SwNumRule & rNumRule);
 
     void MakeUniqueNumRules(const SwPaM & rPaM);
 
                            - FALSE: search backward
 	   \param bNum		   - TRUE:  search for enumeration
 		                   - FALSE: search for itemize
-       \param bOutline     - TRUE:  search for non-outline numbering rule
-                           - FALSE: search for outline numbering rule
+       \param bOutline     - TRUE:  search for outline numbering rule
+                           - FALSE: search for non-outline numbering rule
        \param nNonEmptyAllowed   number of non-empty paragraphs allowed between
                                  rPos and found paragraph
 
         input parameter - boolean, indicating, if start node, determined by given
         start position has to be investigated or not.
      */
-    const SwNumRule * SearchNumRule(SwPosition & rPos,
-                                    BOOL bForward,
-                                    BOOL bNum,
-									BOOL bOutline,
+    const SwNumRule * SearchNumRule(const SwPosition & rPos,
+                                    const bool bForward,
+                                    const bool bNum,
+                                    const bool bOutline,
                                     int nNonEmptyAllowed,
                                     String& sListId,
-                                    bool bInvestigateStartNode = false );
+                                    const bool bInvestigateStartNode = false );
 
 		// Absaetze ohne Numerierung, aber mit Einzuegen
 	sal_Bool NoNum( const SwPaM& );

sw/inc/editsh.hxx

     // --> OD 2008-03-18 #refactorlists# - add output parameter <sListId>
     // in case a list style is found, <sListId> holds the list id, to which the
     // text node belongs, which applies the found list style.
-    const SwNumRule * SearchNumRule(BOOL bForward,
-                                    BOOL bNum,
-                                    BOOL bOutline,
+    const SwNumRule * SearchNumRule(const bool bForward,
+                                    const bool bNum,
+                                    const bool bOutline,
                                     int nNonEmptyAllowed,
                                     String& sListId );
     // <--

sw/source/core/doc/docnum.cxx

     }
 }
 
-void SwDoc::ReplaceNumRule(const SwPaM & rPaM, const SwNumRule & rNumRule)
-{
-    if (DoesUndo())
-        StartUndo(UNDO_START, NULL);
-
-	ULONG nStt = rPaM.Start()->nNode.GetIndex();
-	ULONG nEnd = rPaM.End()->nNode.GetIndex();
-
-    for (ULONG n = nStt; n <= nEnd; n++)
-    {
-        SwTxtNode * pCNd = GetNodes()[n]->GetTxtNode();
-
-        if (pCNd && NULL != pCNd->GetNumRule())
-        {
-            SwPaM aPam(*pCNd);
-
-            Insert(aPam, SwNumRuleItem(rNumRule.GetName()), 0);
-        }
-    }
-
-    if (DoesUndo())
-        EndUndo(UNDO_START, NULL);
-}
+//void SwDoc::ReplaceNumRule(const SwPaM & rPaM, const SwNumRule & rNumRule)
+//{
+//    if (DoesUndo())
+//        StartUndo(UNDO_START, NULL);
+
+//  ULONG nStt = rPaM.Start()->nNode.GetIndex();
+//  ULONG nEnd = rPaM.End()->nNode.GetIndex();
+
+//    for (ULONG n = nStt; n <= nEnd; n++)
+//    {
+//        SwTxtNode * pCNd = GetNodes()[n]->GetTxtNode();
+
+//        if (pCNd && NULL != pCNd->GetNumRule())
+//        {
+//            SwPaM aPam(*pCNd);
+
+//            Insert(aPam, SwNumRuleItem(rNumRule.GetName()), 0);
+//        }
+//    }
+
+//    if (DoesUndo())
+//        EndUndo(UNDO_START, NULL);
+//}
 
 void SwDoc::SetNumRuleStart( const SwPosition& rPos, BOOL bFlag )
 {
                         SwPosition aPos(*pCNd);
                         aListStyleData.pReplaceNumRule =
                             const_cast<SwNumRule *>
-                            (SearchNumRule( aPos, FALSE, pCNd->HasNumber(),
-                                            FALSE, 0,
+                            (SearchNumRule( aPos, false, pCNd->HasNumber(),
+                                            false, 0,
                                             aListStyleData.sListId, true ));
                     }
 
 				pTNd->ChkCondColl();
 			//else if( !pOutlNd && NO_NUMBERING != //#outline level,zhaojianwei
 			//	((SwTxtFmtColl*)pTNd->GetFmtColl())->GetOutlineLevel() )
-			else if( !pOutlNd && 
+			else if( !pOutlNd &&
 				((SwTxtFmtColl*)pTNd->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle() )//<-end,zhaojianwei
 				pOutlNd = pTNd;
 		}
 
 // -> #i23731#
 // --> OD 2008-03-18 #refactorlists# - add output parameter <sListId>
-const SwNumRule *  SwDoc::SearchNumRule(SwPosition & rPos,
-                                        BOOL bForward,
-                                        BOOL bNum,
-										BOOL bOutline,
+const SwNumRule *  SwDoc::SearchNumRule(const SwPosition & rPos,
+                                        const bool bForward,
+                                        const bool bNum,
+                                        const bool bOutline,
                                         int nNonEmptyAllowed,
                                         String& sListId,
-                                        bool _bInvestigateStartNode)
+                                        const bool bInvestigateStartNode)
 {
     const SwNumRule * pResult = NULL;
     SwTxtNode * pTxtNd = rPos.nNode.GetNode().GetTxtNode();
         do
         {
             // --> OD 2005-10-20 #i55391#
-            if ( !_bInvestigateStartNode )
+            if ( !bInvestigateStartNode )
             {
                 if (bForward)
                     aIdx++;
                 const SwNumRule * pNumRule = pTxtNd->GetNumRule();
                 if (pNumRule)
                 {
-                    if (pNumRule->IsOutlineRule() == bOutline && // #115901#
-                        ( (bNum && pNumRule->Get(0).IsEnumeration()) ||
-                         (!bNum && pNumRule->Get(0).IsItemize()) )) // #i22362#, #i29560#
+                    if ( ( pNumRule->IsOutlineRule() == ( bOutline ? TRUE : FALSE ) ) && // #115901#
+                         ( ( bNum && pNumRule->Get(0).IsEnumeration()) ||
+                           ( !bNum && pNumRule->Get(0).IsItemize() ) ) ) // #i22362#, #i29560#
                     {
                         pResult = pTxtNd->GetNumRule();
                         // --> OD 2008-03-18 #refactorlists#
             }
 
             // --> OD 2005-10-20 #i55391#
-            if ( _bInvestigateStartNode )
+            if ( bInvestigateStartNode )
             {
                 if (bForward)
                     aIdx++;

sw/source/core/docnode/ndcopy.cxx

 // Kopieren eines Bereiches im oder in ein anderes Dokument !
 // Die Position darf nicht im Bereich liegen !!
 
-BOOL lcl_MarksWholeNode(const SwPaM & rPam)
+bool lcl_MarksWholeNode(const SwPaM & rPam)
 {
-    BOOL bResult = FALSE;
-    const SwPosition * pStt = rPam.Start(), * pEnd = rPam.End();
+    bool bResult = false;
+    const SwPosition* pStt = rPam.Start();
+    const SwPosition* pEnd = rPam.End();
 
     if (NULL != pStt && NULL != pEnd)
     {
-        SwTxtNode * pSttNd = pStt->nNode.GetNode().GetTxtNode();
-        SwTxtNode * pEndNd = pEnd->nNode.GetNode().GetTxtNode();
+        const SwTxtNode* pSttNd = pStt->nNode.GetNode().GetTxtNode();
+        const SwTxtNode* pEndNd = pEnd->nNode.GetNode().GetTxtNode();
 
         if (NULL != pSttNd && NULL != pEndNd &&
             pStt->nContent.GetIndex() == 0 &&
             pEnd->nContent.GetIndex() == pEndNd->Len())
         {
-            bResult = TRUE;
+            bResult = true;
         }
     }
 
     return bResult;
 }
 
+// --> OD 2009-08-25 #i86492#
+bool lcl_ContainsOnlyParagraphsInList( const SwPaM& rPam )
+{
+    bool bRet = false;
+
+    const SwTxtNode* pTxtNd = rPam.Start()->nNode.GetNode().GetTxtNode();
+    const SwTxtNode* pEndTxtNd = rPam.End()->nNode.GetNode().GetTxtNode();
+    if ( pTxtNd && pTxtNd->IsInList() &&
+         pEndTxtNd && pEndTxtNd->IsInList() )
+    {
+        bRet = true;
+        SwNodeIndex aIdx(rPam.Start()->nNode);
+
+        do
+        {
+            aIdx++;
+            pTxtNd = aIdx.GetNode().GetTxtNode();
+
+            if ( !pTxtNd || !pTxtNd->IsInList() )
+            {
+                bRet = false;
+                break;
+            }
+        } while ( pTxtNd && pTxtNd != pEndTxtNd );
+    }
+
+
+    return bRet;
+}
+// <--
+
 BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
 					BOOL bMakeNewFrms, bool bCopyAll, SwPaM* pCpyRange ) const
 {
 	SwDoc* pDoc = rPos.nNode.GetNode().GetDoc();
-    bool bColumnSel = pDoc->IsClipBoard() && pDoc->IsColumnSelection();
+    const bool bColumnSel = pDoc->IsClipBoard() && pDoc->IsColumnSelection();
 
-	SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
+    SwPosition* pStt = rPam.Start();
+    SwPosition* pEnd = rPam.End();
+
 	// kein Copy abfangen.
 	if( !rPam.HasMark() || ( *pStt >= *pEnd && !bColumnSel ) ||
 		//JP 29.6.2001: 88963 - dont copy if inspos is in region of start to end
 		( pDoc == this && *pStt <= rPos && rPos < *pEnd ))
 		return FALSE;
 
-	BOOL bEndEqualIns = pDoc == this && rPos == *pEnd;
+    const bool bEndEqualIns = pDoc == this && rPos == *pEnd;
 
 	// falls Undo eingeschaltet, erzeuge das UndoCopy-Objekt
     SwUndoCpyDoc* pUndo = 0;
 
 	SwNodeRange aRg( pStt->nNode, pEnd->nNode );
 	SwNodeIndex aInsPos( rPos.nNode );
-	BOOL bOneNode = pStt->nNode == pEnd->nNode;
-	SwTxtNode* pSttNd = pStt->nNode.GetNode().GetTxtNode();
-	SwTxtNode* pEndNd = pEnd->nNode.GetNode().GetTxtNode();
-	SwTxtNode* pDestNd = aInsPos.GetNode().GetTxtNode();
-	BOOL bCopyCollFmt = !pDoc->IsInsOnlyTextGlossary() && (
-						( pDestNd && !pDestNd->GetTxt().Len() ) ||
-						( !bOneNode && !rPos.nContent.GetIndex() ));
-	BOOL bCopyBookmarks = TRUE;
-	BOOL bStartIsTxtNode = 0 != pSttNd;
+    const bool bOneNode = pStt->nNode == pEnd->nNode;
+    SwTxtNode* pSttTxtNd = pStt->nNode.GetNode().GetTxtNode();
+    SwTxtNode* pEndTxtNd = pEnd->nNode.GetNode().GetTxtNode();
+    SwTxtNode* pDestTxtNd = aInsPos.GetNode().GetTxtNode();
+    bool bCopyCollFmt = !pDoc->IsInsOnlyTextGlossary() &&
+                        ( ( pDestTxtNd && !pDestTxtNd->GetTxt().Len() ) ||
+                          ( !bOneNode && !rPos.nContent.GetIndex() ) );
+    bool bCopyBookmarks = true;
+    BOOL bStartIsTxtNode = 0 != pSttTxtNd;
 
-    // --> OD 2008-03-18 #refactorlists#
-    String aDummy;
-    const SwNumRule * pNumRuleToPropagate =
-        pDoc->SearchNumRule(rPos, FALSE, FALSE, TRUE, 0, aDummy);
+    // --> OD 2009-08-25 #i86492#
+    // Correct the search for a previous list:
+    // First search for non-outline numbering list. Then search for non-outline
+    // bullet list.
+    // Keep also the <ListId> value for possible propagation.
+    String aListIdToPropagate;
+    const SwNumRule* pNumRuleToPropagate =
+        pDoc->SearchNumRule( rPos, false, true, false, 0, aListIdToPropagate, true );
+    if ( !pNumRuleToPropagate )
+    {
+        pNumRuleToPropagate =
+            pDoc->SearchNumRule( rPos, false, false, false, 0, aListIdToPropagate, true );
+    }
+    // <--
+    // --> OD 2009-08-25 #i86492#
+    // Do not propagate previous found list, if
+    // - destination is an empty paragraph which is not in a list and
+    // - source contains at least one paragraph which is not in a list
+    if ( pNumRuleToPropagate &&
+         pDestTxtNd && !pDestTxtNd->GetTxt().Len() && !pDestTxtNd->IsInList() &&
+         !lcl_ContainsOnlyParagraphsInList( rPam ) )
+    {
+        pNumRuleToPropagate = 0;
+    }
     // <--
 
 	// Block, damit aus diesem gesprungen werden kann !!
 	do {
-		if( pSttNd )
+        if( pSttTxtNd )
 		{
 			// den Anfang nicht komplett kopieren ?
 			if( !bCopyCollFmt || bColumnSel || pStt->nContent.GetIndex() )
 			{
 				SwIndex aDestIdx( rPos.nContent );
 				BOOL bCopyOk = FALSE;
-				if( !pDestNd )
+                if( !pDestTxtNd )
 				{
 					if( pStt->nContent.GetIndex() || bOneNode )
-						pDestNd = pDoc->GetNodes().MakeTxtNode( aInsPos,
+                        pDestTxtNd = pDoc->GetNodes().MakeTxtNode( aInsPos,
 							pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD));
 					else
 					{
-						pDestNd = (SwTxtNode*)pSttNd->MakeCopy( pDoc, aInsPos );
+                        pDestTxtNd = static_cast<SwTxtNode*>(pSttTxtNd->MakeCopy( pDoc, aInsPos ));
 						bCopyOk = TRUE;
 					}
-					aDestIdx.Assign( pDestNd, 0 );
-					bCopyCollFmt = TRUE;
+                    aDestIdx.Assign( pDestTxtNd, 0 );
+                    bCopyCollFmt = true;
 				}
 				else if( !bOneNode || bColumnSel )
 				{
 						aCpyPam.Move( fnMoveBackward, fnGoCntnt );
 					}
 
-					pDestNd = pDoc->GetNodes()[ aInsPos.GetIndex()-1 ]->GetTxtNode();
-					aDestIdx.Assign( pDestNd, pDestNd->GetTxt().Len() );
+                    pDestTxtNd = pDoc->GetNodes()[ aInsPos.GetIndex()-1 ]->GetTxtNode();
+                    aDestIdx.Assign( pDestTxtNd, pDestTxtNd->GetTxt().Len() );
 
 					// korrigiere den Bereich wieder !!
 					if( bEndEqualIns )
 							rPam.Exchange();
 
 						aRg.aEnd = pEnd->nNode;
-						pEndNd = pEnd->nNode.GetNode().GetTxtNode();
+                        pEndTxtNd = pEnd->nNode.GetNode().GetTxtNode();
 					}
 					else if( rPos == *pEnd )		// Wurde das Ende auch verschoben
 					{
 						pEnd->nNode--;
-						pEnd->nContent.Assign( pDestNd, nCntntEnd );
+                        pEnd->nContent.Assign( pDestTxtNd, nCntntEnd );
 						aRg.aEnd = pEnd->nNode;
-						pEndNd = pEnd->nNode.GetNode().GetTxtNode();
+                        pEndTxtNd = pEnd->nNode.GetNode().GetTxtNode();
 					}
 				}
 
-				const SfxPoolItem * pItem = NULL;
-                const SfxItemSet * pAttrSet = pDestNd->GetpSwAttrSet();
+				/* #107213#: Safe numrule item at destination. */
+                // --> OD 2009-08-25 #i86492#
+                // Safe also <ListId> item of destination.
+                int aNumRuleState = SFX_ITEM_UNKNOWN;
+				SwNumRuleItem aNumRuleItem;
+                int aListIdState = SFX_ITEM_UNKNOWN;
+                SfxStringItem aListIdItem( RES_PARATR_LIST_ID, String() );
+                {
+                    const SfxItemSet * pAttrSet = pDestTxtNd->GetpSwAttrSet();
+                    if (pAttrSet != NULL)
+                    {
+                        const SfxPoolItem * pItem = NULL;
+                        aNumRuleState = pAttrSet->GetItemState(RES_PARATR_NUMRULE, FALSE, &pItem);
+                        if (SFX_ITEM_SET == aNumRuleState)
+                            aNumRuleItem = *((SwNumRuleItem *) pItem);
 
-				/* #107213#: Safe numrule item at destination. */
-				int aState = SFX_ITEM_UNKNOWN;
-				SwNumRuleItem aNumRuleItem;
-
-				if (pAttrSet != NULL)
-				{
-                    aState =
-                        pAttrSet->GetItemState(RES_PARATR_NUMRULE, FALSE, &pItem);
-
-					if (SFX_ITEM_SET == aState)
-						aNumRuleItem = *((SwNumRuleItem *) pItem);
-				}
+                        aListIdState =
+                            pAttrSet->GetItemState(RES_PARATR_LIST_ID, FALSE, &pItem);
+                        if (SFX_ITEM_SET == aListIdState)
+                        {
+                            aListIdItem.SetValue( static_cast<const SfxStringItem*>(pItem)->GetValue() );
+                        }
+                    }
+                }
+                // <--
 				/* #107213# */
 
 				if( !bCopyOk )
 				{
-					xub_StrLen nCpyLen = ( bOneNode ? pEnd->nContent.GetIndex()
-											: pSttNd->GetTxt().Len() )
-									- pStt->nContent.GetIndex();
-					pSttNd->Copy( pDestNd, aDestIdx, pStt->nContent, nCpyLen );
+                    xub_StrLen nCpyLen = ( bOneNode
+                                           ? pEnd->nContent.GetIndex()
+                                           : pSttTxtNd->GetTxt().Len() )
+                                         - pStt->nContent.GetIndex();
+                    pSttTxtNd->Copy( pDestTxtNd, aDestIdx, pStt->nContent, nCpyLen );
 					if( bEndEqualIns )
 						pEnd->nContent -= nCpyLen;
 				}
 
 				if( bOneNode )
 				{
-					// ist der DestinationNode leer, kopiere die Vorlage mit
 					if( bCopyCollFmt )
 					{
-						pSttNd->CopyCollFmt( *pDestNd );
+                        pSttTxtNd->CopyCollFmt( *pDestTxtNd );
 
                         /* #107213# If only a part of one paragraph is copied
                            restore the numrule at the destination. */
-                        if (! lcl_MarksWholeNode(rPam))
+                        // --> OD 2009-08-25 #i86492#
+                        // restore also <ListId> item
+                        if ( !lcl_MarksWholeNode(rPam) )
                         {
-                            if (SFX_ITEM_SET == aState)
-                                pDestNd->SetAttr(aNumRuleItem);
+                            if (SFX_ITEM_SET == aNumRuleState)
+                            {
+                                pDestTxtNd->SetAttr(aNumRuleItem);
+                            }
                             else
-                                pDestNd->ResetAttr(RES_PARATR_NUMRULE);
+                            {
+                                pDestTxtNd->ResetAttr(RES_PARATR_NUMRULE);
+                            }
+                            if (SFX_ITEM_SET == aListIdState)
+                            {
+                                pDestTxtNd->SetAttr(aListIdItem);
+                            }
+                            else
+                            {
+                                pDestTxtNd->ResetAttr(RES_PARATR_LIST_ID);
+                            }
                         }
                     }
 
 				aRg.aStart++;
 			}
 		}
-		else if( pDestNd )
+        else if( pDestTxtNd )
 		{
             // Problems with insertion of table selections into "normal" text solved.
             // We have to set the correct PaM for Undo, if this PaM starts in a textnode,
             // the undo operation will try to merge this node after removing the table.
             // If we didn't split a textnode, the PaM should start at the inserted table node
-			if( rPos.nContent.GetIndex() == pDestNd->Len() )
+            if( rPos.nContent.GetIndex() == pDestTxtNd->Len() )
 			{    // Insertion at the last position of a textnode (empty or not)
 				aInsPos++; // The table will be inserted behind the text node
 			}
             }
 		}
 
-		pDestNd = aInsPos.GetNode().GetTxtNode();
-		if( pEndNd )
+        pDestTxtNd = aInsPos.GetNode().GetTxtNode();
+        if( pEndTxtNd )
 		{
 			SwIndex aDestIdx( rPos.nContent );
-			if( !pDestNd )
+            if( !pDestTxtNd )
 			{
-				pDestNd = pDoc->GetNodes().MakeTxtNode( aInsPos,
+                pDestTxtNd = pDoc->GetNodes().MakeTxtNode( aInsPos,
 							pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD));
-				aDestIdx.Assign( pDestNd, 0  );
+                aDestIdx.Assign( pDestTxtNd, 0  );
 				aInsPos--;
 
                 // #112756# #98130# if we have to insert an extra text node
                 bStartIsTxtNode = TRUE;
 			}
 
-			const SfxPoolItem * pItem = NULL;
-            const SfxItemSet* pAttrSet = pDestNd->GetpSwAttrSet();
+			/* #107213# Save numrule at destination */
+            // --> OD 2009-08-25 #i86492#
+            // Safe also <ListId> item of destination.
+            int aNumRuleState = SFX_ITEM_UNKNOWN;
+            SwNumRuleItem aNumRuleItem;
+            int aListIdState = SFX_ITEM_UNKNOWN;
+            SfxStringItem aListIdItem( RES_PARATR_LIST_ID, String() );
+            {
+                const SfxItemSet* pAttrSet = pDestTxtNd->GetpSwAttrSet();
+                if (pAttrSet != NULL)
+                {
+                    const SfxPoolItem * pItem = NULL;
 
-			/* #107213# Save numrule at destination */
-			int aState = SFX_ITEM_UNKNOWN;
-			SwNumRuleItem aNumRuleItem;
+                    aNumRuleState =
+                        pAttrSet->GetItemState(RES_PARATR_NUMRULE, FALSE, &pItem);
+                    if (SFX_ITEM_SET == aNumRuleState)
+                        aNumRuleItem = *((SwNumRuleItem *) pItem);
 
-			if (pAttrSet != NULL)
-			{
-                aState =
-                    pAttrSet->GetItemState(RES_PARATR_NUMRULE, FALSE, &pItem);
-
-				if (SFX_ITEM_SET == aState)
-					aNumRuleItem = *((SwNumRuleItem *) pItem);
-			}
+                    aListIdState =
+                        pAttrSet->GetItemState(RES_PARATR_LIST_ID, FALSE, &pItem);
+                    if (SFX_ITEM_SET == aListIdState)
+                        aListIdItem.SetValue( static_cast<const SfxStringItem*>(pItem)->GetValue() );
+                }
+            }
+            // <--
 			/* #107213# */
 
-			BOOL bEmptyDestNd = 0 == pDestNd->GetTxt().Len();
-			pEndNd->Copy( pDestNd, aDestIdx, SwIndex( pEndNd ),
+            BOOL bEmptyDestNd = 0 == pDestTxtNd->GetTxt().Len();
+            pEndTxtNd->Copy( pDestTxtNd, aDestIdx, SwIndex( pEndTxtNd ),
 							pEnd->nContent.GetIndex() );
 
 			// auch alle FormatVorlagen kopieren
 			if( bCopyCollFmt && ( bOneNode || bEmptyDestNd ))
 			{
-				pEndNd->CopyCollFmt( *pDestNd );
+                pEndTxtNd->CopyCollFmt( *pDestTxtNd );
 
-				if (bOneNode)
+                if ( bOneNode )
 				{
 					/* #107213# If only a part of one paragraph is copied
                        restore the numrule at the destination. */
-                    if ( ! lcl_MarksWholeNode(rPam))
+                    // --> OD 2009-08-25 #i86492#
+                    // restore also <ListId> item
+                    if ( !lcl_MarksWholeNode(rPam) )
                     {
-                        if (SFX_ITEM_SET == aState)
-                            pDestNd->SetAttr(aNumRuleItem);
+                        if (SFX_ITEM_SET == aNumRuleState)
+                        {
+                            pDestTxtNd->SetAttr(aNumRuleItem);
+                        }
                         else
-                            pDestNd->ResetAttr(RES_PARATR_NUMRULE);
+                        {
+                            pDestTxtNd->ResetAttr(RES_PARATR_NUMRULE);
+                        }
+                        if (SFX_ITEM_SET == aListIdState)
+                        {
+                            pDestTxtNd->SetAttr(aListIdItem);
+                        }
+                        else
+                        {
+                            pDestTxtNd->ResetAttr(RES_PARATR_LIST_ID);
+                        }
                     }
 				}
 			}
 		if( bCopyAll || aRg.aStart != aRg.aEnd )
 		{
 			SfxItemSet aBrkSet( pDoc->GetAttrPool(), aBreakSetRange );
-            if( pSttNd && bCopyCollFmt && pDestNd->HasSwAttrSet() )
+            if( pSttTxtNd && bCopyCollFmt && pDestTxtNd->HasSwAttrSet() )
 			{
-				aBrkSet.Put( *pDestNd->GetpSwAttrSet() );
+                aBrkSet.Put( *pDestTxtNd->GetpSwAttrSet() );
 				if( SFX_ITEM_SET == aBrkSet.GetItemState( RES_BREAK, FALSE ) )
-					pDestNd->ResetAttr( RES_BREAK );
+                    pDestTxtNd->ResetAttr( RES_BREAK );
 				if( SFX_ITEM_SET == aBrkSet.GetItemState( RES_PAGEDESC, FALSE ) )
-					pDestNd->ResetAttr( RES_PAGEDESC );
+                    pDestTxtNd->ResetAttr( RES_PAGEDESC );
 			}
 
 			if( aInsPos == pEnd->nNode )
 			else
                 CopyWithFlyInFly( aRg, pEnd->nContent.GetIndex(), aInsPos, bMakeNewFrms, FALSE );
 
-			bCopyBookmarks = FALSE;
+            bCopyBookmarks = false;
 
 			// harte Umbrueche wieder in den ersten Node setzen
-			if( aBrkSet.Count() && 0 != ( pDestNd = pDoc->GetNodes()[
+            if( aBrkSet.Count() && 0 != ( pDestTxtNd = pDoc->GetNodes()[
 					aCpyPam.GetPoint()->nNode.GetIndex()+1 ]->GetTxtNode() ) )
 			{
-                pDestNd->SetAttr( aBrkSet );
+                pDestTxtNd->SetAttr( aBrkSet );
 			}
 		}
 	} while( FALSE );
 		*pCpyRange->GetMark() = *aCpyPam.GetMark();
 	}
 
-    if (pNumRuleToPropagate)
-        pDoc->ReplaceNumRule(aCpyPam, *pNumRuleToPropagate);
+    if ( pNumRuleToPropagate )
+    {
+        // --> OD 2009-08-25 #i86492#
+        // use <SwDoc::SetNumRule(..)>, because it also handles the <ListId>
+//        pDoc->ReplaceNumRule(aCpyPam, *pNumRuleToPropagate);
+        pDoc->SetNumRule( aCpyPam, *pNumRuleToPropagate, false,
+                          aListIdToPropagate, sal_True, true );
+    }
 
 	pDoc->SetRedlineMode_intern( eOld );
 	pDoc->SetModified();
 
 //  ----- Copy-Methode vom SwDoc - "kopiere Fly's in Fly's" ------
 
-void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex, 
+void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex,
 							const SwNodeIndex& rInsPos, BOOL bMakeNewFrms,
 							BOOL bDelRedlines, BOOL bCopyFlyAtFly ) const
 {
                 {
                     if( bAtCntnt )
                         bAdd = nEndContentIndex > 0;
-                    else 
+                    else
                         bAdd = pAPos->nContent <= nEndContentIndex;
                 }
             }
-            if( bAdd )                
+            if( bAdd )
                 aArr.Insert( _ZSortFly( pFmt, pAnchor, nArrLen + aArr.Count() ));
 		}
 	}

sw/source/core/edit/ednumber.cxx

 //            BYTE nTmpLvl = GetRealLevel( pTmpNd->GetTxtNode()->
 //                                    GetTxtColl()->GetOutlineLevel() );
  //           int nTmpLvl = pTmpNd->GetTxtNode()->GetOutlineLevel();//#outline level,zhaojianwei
-            int nTmpLvl = pTmpNd->GetTxtNode()->GetAttrOutlineLevel();	
+            int nTmpLvl = pTmpNd->GetTxtNode()->GetAttrOutlineLevel();
  //           ASSERT( nTmpLvl >= 0 && nTmpLvl < MAXLEVEL,
             ASSERT( nTmpLvl >= 0 && nTmpLvl <= MAXLEVEL,			//<-end,zhaojianwei
                     "<SwEditShell::IsProtectedOutlinePara()>" );
 
   -----------------------------------------------------------------------*/
 // --> OD 2008-03-18 #refactorlists#
-const SwNumRule * SwEditShell::SearchNumRule( BOOL bForward,
-                                              BOOL bNum,
-                                              BOOL bOutline,
+const SwNumRule * SwEditShell::SearchNumRule( const bool bForward,
+                                              const bool bNum,
+                                              const bool bOutline,
                                               int nNonEmptyAllowed,
                                               String& sListId )
 {

sw/source/core/inc/frmtool.hxx

     OD 2004-03-10 #i28701#
     Values only provided for flow frames (table, section or text frames)
     Note: line spacing value is only determined for text frames
+    OD 2009-08-28 #i102458#
+    Add output parameter <obIsLineSpacingProportional>
 
-    @param _rFrm
+    @param rFrm
     input parameter - frame, for which the spacing values are determined.
 
-    @param _roPrevLowerSpacing
+    @param onPrevLowerSpacing
     output parameter - lower spacing of the frame in SwTwips
 
-    @param _roPrevLineSpacing
+    @param onPrevLineSpacing
     output parameter - line spacing of the frame in SwTwips
 
+    @param obIsLineSpacingProportional
+
     @author OD
 */
-void GetSpacingValuesOfFrm( const SwFrm& _rFrm,
-                            SwTwips& _roLowerSpacing,
-                            SwTwips& _roLineSpacing );
+void GetSpacingValuesOfFrm( const SwFrm& rFrm,
+                            SwTwips& onLowerSpacing,
+                            SwTwips& onLineSpacing,
+                            bool& obIsLineSpacingProportional );
 
 /** method to get the content of the table cell
 

sw/source/core/layout/flowfrm.cxx

             // values of found previous frame and use these values.
             SwTwips nPrevLowerSpace = 0;
             SwTwips nPrevLineSpacing = 0;
-            GetSpacingValuesOfFrm( (*pPrevFrm), nPrevLowerSpace, nPrevLineSpacing );
+            // --> OD 2009-08-28 #i102458#
+            bool bPrevLineSpacingPorportional = false;
+            GetSpacingValuesOfFrm( (*pPrevFrm),
+                                   nPrevLowerSpace, nPrevLineSpacing,
+                                   bPrevLineSpacingPorportional );
+            // <--
             if( pIDSA->get(IDocumentSettingAccess::PARA_SPACE_MAX) )
             {
                 nUpper = nPrevLowerSpace + pAttrs->GetULSpace().GetUpper();
                     //      building its maximum.
                     if ( pOwn->IsTxtFrm() )
                     {
-                        nAdd += static_cast<SwTxtFrm&>(rThis).GetLineSpace( true );
+                        // --> OD 2009-08-28 #i102458#
+                        // Correction:
+                        // A proportional line spacing of the previous text frame
+                        // is added up to a own leading line spacing.
+                        // Otherwise, the maximum of the leading line spacing
+                        // of the previous text frame and the own leading line
+                        // spacing is built.
+                        if ( bPrevLineSpacingPorportional )
+                        {
+                            nAdd += static_cast<SwTxtFrm&>(rThis).GetLineSpace( true );
+                        }
+                        else
+                        {
+                            nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) );
+                        }
+                        // <--
                     }
                     nUpper += nAdd;
                 }
                     SwTwips nAdd = nPrevLineSpacing;
                     if ( pOwn->IsTxtFrm() )
                     {
-                        nAdd += static_cast<SwTxtFrm&>(rThis).GetLineSpace( true );
+                        // --> OD 2009-08-28 #i102458#
+                        // Correction:
+                        // A proportional line spacing of the previous text frame
+                        // is added up to a own leading line spacing.
+                        // Otherwise, the maximum of the leading line spacing
+                        // of the previous text frame and the own leading line
+                        // spacing is built.
+                        if ( bPrevLineSpacingPorportional )
+                        {
+                            nAdd += static_cast<SwTxtFrm&>(rThis).GetLineSpace( true );
+                        }
+                        else
+                        {
+                            nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) );
+                        }
+                        // <--
                     }
                     nUpper += nAdd;
                 }
     {
         SwTwips nPrevLowerSpace = 0;
         SwTwips nPrevLineSpacing = 0;
-        GetSpacingValuesOfFrm( (*pPrevFrm), nPrevLowerSpace, nPrevLineSpacing );
+        // --> OD 2009-08-28 #i102458#
+        bool bDummy = false;
+        GetSpacingValuesOfFrm( (*pPrevFrm), nPrevLowerSpace, nPrevLineSpacing, bDummy );
+        // <--
         if ( nPrevLowerSpace > 0 || nPrevLineSpacing > 0 )
         {
             const IDocumentSettingAccess* pIDSA = rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess();
 		return (SwSectionFrm*)pFrm;
 	return 0;
 }
-
-
-
-
-

sw/source/core/layout/frmtool.cxx

 /** method to determine the spacing values of a frame
 
     OD 2004-03-10 #i28701#
+    OD 2009-08-28 #i102458#
+    Add output parameter <obIsLineSpacingProportional>
 
     @author OD
 */
-void GetSpacingValuesOfFrm( const SwFrm& _rFrm,
-                            SwTwips& _roLowerSpacing,
-                            SwTwips& _roLineSpacing )
+void GetSpacingValuesOfFrm( const SwFrm& rFrm,
+                            SwTwips& onLowerSpacing,
+                            SwTwips& onLineSpacing,
+                            bool& obIsLineSpacingProportional )
 {
-    if ( !_rFrm.IsFlowFrm() )
+    if ( !rFrm.IsFlowFrm() )
     {
-        _roLowerSpacing = 0L;
-        _roLineSpacing = 0L;
+        onLowerSpacing = 0;
+        onLineSpacing = 0;
     }
     else
     {
-        const SvxULSpaceItem& rULSpace = _rFrm.GetAttrSet()->GetULSpace();
-        _roLowerSpacing = rULSpace.GetLower();
-
-        _roLineSpacing = 0;
-        if ( _rFrm.IsTxtFrm() )
+        const SvxULSpaceItem& rULSpace = rFrm.GetAttrSet()->GetULSpace();
+        onLowerSpacing = rULSpace.GetLower();
+
+        onLineSpacing = 0;
+        obIsLineSpacingProportional = false;
+        if ( rFrm.IsTxtFrm() )
         {
-            _roLineSpacing = static_cast<const SwTxtFrm&>(_rFrm).GetLineSpace();
+            onLineSpacing = static_cast<const SwTxtFrm&>(rFrm).GetLineSpace();
+            obIsLineSpacingProportional =
+                onLineSpacing != 0 &&
+                static_cast<const SwTxtFrm&>(rFrm).GetLineSpace( true ) == 0;
         }
 
-        ASSERT( _roLowerSpacing >= 0 && _roLineSpacing >= 0,
+        ASSERT( onLowerSpacing >= 0 && onLineSpacing >= 0,
                 "<GetSpacingValuesOfFrm(..)> - spacing values aren't positive!" );
     }
 }

sw/source/core/text/itrcrsr.cxx

 	GetInfo().SetFont( GetFnt() );
 	const SwTxtNode *pNode = pFrm->GetTxtNode();
 
-	const SvxLRSpaceItem &rSpace =
-		pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace();
+    const SvxLRSpaceItem &rSpace = pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace();
+    // --> OD 2009-09-02 #i95907#
+    const bool bListLevelIndentsApplicable = pFrm->GetTxtNode()->AreListLevelIndentsApplicable();
+    // <--
 
     //
     // Carefully adjust the text formatting ranges.
                 pFrm->Prt().Left() +
                 nLMWithNum -
                 pNode->GetLeftMarginWithNum( sal_False ) -
-                rSpace.GetLeft() +
-                rSpace.GetTxtLeft();
+                // --> OD 2009-09-02 #i95907#
+//                rSpace.GetLeft() +
+//                rSpace.GetTxtLeft();
+                ( bListLevelIndentsApplicable
+                  ? 0
+                  : ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) );
+                // <--
     }
     else
     {
                     pFrm->Prt().Left() +
                     nLMWithNum -
                     pNode->GetLeftMarginWithNum( sal_False ) -
-                    rSpace.GetLeft() +
-                    rSpace.GetTxtLeft();
+                    // --> OD 2009-09-02 #i95907#
+//                    rSpace.GetLeft() +
+//                    rSpace.GetTxtLeft();
+                    ( bListLevelIndentsApplicable
+                      ? 0
+                      : ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) );
+                    // <--
         }
         else
         {

sw/source/core/txtnode/ndtxt.cxx

       mpNodeNum( 0 ),
       m_bLastOutlineState( false ),
       m_bNotifiable( false ),
-      //nOutlineLevel( pTxtColl->GetOutlineLevel() )//#outline level, removed by zhaojianwei.
       // --> OD 2008-11-19 #i70748#
       mbEmptyListStyleSetDueToSetOutlineLevelAttr( false ),
       // <--
 //    SyncNumberAndNumRule();
     if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 )
     {
+        // --> OD 2009-08-27 #i101516#
+        // apply paragraph style's assigned outline style list level as
+        // list level of the paragraph, if it has none set already.
+        if ( !HasAttrListLevel() &&
+             pTxtColl && pTxtColl->IsAssignedToListLevelOfOutlineStyle() )
+        {
+            SetAttrListLevel( pTxtColl->GetAssignedOutlineStyleLevel() );
+        }
+        // <--
         AddToList();
     }
     // <--

sw/source/ui/shells/textsh1.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
                     if (bForParagraph)
                         SwLangHelper::SelectCurrentPara( rWrtSh );
-		
+
 					if (!bForSelection) // document language to be changed...
                     {
 						rWrtSh.SelAll();
 			GetView().GetViewFrame()->ToggleChildWindow(SID_HYPERLINK_DIALOG);
 		break;
         case FN_REMOVE_HYPERLINK:
-        {    
+        {
             BOOL bSel = rWrtSh.HasSelection();
             if(!bSel)
             {
             // --> OD 2008-03-18 #refactorlists#
             String sContinuedListId;
             const SwNumRule* pRule =
-                rWrtSh.SearchNumRule( FALSE, TRUE, FALSE, -1, sContinuedListId );
+                rWrtSh.SearchNumRule( false, true, false, -1, sContinuedListId );
+            // --> OD 2009-08-26 #i86492#
+            // Search also for bullet list
+            if ( !pRule )
+            {
+                pRule = rWrtSh.SearchNumRule( false, false, false, -1, sContinuedListId );
+            }
+            // <--
             if ( pRule )
             {
                 rWrtSh.SetCurNumRule( *pRule, false, sContinuedListId );
             break;
             case FN_NUM_CONTINUE:
             {
-                if ( rSh.GetCurNumRule() )
-                    rSet.DisableItem(nWhich);
-                else
+                // --> OD 2009-08-26 #i86492#
+                // Allow continuation of previous list, even if at current cursor
+                // a list is active.
+//                if ( rSh.GetCurNumRule() )
+//                    rSet.DisableItem(nWhich);
+//                else
+                // <--
                 {
-                    // --> OD 2008-03-18 #refactorlists#
+                    // --> OD 2009-08-26 #i86492#
+                    // Search also for bullet list
                     String aDummy;
                     const SwNumRule* pRule =
-                            rSh.SearchNumRule( FALSE, TRUE, FALSE, -1, aDummy );
+                            rSh.SearchNumRule( false, true, false, -1, aDummy );
+                    if ( !pRule )
+                    {
+                        pRule = rSh.SearchNumRule( false, false, false, -1, aDummy );
+                    }
                     // <--
                     if ( !pRule )
                         rSet.DisableItem(nWhich);

sw/source/ui/wrtsh/wrtsh1.cxx

     try
     {
         sal_Int32 nState = xObj->getCurrentState();
-        if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE 
+        if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE
           || nState == ::com::sun::star::embed::EmbedStates::UI_ACTIVE )
         {
-            SfxInPlaceClient* pCli = 
+            SfxInPlaceClient* pCli =
 				GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) );
             if ( pCli )
             {
                     pDoc->FindNumRulePtr(pColl->GetNumRule( FALSE ).GetValue());
             if ( !pDirectCollRule )
             {
-                pCollRule = 0L;
+                pCollRule = 0;
             }
         }
         // --> OD 2006-11-20 #i71764#
                 {
                     // check, if numbering of the outline level of the pararaph
                     // style is active. If not, activate this outline level.
-                    //nActivateOutlineLvl = pColl->GetOutlineLevel();		//#outline level,zhaojianwei
-	                //ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL,
 					nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
                     ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),	//<-end,zhaojianwei
                             "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
-                    //if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL &&	//#outline level,zhaojianwei
                     if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&		//<-end,zhaojianwei
                          pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
                             == SVX_NUM_NUMBER_NONE )
                 }
                 else
                 {
+                    // --> OD 2009-08-27 #i101234#
                     // activate outline numbering, because from the precondition
                     // it's known, that <SwEdit::HasNumber()> == FALSE
                     bActivateOutlineRule = true;
-                    //nActivateOutlineLvl = pColl->GetOutlineLevel();		//#outline level,zhaojianwei
 					nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei
                 }
             }
             else if ( !pNumRule )
             {
-                // activate outline numbering, because from the precondition
-                // it's known, that <SwEdit::HasNumber()> == FALSE
-                bActivateOutlineRule = true;
-                //nActivateOutlineLvl = pColl->GetOutlineLevel();	//#outline level,zhaojianwei
-				nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei,need further consideration
+                // --> OD 2009-08-27 #i101234#
+                // Check, if corresponding list level of the outline numbering
+                // has already a numbering format set.
+                nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei,need further consideration
+                if ( pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
+                                == SVX_NUM_NUMBER_NONE )
+                {
+                    // activate outline numbering, because from the precondition
+                    // it's known, that <SwEdit::HasNumber()> == FALSE
+                    bActivateOutlineRule = true;
+                }
+                else
+                {
+                    // turning on outline numbering at current cursor position
+                    bContinueFoundNumRule = true;
+                }
+                // <--
             }
             else
             {
                 // check, if numbering of the outline level of the pararaph
                 // style is active. If not, activate this outline level.
-                //nActivateOutlineLvl = pColl->GetOutlineLevel();
 				nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei
-                //ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL,
                 ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei
                         "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
-                //if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL &&
                 if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei
                      pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
                         == SVX_NUM_NUMBER_NONE )
     {
         if ( !pNumRule->IsAutoRule() )
         {
-            pNumRule = 0L;
+            pNumRule = 0;
         }
         else if ( pNumRule == GetDoc()->GetOutlineNumRule() &&
                   !bActivateOutlineRule && !bContinueFoundNumRule )
         {
-            pNumRule = 0L;
+            pNumRule = 0;
         }
     }
     // <--
     if ( !pNumRule )
     {
         pNumRule = GetDoc()->SearchNumRule( *GetCrsr()->GetPoint(),
-                                            FALSE, bNum, FALSE, 0,
+                                            false, bNum, false, 0,
                                             sContinuedListId );
         bContinueFoundNumRule = pNumRule != 0;
     }
     }
     else
     {
+        // --> OD 2009-08-27 #i95907#
+        const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode(
+                                    numfunc::GetDefaultPositionAndSpaceMode() );
         // --> OD 2008-02-11 #newlistlevelattrs#
-        SwNumRule aNumRule( GetUniqueNumRuleName(),
-                            // --> OD 2008-06-06 #i89178#
-                            numfunc::GetDefaultPositionAndSpaceMode() );
-                            // <--
+        SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode );
+        // <--
         // <--
         // Zeichenvorlage an die Numerierung haengen
         SwCharFmt* pChrFmt;
             pChrFmt = GetCharFmtFromPool( RES_POOLCHR_BUL_LEVEL );
         }
 
-        SwTxtNode * pTxtNode =
-            GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
-        USHORT nWidthOfTabs = pTxtNode->GetWidthOfLeadingTabs();
+        const SwTxtNode* pTxtNode = GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
+        const SwTwips nWidthOfTabs = pTxtNode
+                                     ? pTxtNode->GetWidthOfLeadingTabs()
+                                     : 0;
         GetDoc()->RemoveLeadingWhiteSpace( *GetCrsr()->GetPoint() );
 
         const bool bHtml = 0 != PTR_CAST(SwWebDocShell, pDocSh);
                 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
             }
 
-            if(bHtml && nLvl)
+            // --> OD 2009-08-26 #i95907#
+            if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
             {
-                // 1/2" fuer HTML
-                aFmt.SetLSpace(720);
-                aFmt.SetAbsLSpace(nLvl * 720);
+                if(bHtml && nLvl)
+                {
+                    // 1/2" fuer HTML
+                    aFmt.SetLSpace(720);
+                    aFmt.SetAbsLSpace(nLvl * 720);
+                }
+                else if ( nWidthOfTabs > 0 )
+                {
+                    aFmt.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
+                }
             }
-            else if ( nWidthOfTabs > 0 )
-            {
-                aFmt.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
-            }
+            // <--
 
             // --> FME 2005-01-21 #i38904#  Default alignment for
             // numbering/bullet should be rtl in rtl paragraph:
             aNumRule.Set( nLvl, aFmt );
         }
 
+        // --> OD 2009-08-26 #i95907#
+        if ( pTxtNode &&
+             ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
+        {
+            short nTxtNodeFirstLineOffset( 0 );
+            pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset );
+            const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() +
+                                           nTxtNodeFirstLineOffset;
+            if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 )
+            {
+                const SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs;
+                aNumRule.ChangeIndent( nIndentChange );
+            }
+        }
+        // <--
         // --> OD 2008-02-08 #newlistlevelattrs#
         // reset indent attribute on applying list style
         // --> OD 2008-03-17 #refactorlists#

xmloff/source/text/txtimp.cxx

 
         if (pListBlock || pNumberedParagraph)
 		{
-			sal_Bool bSameNumRules = xNewNumRules == xNumRules;
-			if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
-			{
-				// If the interface pointers are different then this does
-				// not mean that the num rules are different. Further tests
-				// are required then. However, if only one num rule is
-				// set, no tests are required of course.
-				Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
-				Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
-				if( xNewNamed.is() && xNamed.is() )
-				{
-					bSameNumRules = xNewNamed->getName() == xNamed->getName();
-				}
-				else
-				{
-                	Reference< XAnyCompare > xNumRuleCompare( xNumRules, UNO_QUERY );
-					if( xNumRuleCompare.is() )
-					{
-						bSameNumRules = (xNumRuleCompare->compare( Any(xNumRules), Any(xNewNumRules) ) == 0);
-					}
-				}
-			}
+            // --> OD 2009-08-24 #i101349#
+            // Assure that list style of automatic paragraph style is applied at paragraph.
+            sal_Bool bApplyNumRules = pStyle && pStyle->IsListStyleSet();
+            if ( !bApplyNumRules )
+            {
+                sal_Bool bSameNumRules = xNewNumRules == xNumRules;
+                if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
+                {
+                    // If the interface pointers are different then this does
+                    // not mean that the num rules are different. Further tests
+                    // are required then. However, if only one num rule is
+                    // set, no tests are required of course.
+                    Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
+                    Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
+                    if( xNewNamed.is() && xNamed.is() )
+                    {
+                        bSameNumRules = xNewNamed->getName() == xNamed->getName();
+                    }
+                    else
+                    {
+                        Reference< XAnyCompare > xNumRuleCompare( xNumRules, UNO_QUERY );
+                        if( xNumRuleCompare.is() )
+                        {
+                            bSameNumRules = (xNumRuleCompare->compare( Any(xNumRules), Any(xNewNumRules) ) == 0);
+                        }
+                    }
+                }
+                bApplyNumRules = !bSameNumRules;
+            }
 
-			if( !bSameNumRules )
+            if ( bApplyNumRules )
+            // <--
 			{
                 // #102607# This may except when xNewNumRules contains
                 // a Writer-NumRule-Implementation bug gets applied to
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.