font1.GetFamily() == font.GetFamily() &&
font1.GetStyle() == font.GetStyle() &&
font1.GetWeight() == font.GetWeight() &&
+ font1.GetUnderlined() == font.GetUnderlined() &&
font1.GetFaceName() == font.GetFaceName())
return;
}
{
Clear();
+ wxRichTextBuffer* buffer = wxDynamicCast(this, wxRichTextBuffer);
+ if (buffer && GetRichTextCtrl())
+ {
+ wxRichTextEvent event(wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, GetRichTextCtrl()->GetId());
+ event.SetEventObject(GetRichTextCtrl());
+
+ buffer->SendEvent(event, true);
+ }
+
AddParagraph(wxEmptyString);
Invalidate(wxRICHTEXT_ALL);
int foundCount = 0;
+ wxRichTextAttr attr(GetBasicStyle());
+ if (GetBasicStyle().HasParagraphStyleName())
+ {
+ wxRichTextParagraphStyleDefinition* paraDef = styleSheet->FindParagraphStyle(GetBasicStyle().GetParagraphStyleName());
+ if (paraDef)
+ {
+ attr.Apply(paraDef->GetStyleMergedWithBase(styleSheet));
+ SetBasicStyle(attr);
+ foundCount ++;
+ }
+ }
+
+ if (GetBasicStyle().HasCharacterStyleName())
+ {
+ wxRichTextCharacterStyleDefinition* charDef = styleSheet->FindCharacterStyle(GetBasicStyle().GetCharacterStyleName());
+ if (charDef)
+ {
+ attr.Apply(charDef->GetStyleMergedWithBase(styleSheet));
+ SetBasicStyle(attr);
+ foundCount ++;
+ }
+ }
+
wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
while (node)
{
wxTextDataObject data;
wxTheClipboard->GetData(data);
wxString text(data.GetText());
- text.Replace(_T("\r\n"), _T("\n"));
-
- InsertTextWithUndo(position+1, text, GetRichTextCtrl());
+#ifdef __WXMSW__
+ wxString text2;
+ text2.Alloc(text.Length()+1);
+ size_t i;
+ for (i = 0; i < text.Length(); i++)
+ {
+ wxChar ch = text[i];
+ if (ch != wxT('\r'))
+ text2 += ch;
+ }
+#else
+ wxString text2 = text;
+#endif
+ InsertTextWithUndo(position+1, text2, GetRichTextCtrl());
success = true;
}