]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextbuffer.cpp
Override GetPixelSize on OS X as the base impl creates a wxScreenDC each time, which...
[wxWidgets.git] / src / richtext / richtextbuffer.cpp
index d186fd8af3e21d2d7c0aed498700b24ab707cf36..f1ed9eacf16f3c9e3d0802c576ee3b7a3bcbb664 100644 (file)
@@ -932,7 +932,7 @@ wxRichTextRange wxRichTextParagraphLayoutBox::AddParagraphs(const wxString& text
     size_t i = 0;
     size_t len = text.length();
     wxString line;
-    wxRichTextParagraph* para = new wxRichTextParagraph(wxT(""), this, & style);
+    wxRichTextParagraph* para = new wxRichTextParagraph(wxEmptyString, this, & style);
     if (paraStyle)
         para->SetAttributes(*paraStyle);
 
@@ -949,7 +949,7 @@ wxRichTextRange wxRichTextParagraphLayoutBox::AddParagraphs(const wxString& text
             wxRichTextPlainText* plainText = (wxRichTextPlainText*) para->GetChildren().GetFirst()->GetData();
             plainText->SetText(line);
 
-            para = new wxRichTextParagraph(wxT(""), this, & style);
+            para = new wxRichTextParagraph(wxEmptyString, this, & style);
             if (paraStyle)
                 para->SetAttributes(*paraStyle);
 
@@ -1617,7 +1617,7 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const
                 }
                 else
                     newPara = para;
-                
+
                 if (paragraphStyle && !charactersOnly)
                 {
                     if (applyMinimal)
@@ -2171,6 +2171,23 @@ bool wxRichTextParagraphLayoutBox::CollectStyle(wxTextAttrEx& currentStyle, cons
         }
     }
 
+    if (style.HasBulletName() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_BULLET_NAME))
+    {
+        if (currentStyle.HasBulletName())
+        {
+            if (currentStyle.HasBulletName() != style.HasBulletName())
+            {
+                // Clash of style - mark as such
+                multipleStyleAttributes |= wxTEXT_ATTR_BULLET_NAME;
+                currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_NAME);
+            }
+        }
+        else
+        {
+            currentStyle.SetBulletName(style.GetBulletName());
+        }
+    }
+
     return true;
 }
 
@@ -2433,7 +2450,7 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh
             // Problem: when changing from one list style to another, there's a danger that the level info will get lost.
             // So when changing a list style interactively, could retrieve level based on current style, then
             // set appropriate indent and apply new style.
-            
+
             if (!para->GetAttributes().GetParagraphStyleName().IsEmpty() && !para->GetAttributes().GetListStyleName().IsEmpty())
             {
                 int currentIndent = para->GetAttributes().GetLeftIndent();
@@ -2467,9 +2484,9 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh
 
                 wxRichTextListStyleDefinition* listDef = styleSheet->FindListStyle(para->GetAttributes().GetListStyleName());
 
-                // Overall list definition style                
+                // Overall list definition style
                 para->GetAttributes() = listDef->GetStyle();
-                
+
                 // Style for this level
                 wxRichTextApplyStyle(para->GetAttributes(), * listDef->GetLevelAttributes(listDef->FindLevelForIndent(currentIndent)));
 
@@ -2498,10 +2515,10 @@ bool wxRichTextParagraphLayoutBox::SetListStyle(const wxRichTextRange& range, wx
     // bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0);
     bool specifyLevel = ((flags & wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL) != 0);
     bool renumber = ((flags & wxRICHTEXT_SETSTYLE_RENUMBER) != 0);
-    
+
     // Current number, if numbering
     int n = startFrom;
-    
+
     wxASSERT (!specifyLevel || (specifyLevel && (specifiedLevel >= 0)));
 
     // If we are associated with a control, make undoable; otherwise, apply immediately
@@ -2546,12 +2563,12 @@ bool wxRichTextParagraphLayoutBox::SetListStyle(const wxRichTextRange& range, wx
                 }
                 else
                     newPara = para;
-                
+
                 if (def)
                 {
                     int thisIndent = newPara->GetAttributes().GetLeftIndent();
                     int thisLevel = specifyLevel ? specifiedLevel : def->FindLevelForIndent(thisIndent);
-                
+
                     // How is numbering going to work?
                     // If we are renumbering, or numbering for the first time, we need to keep
                     // track of the number for each level. But we might be simply applying a different
@@ -2563,13 +2580,13 @@ bool wxRichTextParagraphLayoutBox::SetListStyle(const wxRichTextRange& range, wx
                     // Apply the overall list style, and item style for this level
                     wxTextAttrEx listStyle(def->GetCombinedStyleForLevel(thisLevel));
                     wxRichTextApplyStyle(newPara->GetAttributes(), listStyle);
-                
+
                     // Now we need to check numbering
                     if (renumber)
                     {
                         newPara->GetAttributes().SetBulletNumber(n);
                     }
-                
+
                     n ++;
                 }
                 else if (!newPara->GetAttributes().GetListStyleName().IsEmpty())
@@ -2579,10 +2596,10 @@ bool wxRichTextParagraphLayoutBox::SetListStyle(const wxRichTextRange& range, wx
 
                     newPara->GetAttributes().SetListStyleName(wxEmptyString);
                     newPara->GetAttributes().SetLeftIndent(0, 0);
-                    
+
                     // Eliminate the main list-related attributes
                     newPara->GetAttributes().SetFlags(newPara->GetAttributes().GetFlags() & ~wxTEXT_ATTR_LEFT_INDENT & ~wxTEXT_ATTR_BULLET_STYLE & ~wxTEXT_ATTR_BULLET_NUMBER & ~wxTEXT_ATTR_BULLET_SYMBOL & wxTEXT_ATTR_LIST_STYLE_NAME);
-                    
+
                     wxRichTextStyleSheet* styleSheet = GetStyleSheet();
                     if (styleSheet && !newPara->GetAttributes().GetParagraphStyleName().IsEmpty())
                     {
@@ -2638,17 +2655,17 @@ bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, co
     bool specifyLevel = ((flags & wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL) != 0);
 
     bool renumber = ((flags & wxRICHTEXT_SETSTYLE_RENUMBER) != 0);
-    
+
     // Max number of levels
     const int maxLevels = 10;
-    
+
     // The level we're looking at now
     int currentLevel = -1;
-    
+
     // The item number for each level
     int levels[maxLevels];
     int i;
-    
+
     // Reset all numbering
     for (i = 0; i < maxLevels; i++)
     {
@@ -2659,7 +2676,7 @@ bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, co
         else
             levels[i] = -1; // start from the number we found, if any
     }
-    
+
     wxASSERT(!specifyLevel || (specifyLevel && (specifiedLevel >= 0)));
 
     // If we are associated with a control, make undoable; otherwise, apply immediately
@@ -2704,16 +2721,16 @@ bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, co
                 }
                 else
                     newPara = para;
-                
+
                 wxRichTextListStyleDefinition* defToUse = def;
                 if (!defToUse)
                 {
                     wxRichTextStyleSheet* sheet = GetStyleSheet();
-                    
+
                     if (sheet && !newPara->GetAttributes().GetListStyleName().IsEmpty())
                         defToUse = sheet->FindListStyle(newPara->GetAttributes().GetListStyleName());
                 }
-                
+
                 if (defToUse)
                 {
                     int thisIndent = newPara->GetAttributes().GetLeftIndent();
@@ -2723,7 +2740,7 @@ bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, co
                     // change the level.
                     if (thisIndent == 0 || specifiedLevel != -1)
                         thisLevel = specifiedLevel;
-                        
+
                     // Do promotion if specified
                     if ((promoteBy != 0) && !para->GetRange().IsOutside(promotionRange))
                     {
@@ -2733,16 +2750,16 @@ bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, co
                         if (thisLevel > 9)
                             thisLevel = 9;
                     }
-                    
+
                     // Apply the overall list style, and item style for this level
                     wxTextAttrEx listStyle(defToUse->GetCombinedStyleForLevel(thisLevel));
                     wxRichTextApplyStyle(newPara->GetAttributes(), listStyle);
-                    
+
                     // OK, we've (re)applied the style, now let's get the numbering right.
-                    
+
                     if (currentLevel == -1)
                         currentLevel = thisLevel;
-                    
+
                     // Same level as before, do nothing except increment level's number afterwards
                     if (currentLevel == thisLevel)
                     {
@@ -2759,7 +2776,7 @@ bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, co
                     else if (thisLevel < currentLevel)
                     {
                         currentLevel = thisLevel;
-                    }                    
+                    }
 
                     // Use the current numbering if -1 and we have a bullet number already
                     if (levels[currentLevel] == -1)
@@ -2769,10 +2786,10 @@ bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, co
                         else
                             levels[currentLevel] = 1;
                     }
-                    
+
                     newPara->GetAttributes().SetBulletNumber(levels[currentLevel]);
 
-                    levels[currentLevel] ++;                        
+                    levels[currentLevel] ++;
                 }
             }
         }
@@ -2811,9 +2828,9 @@ bool wxRichTextParagraphLayoutBox::PromoteList(int promoteBy, const wxRichTextRa
     // list position will start from 1.
     // Similarly, we look after the last para in the promote range for an indentation that is less (or no list style).
     // We can end the renumbering at this point.
-    
+
     // For now, only renumber within the promotion range.
-    
+
     return DoNumberList(range, range, promoteBy, def, flags, 1, specifiedLevel);
 }
 
@@ -2884,6 +2901,62 @@ bool wxRichTextParagraph::Draw(wxDC& dc, const wxRichTextRange& WXUNUSED(range),
             {
                 // TODO
             }
+            else if (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD)                
+            {
+                wxTextAttrEx bulletAttr(GetCombinedAttributes());
+                if (bulletAttr.GetTextColour().Ok())
+                {
+                    dc.SetPen(wxPen(bulletAttr.GetTextColour()));
+                    dc.SetBrush(wxBrush(bulletAttr.GetTextColour()));
+                }
+                else
+                {
+                    dc.SetPen(*wxBLACK_PEN);
+                    dc.SetBrush(*wxBLACK_BRUSH);
+                }
+
+                wxFont font;
+                if (bulletAttr.GetFont().Ok())
+                    font = bulletAttr.GetFont();
+                else
+                    font = (*wxNORMAL_FONT);
+
+                dc.SetFont(font);
+
+                // Get line height from first line, if any
+                wxRichTextLine* line = m_cachedLines.GetFirst() ? (wxRichTextLine* ) m_cachedLines.GetFirst()->GetData() : (wxRichTextLine*) NULL;
+
+                wxPoint linePos;
+                int lineHeight wxDUMMY_INITIALIZE(0);
+                if (line)
+                {
+                    lineHeight = line->GetSize().y;
+                    linePos = line->GetPosition() + GetPosition();
+                }
+                else
+                {
+                    lineHeight = dc.GetCharHeight();
+                    linePos = GetPosition();
+                    linePos.y += spaceBeforePara;
+                }
+
+                int charHeight = dc.GetCharHeight();
+                
+                int bulletWidth = wxMax(2, (charHeight/3 + 1));
+                int bulletHeight = bulletWidth;
+
+                int x = GetPosition().x + leftIndent;
+                int y = linePos.y + (lineHeight - charHeight/2) - bulletHeight/2;
+                
+                if (bulletAttr.GetBulletName() == wxT("standard/square"))
+                {
+                    dc.DrawRectangle(x, y, bulletWidth, bulletHeight);
+                }
+                else // "standard/round", and catch-all
+                {
+                    dc.DrawEllipse(x, y, bulletWidth, bulletHeight);
+                }                
+            }
             else
             {
                 wxString bulletText = GetBulletText();
@@ -4030,12 +4103,12 @@ bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxR
                 // Compensate for kerning difference
                 wxString stringFragment2(m_text.Mid(r1 - offset, fragmentLen+1));
                 wxString stringFragment3(m_text.Mid(r1 - offset + fragmentLen, 1));
-                
+
                 wxCoord w1, h1, w2, h2, w3, h3;
                 dc.GetTextExtent(stringFragment,  & w1, & h1);
                 dc.GetTextExtent(stringFragment2, & w2, & h2);
                 dc.GetTextExtent(stringFragment3, & w3, & h3);
-                
+
                 int kerningDiff = (w1 + w3) - w2;
                 x = x - kerningDiff;
             }
@@ -4061,12 +4134,12 @@ bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxR
                 // Compensate for kerning difference
                 wxString stringFragment2(m_text.Mid(s1 - offset, fragmentLen+1));
                 wxString stringFragment3(m_text.Mid(s1 - offset + fragmentLen, 1));
-                
+
                 wxCoord w1, h1, w2, h2, w3, h3;
                 dc.GetTextExtent(stringFragment,  & w1, & h1);
                 dc.GetTextExtent(stringFragment2, & w2, & h2);
                 dc.GetTextExtent(stringFragment3, & w3, & h3);
-                
+
                 int kerningDiff = (w1 + w3) - w2;
                 x = x - kerningDiff;
             }
@@ -4243,14 +4316,14 @@ bool wxRichTextPlainText::GetRangeSize(const wxRichTextRange& range, wxSize& siz
             tabArray = textAttr.GetTabs();
 
         int tabCount = tabArray.GetCount();
-        
+
         for (int i = 0; i < tabCount; ++i)
         {
             int pos = tabArray[i];
             pos = ((wxRichTextPlainText*) this)->ConvertTenthsMMToPixels(dc, pos);
             tabArray[i] = pos;
         }
-        
+
         int nextTabPos = -1;
 
         while (stringChunk.Find(wxT('\t')) >= 0)
@@ -4437,7 +4510,7 @@ bool wxRichTextBuffer::PushStyleSheet(wxRichTextStyleSheet* styleSheet)
         styleSheet->InsertSheet(m_styleSheet);
 
     SetStyleSheet(styleSheet);
-    
+
     return true;
 }
 
@@ -4449,7 +4522,7 @@ wxRichTextStyleSheet* wxRichTextBuffer::PopStyleSheet()
         wxRichTextStyleSheet* oldSheet = m_styleSheet;
         m_styleSheet = oldSheet->GetNextSheet();
         oldSheet->Unlink();
-        
+
         return oldSheet;
     }
     else
@@ -4943,7 +5016,7 @@ bool wxRichTextBuffer::BeginLineSpacing(int lineSpacing)
 bool wxRichTextBuffer::BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle)
 {
     wxTextAttrEx attr;
-    attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_LEFT_INDENT);
+    attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT);
     attr.SetBulletStyle(bulletStyle);
     attr.SetBulletNumber(bulletNumber);
     attr.SetLeftIndent(leftIndent, leftSubIndent);
@@ -4955,7 +5028,7 @@ bool wxRichTextBuffer::BeginNumberedBullet(int bulletNumber, int leftIndent, int
 bool wxRichTextBuffer::BeginSymbolBullet(wxChar symbol, int leftIndent, int leftSubIndent, int bulletStyle)
 {
     wxTextAttrEx attr;
-    attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_SYMBOL|wxTEXT_ATTR_LEFT_INDENT);
+    attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT);
     attr.SetBulletStyle(bulletStyle);
     attr.SetLeftIndent(leftIndent, leftSubIndent);
     attr.SetBulletSymbol(symbol);
@@ -4963,6 +5036,18 @@ bool wxRichTextBuffer::BeginSymbolBullet(wxChar symbol, int leftIndent, int left
     return BeginStyle(attr);
 }
 
+/// Begin standard bullet
+bool wxRichTextBuffer::BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle)
+{
+    wxTextAttrEx attr;
+    attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT);
+    attr.SetBulletStyle(bulletStyle);
+    attr.SetLeftIndent(leftIndent, leftSubIndent);
+    attr.SetBulletName(bulletName);
+
+    return BeginStyle(attr);
+}
+
 /// Begin named character style
 bool wxRichTextBuffer::BeginCharacterStyle(const wxString& characterStyle)
 {
@@ -4995,6 +5080,24 @@ bool wxRichTextBuffer::BeginParagraphStyle(const wxString& paragraphStyle)
     return false;
 }
 
+/// Begin named list style
+bool wxRichTextBuffer::BeginListStyle(const wxString& listStyle, int level, int number)
+{
+    if (GetStyleSheet())
+    {
+        wxRichTextListStyleDefinition* def = GetStyleSheet()->FindListStyle(listStyle);
+        if (def)
+        {
+            wxTextAttrEx attr(def->GetCombinedStyleForLevel(level));
+
+            attr.SetBulletNumber(number);
+
+            return BeginStyle(attr);
+        }
+    }
+    return false;
+}
+
 /// Adds a handler to the end
 void wxRichTextBuffer::AddHandler(wxRichTextFileHandler *handler)
 {
@@ -5146,6 +5249,8 @@ wxString wxRichTextBuffer::GetExtWildcard(bool combine, bool save, wxArrayInt* t
 
 /// Load a file
 bool wxRichTextBuffer::LoadFile(const wxString& filename, int type)
+
+
 {
     wxRichTextFileHandler* handler = FindHandlerFilenameOrType(filename, type);
     if (handler)
@@ -5357,6 +5462,7 @@ public:
         wxRichTextBuffer::CleanUpHandlers();
         wxRichTextDecimalToRoman(-1);
         wxRichTextParagraph::ClearDefaultTabs();
+        wxRichTextCtrl::ClearAvailableFontNames();
     };
 };
 
@@ -5757,6 +5863,7 @@ bool wxTextAttrEq(const wxTextAttrEx& attr1, const wxRichTextAttr& attr2)
         attr1.GetBulletStyle() == attr2.GetBulletStyle() &&
         attr1.GetBulletNumber() == attr2.GetBulletNumber() &&
         attr1.GetBulletSymbol() == attr2.GetBulletSymbol() &&
+        attr1.GetBulletName() == attr2.GetBulletName() &&
         attr1.GetBulletFont() == attr2.GetBulletFont() &&
         attr1.GetCharacterStyleName() == attr2.GetCharacterStyleName() &&
         attr1.GetParagraphStyleName() == attr2.GetParagraphStyleName() &&
@@ -5837,11 +5944,12 @@ bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const wxTextAttrEx& attr2, i
          return false;
 
     if ((flags & wxTEXT_ATTR_BULLET_SYMBOL) &&
-        (attr1.GetBulletSymbol() != attr2.GetBulletSymbol()))
+        (attr1.GetBulletSymbol() != attr2.GetBulletSymbol()) &&
+        (attr1.GetBulletFont() != attr2.GetBulletFont()))
          return false;
 
-    if ((flags & wxTEXT_ATTR_BULLET_SYMBOL) &&
-        (attr1.GetBulletFont() != attr2.GetBulletFont()))
+    if ((flags & wxTEXT_ATTR_BULLET_NAME) &&
+        (attr1.GetBulletName() != attr2.GetBulletName()))
          return false;
 
     if ((flags & wxTEXT_ATTR_TABS) &&
@@ -5926,11 +6034,12 @@ bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const wxRichTextAttr& attr2,
          return false;
 
     if ((flags & wxTEXT_ATTR_BULLET_SYMBOL) &&
-        (attr1.GetBulletSymbol() != attr2.GetBulletSymbol()))
+        (attr1.GetBulletSymbol() != attr2.GetBulletSymbol()) &&
+        (attr1.GetBulletFont() != attr2.GetBulletFont()))
          return false;
 
-    if ((flags & wxTEXT_ATTR_BULLET_SYMBOL) &&
-        (attr1.GetBulletFont() != attr2.GetBulletFont()))
+    if ((flags & wxTEXT_ATTR_BULLET_NAME) &&
+        (attr1.GetBulletName() != attr2.GetBulletName()))
          return false;
 
     if ((flags & wxTEXT_ATTR_TABS) &&
@@ -6043,12 +6152,17 @@ bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxTextAttrEx& style)
         destStyle.SetListStyleName(style.GetListStyleName());
 
     if (style.HasBulletStyle())
-    {
         destStyle.SetBulletStyle(style.GetBulletStyle());
+
+    if (style.HasBulletSymbol())
+    {
         destStyle.SetBulletSymbol(style.GetBulletSymbol());
         destStyle.SetBulletFont(style.GetBulletFont());
     }
 
+    if (style.HasBulletName())
+        destStyle.SetBulletName(style.GetBulletName());
+
     if (style.HasBulletNumber())
         destStyle.SetBulletNumber(style.GetBulletNumber());
 
@@ -6246,6 +6360,12 @@ bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style,
             destStyle.SetBulletNumber(style.GetBulletNumber());
     }
 
+    if (style.HasBulletName())
+    {
+        if (!(compareWith && compareWith->HasBulletName() && compareWith->GetBulletName() == style.GetBulletName()))
+            destStyle.SetBulletName(style.GetBulletName());
+    }
+
     return true;
 }
 
@@ -6385,6 +6505,7 @@ void wxRichTextAttr::operator= (const wxRichTextAttr& attr)
     m_bulletNumber = attr.m_bulletNumber;
     m_bulletSymbol = attr.m_bulletSymbol;
     m_bulletFont = attr.m_bulletFont;
+    m_bulletName = attr.m_bulletName;
 }
 
 // operators
@@ -6408,6 +6529,7 @@ void wxRichTextAttr::operator= (const wxTextAttrEx& attr)
     m_bulletStyle = attr.GetBulletStyle();
     m_bulletNumber = attr.GetBulletNumber();
     m_bulletSymbol = attr.GetBulletSymbol();
+    m_bulletName = attr.GetBulletName();
     m_bulletFont = attr.GetBulletFont();
 
     if (attr.GetFont().Ok())
@@ -6447,6 +6569,7 @@ bool wxRichTextAttr::operator== (const wxRichTextAttr& attr) const
             GetBulletSymbol() == attr.GetBulletSymbol() &&
             GetBulletNumber() == attr.GetBulletNumber() &&
             GetBulletFont() == attr.GetBulletFont() &&
+            GetBulletName() == attr.GetBulletName() &&
 
             m_fontSize == attr.m_fontSize &&
             m_fontStyle == attr.m_fontStyle &&
@@ -6472,6 +6595,7 @@ void wxRichTextAttr::CopyTo(wxTextAttrEx& attr) const
     attr.SetBulletStyle(m_bulletStyle);
     attr.SetBulletNumber(m_bulletNumber);
     attr.SetBulletSymbol(m_bulletSymbol);
+    attr.SetBulletName(m_bulletName);
     attr.SetBulletFont(m_bulletFont);
     attr.SetCharacterStyleName(m_characterStyleName);
     attr.SetParagraphStyleName(m_paragraphStyleName);
@@ -6590,6 +6714,9 @@ wxRichTextAttr wxRichTextAttr::Combine(const wxRichTextAttr& attr,
     if (attr.HasBulletNumber())
         newAttr.SetBulletNumber(attr.GetBulletNumber());
 
+    if (attr.HasBulletName())
+        newAttr.SetBulletName(attr.GetBulletName());
+
     if (attr.HasBulletSymbol())
     {
         newAttr.SetBulletSymbol(attr.GetBulletSymbol());
@@ -6614,6 +6741,7 @@ wxTextAttrEx::wxTextAttrEx(const wxTextAttrEx& attr): wxTextAttr(attr)
     m_bulletStyle = attr.m_bulletStyle;
     m_bulletNumber = attr.m_bulletNumber;
     m_bulletSymbol = attr.m_bulletSymbol;
+    m_bulletName = attr.m_bulletName;
     m_bulletFont = attr.m_bulletFont;
 }
 
@@ -6625,7 +6753,6 @@ void wxTextAttrEx::Init()
     m_lineSpacing = 0;
     m_bulletStyle = wxTEXT_ATTR_BULLET_STYLE_NONE;
     m_bulletNumber = 0;
-    m_bulletSymbol = 0;
     m_bulletSymbol = wxT('*');
 }
 
@@ -6644,6 +6771,7 @@ void wxTextAttrEx::operator= (const wxTextAttrEx& attr)
     m_bulletNumber = attr.m_bulletNumber;
     m_bulletSymbol = attr.m_bulletSymbol;
     m_bulletFont = attr.m_bulletFont;
+    m_bulletName = attr.m_bulletName;
 }
 
 // Assignment from a wxTextAttr object.
@@ -6670,6 +6798,7 @@ bool wxTextAttrEx::operator== (const wxTextAttrEx& attr) const
         GetBulletStyle() == attr.GetBulletStyle() &&
         GetBulletNumber() == attr.GetBulletNumber() &&
         GetBulletSymbol() == attr.GetBulletSymbol() &&
+        GetBulletName() == attr.GetBulletName() &&
         GetBulletFont() == attr.GetBulletFont() &&
         GetCharacterStyleName() == attr.GetCharacterStyleName() &&
         GetParagraphStyleName() == attr.GetParagraphStyleName() &&
@@ -6812,6 +6941,9 @@ wxTextAttrEx wxTextAttrEx::CombineEx(const wxTextAttrEx& attr,
     if (attr.HasBulletNumber())
         newAttr.SetBulletNumber(attr.GetBulletNumber());
 
+    if (attr.HasBulletName())
+        newAttr.SetBulletName(attr.GetBulletName());
+
     if (attr.HasBulletSymbol())
     {
         newAttr.SetBulletSymbol(attr.GetBulletSymbol());
@@ -7295,4 +7427,3 @@ bool wxRichTextBufferDataObject::SetData(size_t WXUNUSED(len), const void *buf)
 
 #endif
     // wxUSE_RICHTEXT
-