// Skip
}
else
- child->Draw(dc, child->GetRange(), selectionRange, childRect, descent, style);
+ child->Draw(dc, range, selectionRange, childRect, descent, style);
}
node = node->GetNext();
Clear();
AddParagraph(wxEmptyString);
+
+ Invalidate(wxRICHTEXT_ALL);
}
/// Invalidate the buffer. With no argument, invalidates whole buffer.
}
/// Draw the item
-bool wxRichTextParagraph::Draw(wxDC& dc, const wxRichTextRange& WXUNUSED(range), const wxRichTextRange& selectionRange, const wxRect& WXUNUSED(rect), int WXUNUSED(descent), int style)
+bool wxRichTextParagraph::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& WXUNUSED(rect), int WXUNUSED(descent), int style)
{
#if wxRICHTEXT_USE_DYNAMIC_STYLES
wxTextAttrEx attr = GetCombinedAttributes();
while (node2)
{
wxRichTextObject* child = node2->GetData();
- if (!child->GetRange().IsOutside(lineRange))
+
+ if (!child->GetRange().IsOutside(lineRange) && !lineRange.IsOutside(range))
{
// Draw this part of the line at the correct position
wxRichTextRange objectRange(child->GetRange());
ClearEventHandlers();
}
-void wxRichTextBuffer::Clear()
+void wxRichTextBuffer::ResetAndClearCommands()
{
- DeleteChildren();
+ Reset();
+
GetCommandProcessor()->ClearCommands();
- Modify(false);
- Invalidate(wxRICHTEXT_ALL);
-}
-void wxRichTextBuffer::Reset()
-{
- DeleteChildren();
- AddParagraph(wxEmptyString);
- GetCommandProcessor()->ClearCommands();
Modify(false);
Invalidate(wxRICHTEXT_ALL);
}
{
wxRichTextAttr numberingAttr;
if (FindNextParagraphNumber(para, numberingAttr))
- wxRichTextApplyStyle(attr, numberingAttr);
+ wxRichTextApplyStyle(attr, (const wxRichTextAttr&) numberingAttr);
}
return attr;
return true;
}
+bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith)
+{
+ wxTextAttrEx attr(destStyle);
+ wxRichTextApplyStyle(attr, style, compareWith);
+ destStyle = attr;
+ return true;
+}
+
bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith)
{
// Whole font. Avoiding setting individual attributes if possible, since