X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/59509217cd3c0411e218a5e0d65b0f5065348d72..eec960fa8987d15fd87e249c8441474188124425:/src/richtext/richtextbuffer.cpp?ds=sidebyside diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 78f53cf6ff..f1ed9eacf1 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -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); @@ -2108,6 +2108,21 @@ bool wxRichTextParagraphLayoutBox::CollectStyle(wxTextAttrEx& currentStyle, cons currentStyle.SetParagraphStyleName(style.GetParagraphStyleName()); } + if (style.HasListStyleName() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_LIST_STYLE_NAME)) + { + if (currentStyle.HasListStyleName()) + { + if (currentStyle.HasListStyleName() != style.HasListStyleName()) + { + // Clash of style - mark as such + multipleStyleAttributes |= wxTEXT_ATTR_LIST_STYLE_NAME; + currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_LIST_STYLE_NAME); + } + } + else + currentStyle.SetListStyleName(style.GetListStyleName()); + } + if (style.HasBulletStyle() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_BULLET_STYLE)) { if (currentStyle.HasBulletStyle()) @@ -2156,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; } @@ -2410,7 +2442,57 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh if (para) { - if (!para->GetAttributes().GetParagraphStyleName().IsEmpty()) + // Combine paragraph and list styles. If there is a list style in the original attributes, + // the current indentation overrides anything else and is used to find the item indentation. + // Also, for applying paragraph styles, consider having 2 modes: (1) we merge with what we have, + // thereby taking into account all user changes, (2) reset the style completely (except for indentation/list + // exception as above). + // 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(); + + wxRichTextParagraphStyleDefinition* paraDef = styleSheet->FindParagraphStyle(para->GetAttributes().GetParagraphStyleName()); + wxRichTextListStyleDefinition* listDef = styleSheet->FindListStyle(para->GetAttributes().GetListStyleName()); + if (paraDef && !listDef) + { + para->GetAttributes() = paraDef->GetStyle(); + foundCount ++; + } + else if (listDef && !paraDef) + { + // Set overall style defined for the list style definition + para->GetAttributes() = listDef->GetStyle(); + + // Apply the style for this level + wxRichTextApplyStyle(para->GetAttributes(), * listDef->GetLevelAttributes(listDef->FindLevelForIndent(currentIndent))); + foundCount ++; + } + else if (listDef && paraDef) + { + // Combines overall list style, style for level, and paragraph style + para->GetAttributes() = listDef->CombineWithParagraphStyle(currentIndent, paraDef->GetStyle()); + foundCount ++; + } + } + else if (para->GetAttributes().GetParagraphStyleName().IsEmpty() && !para->GetAttributes().GetListStyleName().IsEmpty()) + { + int currentIndent = para->GetAttributes().GetLeftIndent(); + + wxRichTextListStyleDefinition* listDef = styleSheet->FindListStyle(para->GetAttributes().GetListStyleName()); + + // Overall list definition style + para->GetAttributes() = listDef->GetStyle(); + + // Style for this level + wxRichTextApplyStyle(para->GetAttributes(), * listDef->GetLevelAttributes(listDef->FindLevelForIndent(currentIndent))); + + foundCount ++; + } + else if (!para->GetAttributes().GetParagraphStyleName().IsEmpty() && para->GetAttributes().GetListStyleName().IsEmpty()) { wxRichTextParagraphStyleDefinition* def = styleSheet->FindParagraphStyle(para->GetAttributes().GetParagraphStyleName()); if (def) @@ -2426,6 +2508,344 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh return foundCount != 0; } +/// Set list style +bool wxRichTextParagraphLayoutBox::SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int startFrom, int specifiedLevel) +{ + bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0); + // 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 + // to the data. + + bool haveControl = (GetRichTextCtrl() != NULL); + + wxRichTextAction* action = NULL; + + if (haveControl && withUndo) + { + action = new wxRichTextAction(NULL, _("Change List Style"), wxRICHTEXT_CHANGE_STYLE, & GetRichTextCtrl()->GetBuffer(), GetRichTextCtrl()); + action->SetRange(range); + action->SetPosition(GetRichTextCtrl()->GetCaretPosition()); + } + + wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); + while (node) + { + wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); + wxASSERT (para != NULL); + + if (para && para->GetChildCount() > 0) + { + // Stop searching if we're beyond the range of interest + if (para->GetRange().GetStart() > range.GetEnd()) + break; + + if (!para->GetRange().IsOutside(range)) + { + // We'll be using a copy of the paragraph to make style changes, + // not updating the buffer directly. + wxRichTextParagraph* newPara wxDUMMY_INITIALIZE(NULL); + + if (haveControl && withUndo) + { + newPara = new wxRichTextParagraph(*para); + action->GetNewParagraphs().AppendChild(newPara); + + // Also store the old ones for Undo + action->GetOldParagraphs().AppendChild(new wxRichTextParagraph(*para)); + } + 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 + // list style. + // In Word, applying a style to several paragraphs, even if at different levels, + // reverts the level back to the same one. So we could do the same here. + // Renumbering will need to be done when we promote/demote a paragraph. + + // 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()) + { + // if def is NULL, remove list style, applying any associated paragraph style + // to restore the attributes + + 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()) + { + wxRichTextParagraphStyleDefinition* def = styleSheet->FindParagraphStyle(newPara->GetAttributes().GetParagraphStyleName()); + if (def) + { + newPara->GetAttributes() = def->GetStyle(); + } + } + } + } + } + + node = node->GetNext(); + } + + // Do action, or delay it until end of batch. + if (haveControl && withUndo) + GetRichTextCtrl()->GetBuffer().SubmitAction(action); + + return true; +} + +bool wxRichTextParagraphLayoutBox::SetListStyle(const wxRichTextRange& range, const wxString& defName, int flags, int startFrom, int specifiedLevel) +{ + if (GetStyleSheet()) + { + wxRichTextListStyleDefinition* def = GetStyleSheet()->FindListStyle(defName); + if (def) + return SetListStyle(range, def, flags, startFrom, specifiedLevel); + } + return false; +} + +/// Clear list for given range +bool wxRichTextParagraphLayoutBox::ClearListStyle(const wxRichTextRange& range, int flags) +{ + return SetListStyle(range, NULL, flags); +} + +/// Number/renumber any list elements in the given range +bool wxRichTextParagraphLayoutBox::NumberList(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int startFrom, int specifiedLevel) +{ + return DoNumberList(range, range, 0, def, flags, startFrom, specifiedLevel); +} + +/// Number/renumber any list elements in the given range. Also do promotion or demotion of items, if specified +bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, const wxRichTextRange& promotionRange, int promoteBy, + wxRichTextListStyleDefinition* def, int flags, int startFrom, int specifiedLevel) +{ + bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0); + // bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0); + 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++) + { + if (startFrom != -1) + levels[i] = startFrom; + else if (renumber) // start again + levels[i] = 1; + 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 + // to the data. + + bool haveControl = (GetRichTextCtrl() != NULL); + + wxRichTextAction* action = NULL; + + if (haveControl && withUndo) + { + action = new wxRichTextAction(NULL, _("Renumber List"), wxRICHTEXT_CHANGE_STYLE, & GetRichTextCtrl()->GetBuffer(), GetRichTextCtrl()); + action->SetRange(range); + action->SetPosition(GetRichTextCtrl()->GetCaretPosition()); + } + + wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); + while (node) + { + wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); + wxASSERT (para != NULL); + + if (para && para->GetChildCount() > 0) + { + // Stop searching if we're beyond the range of interest + if (para->GetRange().GetStart() > range.GetEnd()) + break; + + if (!para->GetRange().IsOutside(range)) + { + // We'll be using a copy of the paragraph to make style changes, + // not updating the buffer directly. + wxRichTextParagraph* newPara wxDUMMY_INITIALIZE(NULL); + + if (haveControl && withUndo) + { + newPara = new wxRichTextParagraph(*para); + action->GetNewParagraphs().AppendChild(newPara); + + // Also store the old ones for Undo + action->GetOldParagraphs().AppendChild(new wxRichTextParagraph(*para)); + } + 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(); + int thisLevel = defToUse->FindLevelForIndent(thisIndent); + + // If the paragraph doesn't have an indent, or we've specified a level to apply to all, + // change the level. + if (thisIndent == 0 || specifiedLevel != -1) + thisLevel = specifiedLevel; + + // Do promotion if specified + if ((promoteBy != 0) && !para->GetRange().IsOutside(promotionRange)) + { + thisLevel = thisLevel - promoteBy; + if (thisLevel < 0) + thisLevel = 0; + 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) + { + } + // A deeper level: start renumbering all levels after current level + else if (thisLevel > currentLevel) + { + for (i = currentLevel+1; i <= thisLevel; i++) + { + levels[i] = 1; + } + currentLevel = thisLevel; + } + else if (thisLevel < currentLevel) + { + currentLevel = thisLevel; + } + + // Use the current numbering if -1 and we have a bullet number already + if (levels[currentLevel] == -1) + { + if (newPara->GetAttributes().HasBulletNumber()) + levels[currentLevel] = newPara->GetAttributes().GetBulletNumber(); + else + levels[currentLevel] = 1; + } + + newPara->GetAttributes().SetBulletNumber(levels[currentLevel]); + + levels[currentLevel] ++; + } + } + } + + node = node->GetNext(); + } + + // Do action, or delay it until end of batch. + if (haveControl && withUndo) + GetRichTextCtrl()->GetBuffer().SubmitAction(action); + + return true; +} + +bool wxRichTextParagraphLayoutBox::NumberList(const wxRichTextRange& range, const wxString& defName, int flags, int startFrom, int specifiedLevel) +{ + if (GetStyleSheet()) + { + wxRichTextListStyleDefinition* def = NULL; + if (!defName.IsEmpty()) + def = GetStyleSheet()->FindListStyle(defName); + return NumberList(range, def, flags, startFrom, specifiedLevel); + } + return false; +} + +/// Promote the list items within the given range. promoteBy can be a positive or negative number, e.g. 1 or -1 +bool wxRichTextParagraphLayoutBox::PromoteList(int promoteBy, const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int specifiedLevel) +{ + // TODO + // One strategy is to first work out the range within which renumbering must occur. Then could pass these two ranges + // to NumberList with a flag indicating promotion is required within one of the ranges. + // Find first and last paragraphs in range. Then for first, calculate new indentation and look back until we find + // a paragraph that either has no list style, or has one that is different or whose indentation is less. + // We start renumbering from the para after that different para we found. We specify that the numbering of that + // 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); +} + +bool wxRichTextParagraphLayoutBox::PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags, int specifiedLevel) +{ + if (GetStyleSheet()) + { + wxRichTextListStyleDefinition* def = NULL; + if (!defName.IsEmpty()) + def = GetStyleSheet()->FindListStyle(defName); + return PromoteList(promoteBy, range, def, flags, specifiedLevel); + } + return false; +} + /*! * wxRichTextParagraph * This object represents a single paragraph (or in a straight text editor, a line). @@ -2433,6 +2853,8 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh IMPLEMENT_DYNAMIC_CLASS(wxRichTextParagraph, wxRichTextBox) +wxArrayInt wxRichTextParagraph::sm_defaultTabs; + wxRichTextParagraph::wxRichTextParagraph(wxRichTextObject* parent, wxTextAttrEx* style): wxRichTextBox(parent) { @@ -2479,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(); @@ -3482,6 +3960,23 @@ wxTextAttrEx wxRichTextParagraph::GetCombinedAttributes() const return attr; } +/// Create default tabstop array +void wxRichTextParagraph::InitDefaultTabs() +{ + // create a default tab list at 10 mm each. + for (int i = 0; i < 20; ++i) + { + sm_defaultTabs.Add(i*100); + } +} + +/// Clear default tabstop array +void wxRichTextParagraph::ClearDefaultTabs() +{ + sm_defaultTabs.Clear(); +} + + /*! * wxRichTextLine * This object represents a line in a paragraph, and stores @@ -3542,6 +4037,8 @@ wxRichTextPlainText::wxRichTextPlainText(const wxString& text, wxRichTextObject* m_text = text; } +#define USE_KERNING_FIX 1 + /// Draw the item bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int WXUNUSED(style)) { @@ -3599,6 +4096,23 @@ bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxR wxString stringFragment = m_text.Mid(r1 - offset, fragmentLen); DrawTabbedString(dc, textAttr, rect, stringFragment, x, y, false); + +#if USE_KERNING_FIX + if (stringChunk.Find(wxT("\t")) == wxNOT_FOUND) + { + // 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; + } +#endif } // 2. Selected chunk, if any. @@ -3613,6 +4127,23 @@ bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxR wxString stringFragment = m_text.Mid(s1 - offset, fragmentLen); DrawTabbedString(dc, textAttr, rect, stringFragment, x, y, true); + +#if USE_KERNING_FIX + if (stringChunk.Find(wxT("\t")) == wxNOT_FOUND) + { + // 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; + } +#endif } // 3. Remaining unselected chunk, if any @@ -3635,29 +4166,33 @@ bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxR bool wxRichTextPlainText::DrawTabbedString(wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect,wxString& str, wxCoord& x, wxCoord& y, bool selected) { - wxArrayInt tab_array = attr.GetTabs(); - if (tab_array.IsEmpty()) + bool hasTabs = (str.Find(wxT('\t')) != wxNOT_FOUND); + + wxArrayInt tabArray; + int tabCount; + if (hasTabs) { - // create a default tab list at 10 mm each. - for (int i = 0; i < 20; ++i) + if (attr.GetTabs().IsEmpty()) + tabArray = wxRichTextParagraph::GetDefaultTabs(); + else + tabArray = attr.GetTabs(); + tabCount = tabArray.GetCount(); + + for (int i = 0; i < tabCount; ++i) { - tab_array.Add(i*100); + int pos = tabArray[i]; + pos = ConvertTenthsMMToPixels(dc, pos); + tabArray[i] = pos; } } - int map_mode = dc.GetMapMode(); - dc.SetMapMode(wxMM_LOMETRIC ); - int num_tabs = tab_array.GetCount(); - for (int i = 0; i < num_tabs; ++i) - { - tab_array[i] = dc.LogicalToDeviceXRel(tab_array[i]); - } + else + tabCount = 0; - dc.SetMapMode(map_mode ); - int next_tab_pos = -1; - int tab_pos = -1; + int nextTabPos = -1; + int tabPos = -1; wxCoord w, h; - if(selected) + if (selected) { dc.SetBrush(*wxBLACK_BRUSH); dc.SetPen(*wxBLACK_PEN); @@ -3670,41 +4205,45 @@ bool wxRichTextPlainText::DrawTabbedString(wxDC& dc, const wxTextAttrEx& attr, c dc.SetBackgroundMode(wxTRANSPARENT); } - while (str.Find(wxT('\t')) >= 0) + while (hasTabs) { // the string has a tab // break up the string at the Tab wxString stringChunk = str.BeforeFirst(wxT('\t')); str = str.AfterFirst(wxT('\t')); dc.GetTextExtent(stringChunk, & w, & h); - tab_pos = x + w; + tabPos = x + w; bool not_found = true; - for (int i = 0; i < num_tabs && not_found; ++i) + for (int i = 0; i < tabCount && not_found; ++i) { - next_tab_pos = tab_array.Item(i); - if (next_tab_pos > tab_pos) + nextTabPos = tabArray.Item(i); + if (nextTabPos > tabPos) { not_found = false; if (selected) { - w = next_tab_pos - x; + w = nextTabPos - x; wxRect selRect(x, rect.y, w, rect.GetHeight()); dc.DrawRectangle(selRect); } dc.DrawText(stringChunk, x, y); - x = next_tab_pos; + x = nextTabPos; } } + hasTabs = (str.Find(wxT('\t')) != wxNOT_FOUND); } - dc.GetTextExtent(str, & w, & h); - if (selected) + if (!str.IsEmpty()) { - wxRect selRect(x, rect.y, w, rect.GetHeight()); - dc.DrawRectangle(selRect); + dc.GetTextExtent(str, & w, & h); + if (selected) + { + wxRect selRect(x, rect.y, w, rect.GetHeight()); + dc.DrawRectangle(selRect); + } + dc.DrawText(str, x, y); + x += w; } - dc.DrawText(str, x, y); - x += w; return true; } @@ -3767,29 +4306,25 @@ bool wxRichTextPlainText::GetRangeSize(const wxRichTextRange& range, wxSize& siz wxString stringChunk = m_text.Mid(startPos, (size_t) len); wxCoord w, h; int width = 0; - if (stringChunk.Find(wxT('\t')) >= 0) + if (stringChunk.Find(wxT('\t')) != wxNOT_FOUND) { // the string has a tab - wxArrayInt tab_array = textAttr.GetTabs(); - if (tab_array.IsEmpty()) - { - // create a default tab list at 10 mm each. - for (int i = 0; i < 20; ++i) - { - tab_array.Add(i*100); - } - } + wxArrayInt tabArray; + if (textAttr.GetTabs().IsEmpty()) + tabArray = wxRichTextParagraph::GetDefaultTabs(); + else + tabArray = textAttr.GetTabs(); - int map_mode = dc.GetMapMode(); - dc.SetMapMode(wxMM_LOMETRIC ); - int num_tabs = tab_array.GetCount(); + int tabCount = tabArray.GetCount(); - for (int i = 0; i < num_tabs; ++i) + for (int i = 0; i < tabCount; ++i) { - tab_array[i] = dc.LogicalToDeviceXRel(tab_array[i]); + int pos = tabArray[i]; + pos = ((wxRichTextPlainText*) this)->ConvertTenthsMMToPixels(dc, pos); + tabArray[i] = pos; } - dc.SetMapMode(map_mode ); - int next_tab_pos = -1; + + int nextTabPos = -1; while (stringChunk.Find(wxT('\t')) >= 0) { @@ -3799,15 +4334,15 @@ bool wxRichTextPlainText::GetRangeSize(const wxRichTextRange& range, wxSize& siz stringChunk = stringChunk.AfterFirst(wxT('\t')); dc.GetTextExtent(stringFragment, & w, & h); width += w; - int absolute_width = width + position.x; - bool not_found = true; - for (int i = 0; i < num_tabs && not_found; ++i) + int absoluteWidth = width + position.x; + bool notFound = true; + for (int i = 0; i < tabCount && notFound; ++i) { - next_tab_pos = tab_array.Item(i); - if (next_tab_pos > absolute_width) + nextTabPos = tabArray.Item(i); + if (nextTabPos > absoluteWidth) { - not_found = false; - width = next_tab_pos - position.x; + notFound = false; + width = nextTabPos - position.x; } } } @@ -3968,6 +4503,32 @@ void wxRichTextBuffer::Copy(const wxRichTextBuffer& obj) m_suppressUndo = obj.m_suppressUndo; } +/// Push style sheet to top of stack +bool wxRichTextBuffer::PushStyleSheet(wxRichTextStyleSheet* styleSheet) +{ + if (m_styleSheet) + styleSheet->InsertSheet(m_styleSheet); + + SetStyleSheet(styleSheet); + + return true; +} + +/// Pop style sheet from top of stack +wxRichTextStyleSheet* wxRichTextBuffer::PopStyleSheet() +{ + if (m_styleSheet) + { + wxRichTextStyleSheet* oldSheet = m_styleSheet; + m_styleSheet = oldSheet->GetNextSheet(); + oldSheet->Unlink(); + + return oldSheet; + } + else + return NULL; +} + /// Submit command to insert paragraphs bool wxRichTextBuffer::InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags) { @@ -4455,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); @@ -4467,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); @@ -4475,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) { @@ -4507,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) { @@ -4658,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) @@ -4858,13 +5451,35 @@ class wxRichTextModule: public wxModule DECLARE_DYNAMIC_CLASS(wxRichTextModule) public: wxRichTextModule() {} - bool OnInit() { wxRichTextBuffer::InitStandardHandlers(); return true; }; - void OnExit() { wxRichTextBuffer::CleanUpHandlers(); wxRichTextDecimalToRoman(-1); }; + bool OnInit() + { + wxRichTextBuffer::InitStandardHandlers(); + wxRichTextParagraph::InitDefaultTabs(); + return true; + }; + void OnExit() + { + wxRichTextBuffer::CleanUpHandlers(); + wxRichTextDecimalToRoman(-1); + wxRichTextParagraph::ClearDefaultTabs(); + wxRichTextCtrl::ClearAvailableFontNames(); + }; }; IMPLEMENT_DYNAMIC_CLASS(wxRichTextModule, wxModule) +// If the richtext lib is dynamically loaded after the app has already started +// (such as from wxPython) then the built-in module system will not init this +// module. Provide this function to do it manually. +void wxRichTextModuleInit() +{ + wxModule* module = new wxRichTextModule; + module->Init(); + wxModule::RegisterModule(module); +} + + /*! * Commands for undo/redo * @@ -5054,7 +5669,7 @@ void wxRichTextAction::UpdateAppearance(long caretPosition, bool sendUpdateEvent m_ctrl->Refresh(false); if (sendUpdateEvent) - m_ctrl->SendUpdateEvent(); + m_ctrl->SendTextUpdatedEvent(); } } } @@ -5224,24 +5839,7 @@ void wxRichTextImage::Copy(const wxRichTextImage& obj) /// Compare two attribute objects bool wxTextAttrEq(const wxTextAttrEx& attr1, const wxTextAttrEx& attr2) { - return ( - attr1.GetTextColour() == attr2.GetTextColour() && - attr1.GetBackgroundColour() == attr2.GetBackgroundColour() && - attr1.GetFont() == attr2.GetFont() && - attr1.GetAlignment() == attr2.GetAlignment() && - attr1.GetLeftIndent() == attr2.GetLeftIndent() && - attr1.GetRightIndent() == attr2.GetRightIndent() && - attr1.GetLeftSubIndent() == attr2.GetLeftSubIndent() && - wxRichTextTabsEq(attr1.GetTabs(), attr2.GetTabs()) && - attr1.GetLineSpacing() == attr2.GetLineSpacing() && - attr1.GetParagraphSpacingAfter() == attr2.GetParagraphSpacingAfter() && - attr1.GetParagraphSpacingBefore() == attr2.GetParagraphSpacingBefore() && - attr1.GetBulletStyle() == attr2.GetBulletStyle() && - attr1.GetBulletNumber() == attr2.GetBulletNumber() && - attr1.GetBulletSymbol() == attr2.GetBulletSymbol() && - attr1.GetBulletFont() == attr2.GetBulletFont() && - attr1.GetCharacterStyleName() == attr2.GetCharacterStyleName() && - attr1.GetParagraphStyleName() == attr2.GetParagraphStyleName()); + return (attr1 == attr2); } bool wxTextAttrEq(const wxTextAttrEx& attr1, const wxRichTextAttr& attr2) @@ -5265,9 +5863,11 @@ 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()); + attr1.GetParagraphStyleName() == attr2.GetParagraphStyleName() && + attr1.GetListStyleName() == attr2.GetListStyleName()); } /// Compare two attribute objects, but take into account the flags @@ -5331,6 +5931,10 @@ bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const wxTextAttrEx& attr2, i (attr1.GetParagraphStyleName() != attr2.GetParagraphStyleName())) return false; + if ((flags & wxTEXT_ATTR_LIST_STYLE_NAME) && + (attr1.GetListStyleName() != attr2.GetListStyleName())) + return false; + if ((flags & wxTEXT_ATTR_BULLET_STYLE) && (attr1.GetBulletStyle() != attr2.GetBulletStyle())) return false; @@ -5340,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) && @@ -5416,6 +6021,10 @@ bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const wxRichTextAttr& attr2, (attr1.GetParagraphStyleName() != attr2.GetParagraphStyleName())) return false; + if ((flags & wxTEXT_ATTR_LIST_STYLE_NAME) && + (attr1.GetListStyleName() != attr2.GetListStyleName())) + return false; + if ((flags & wxTEXT_ATTR_BULLET_STYLE) && (attr1.GetBulletStyle() != attr2.GetBulletStyle())) return false; @@ -5425,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) && @@ -5538,13 +6148,21 @@ bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxTextAttrEx& style) if (style.HasParagraphStyleName()) destStyle.SetParagraphStyleName(style.GetParagraphStyleName()); + if (style.HasListStyleName()) + 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()); @@ -5715,6 +6333,12 @@ bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style, destStyle.SetParagraphStyleName(style.GetParagraphStyleName()); } + if (style.HasListStyleName()) + { + if (!(compareWith && compareWith->HasListStyleName() && compareWith->GetListStyleName() == style.GetListStyleName())) + destStyle.SetListStyleName(style.GetListStyleName()); + } + if (style.HasBulletStyle()) { if (!(compareWith && compareWith->HasBulletStyle() && compareWith->GetBulletStyle() == style.GetBulletStyle())) @@ -5736,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; } @@ -5870,10 +6500,12 @@ void wxRichTextAttr::operator= (const wxRichTextAttr& attr) m_lineSpacing = attr.m_lineSpacing; m_characterStyleName = attr.m_characterStyleName; m_paragraphStyleName = attr.m_paragraphStyleName; + m_listStyleName = attr.m_listStyleName; m_bulletStyle = attr.m_bulletStyle; m_bulletNumber = attr.m_bulletNumber; m_bulletSymbol = attr.m_bulletSymbol; m_bulletFont = attr.m_bulletFont; + m_bulletName = attr.m_bulletName; } // operators @@ -5893,9 +6525,11 @@ void wxRichTextAttr::operator= (const wxTextAttrEx& attr) m_lineSpacing = attr.GetLineSpacing(); m_characterStyleName = attr.GetCharacterStyleName(); m_paragraphStyleName = attr.GetParagraphStyleName(); + m_listStyleName = attr.GetListStyleName(); m_bulletStyle = attr.GetBulletStyle(); m_bulletNumber = attr.GetBulletNumber(); m_bulletSymbol = attr.GetBulletSymbol(); + m_bulletName = attr.GetBulletName(); m_bulletFont = attr.GetBulletFont(); if (attr.GetFont().Ok()) @@ -5929,11 +6563,13 @@ bool wxRichTextAttr::operator== (const wxRichTextAttr& attr) const GetLineSpacing() == attr.GetLineSpacing() && GetCharacterStyleName() == attr.GetCharacterStyleName() && GetParagraphStyleName() == attr.GetParagraphStyleName() && + GetListStyleName() == attr.GetListStyleName() && GetBulletStyle() == attr.GetBulletStyle() && GetBulletSymbol() == attr.GetBulletSymbol() && GetBulletNumber() == attr.GetBulletNumber() && GetBulletFont() == attr.GetBulletFont() && + GetBulletName() == attr.GetBulletName() && m_fontSize == attr.m_fontSize && m_fontStyle == attr.m_fontStyle && @@ -5959,9 +6595,11 @@ 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); + attr.SetListStyleName(m_listStyleName); attr.SetFlags(GetFlags()); // Important: set after SetFont and others, since they set flags } @@ -6067,12 +6705,18 @@ wxRichTextAttr wxRichTextAttr::Combine(const wxRichTextAttr& attr, if (attr.HasParagraphStyleName()) newAttr.SetParagraphStyleName(attr.GetParagraphStyleName()); + if (attr.HasListStyleName()) + newAttr.SetListStyleName(attr.GetListStyleName()); + if (attr.HasBulletStyle()) newAttr.SetBulletStyle(attr.GetBulletStyle()); if (attr.HasBulletNumber()) newAttr.SetBulletNumber(attr.GetBulletNumber()); + if (attr.HasBulletName()) + newAttr.SetBulletName(attr.GetBulletName()); + if (attr.HasBulletSymbol()) { newAttr.SetBulletSymbol(attr.GetBulletSymbol()); @@ -6093,9 +6737,11 @@ wxTextAttrEx::wxTextAttrEx(const wxTextAttrEx& attr): wxTextAttr(attr) m_lineSpacing = attr.m_lineSpacing; m_paragraphStyleName = attr.m_paragraphStyleName; m_characterStyleName = attr.m_characterStyleName; + m_listStyleName = attr.m_listStyleName; 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; } @@ -6107,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('*'); } @@ -6121,10 +6766,12 @@ void wxTextAttrEx::operator= (const wxTextAttrEx& attr) m_lineSpacing = attr.m_lineSpacing; m_characterStyleName = attr.m_characterStyleName; m_paragraphStyleName = attr.m_paragraphStyleName; + m_listStyleName = attr.m_listStyleName; m_bulletStyle = attr.m_bulletStyle; 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. @@ -6133,6 +6780,31 @@ void wxTextAttrEx::operator= (const wxTextAttr& attr) wxTextAttr::operator= (attr); } +// Equality test +bool wxTextAttrEx::operator== (const wxTextAttrEx& attr) const +{ + return ( + GetTextColour() == attr.GetTextColour() && + GetBackgroundColour() == attr.GetBackgroundColour() && + GetFont() == attr.GetFont() && + GetAlignment() == attr.GetAlignment() && + GetLeftIndent() == attr.GetLeftIndent() && + GetRightIndent() == attr.GetRightIndent() && + GetLeftSubIndent() == attr.GetLeftSubIndent() && + wxRichTextTabsEq(GetTabs(), attr.GetTabs()) && + GetLineSpacing() == attr.GetLineSpacing() && + GetParagraphSpacingAfter() == attr.GetParagraphSpacingAfter() && + GetParagraphSpacingBefore() == attr.GetParagraphSpacingBefore() && + GetBulletStyle() == attr.GetBulletStyle() && + GetBulletNumber() == attr.GetBulletNumber() && + GetBulletSymbol() == attr.GetBulletSymbol() && + GetBulletName() == attr.GetBulletName() && + GetBulletFont() == attr.GetBulletFont() && + GetCharacterStyleName() == attr.GetCharacterStyleName() && + GetParagraphStyleName() == attr.GetParagraphStyleName() && + GetListStyleName() == attr.GetListStyleName()); +} + wxTextAttrEx wxTextAttrEx::CombineEx(const wxTextAttrEx& attr, const wxTextAttrEx& attrDef, const wxTextCtrlBase *text) @@ -6260,12 +6932,18 @@ wxTextAttrEx wxTextAttrEx::CombineEx(const wxTextAttrEx& attr, if (attr.HasParagraphStyleName()) newAttr.SetParagraphStyleName(attr.GetParagraphStyleName()); + if (attr.HasListStyleName()) + newAttr.SetListStyleName(attr.GetListStyleName()); + if (attr.HasBulletStyle()) newAttr.SetBulletStyle(attr.GetBulletStyle()); if (attr.HasBulletNumber()) newAttr.SetBulletNumber(attr.GetBulletNumber()); + if (attr.HasBulletName()) + newAttr.SetBulletName(attr.GetBulletName()); + if (attr.HasBulletSymbol()) { newAttr.SetBulletSymbol(attr.GetBulletSymbol()); @@ -6749,4 +7427,3 @@ bool wxRichTextBufferDataObject::SetData(size_t WXUNUSED(len), const void *buf) #endif // wxUSE_RICHTEXT -