]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't reset bullet number and outline number when applying style sheet.
authorJulian Smart <julian@anthemion.co.uk>
Tue, 3 Aug 2010 17:15:33 +0000 (17:15 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 3 Aug 2010 17:15:33 +0000 (17:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp

index c4b472a4913fed52bf34d38319fde5f15ab0bb4e..ab926437d8195c39e7421a9ddaadf054214c0e86 100644 (file)
@@ -2654,6 +2654,13 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh
             // So when changing a list style interactively, could retrieve level based on current style, then
             // set appropriate indent and apply new style.
 
+            int outline = -1;
+            int num = -1;
+            if (para->GetAttributes().HasOutlineLevel())
+                outline = para->GetAttributes().GetOutlineLevel();
+            if (para->GetAttributes().HasBulletNumber())
+                num = para->GetAttributes().GetBulletNumber();
+
             if (!para->GetAttributes().GetParagraphStyleName().IsEmpty() && !para->GetAttributes().GetListStyleName().IsEmpty())
             {
                 int currentIndent = para->GetAttributes().GetLeftIndent();
@@ -2704,6 +2711,11 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh
                     foundCount ++;
                 }
             }
+
+            if (outline != -1)
+                para->GetAttributes().SetOutlineLevel(outline);
+            if (num != -1)
+                para->GetAttributes().SetBulletNumber(num);
         }
 
         node = node->GetNext();