[Libreoffice-commits] .: sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Dec 16 01:39:19 PST 2010


 sw/source/core/txtnode/ndtxt.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 96e25876f58a385cf82b39d132a347e726959abe
Author: Octavio Alvarez <alvarezp at alvarezp.ods.org>
Date:   Thu Dec 16 09:34:28 2010 +0000

    sw: reset num level on SplitNode if parent is outline i#93970
    
    Fixes the following scenario:
    1. Create a paragraph style "S" bound to a list style.
    2. Set the Heading 2 next style to "S".
    3. Pressing ENTER at the end of a Heading 2 will create the new
       paragraph, but its numbering level will be set to 2.
    
    If this test is repeated for "Heading 3", the resulting paragraph
    will end up with numbering level == 3.
    
    It fixes i#93970

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 62caad9..5fbea95 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -365,6 +365,8 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
 
 SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
 {
+    bool parentIsOutline = IsOutline();
+
     // lege den Node "vor" mir an
     const xub_StrLen nSplitPos = rPos.nContent.GetIndex();
     const xub_StrLen nTxtLen = m_Text.Len();
@@ -386,7 +388,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
     ResetAttr( RES_PARATR_LIST_ISRESTART );
     ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
     ResetAttr( RES_PARATR_LIST_ISCOUNTED );
-    if ( GetNumRule() == 0 )
+    if ( GetNumRule() == 0 || (parentIsOutline && !IsOutline()) )
     {
         ResetAttr( RES_PARATR_LIST_ID );
         ResetAttr( RES_PARATR_LIST_LEVEL );


More information about the Libreoffice-commits mailing list