projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Missing header
[wxWidgets.git]
/
src
/
richtext
/
richtextbuffer.cpp
diff --git
a/src/richtext/richtextbuffer.cpp
b/src/richtext/richtextbuffer.cpp
index 81dbf40eed5036541fb176ac61c8c9586b85fd34..3f714632a4c7d42857426186adfb8ea5dc1faa8c 100644
(file)
--- a/
src/richtext/richtextbuffer.cpp
+++ b/
src/richtext/richtextbuffer.cpp
@@
-567,7
+567,9
@@
bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl
if (firstParagraph)
{
wxRichTextObjectList::compatibility_iterator firstNode = m_children.Find(firstParagraph);
if (firstParagraph)
{
wxRichTextObjectList::compatibility_iterator firstNode = m_children.Find(firstParagraph);
- wxRichTextObjectList::compatibility_iterator previousNode = firstNode ? firstNode->GetPrevious() : wxRichTextObjectList::compatibility_iterator();
+ wxRichTextObjectList::compatibility_iterator previousNode;
+ if ( firstNode )
+ previousNode = firstNode->GetPrevious();
if (firstNode && previousNode)
{
wxRichTextParagraph* previousParagraph = wxDynamicCast(previousNode->GetData(), wxRichTextParagraph);
if (firstNode && previousNode)
{
wxRichTextParagraph* previousParagraph = wxDynamicCast(previousNode->GetData(), wxRichTextParagraph);
@@
-589,10
+591,13
@@
bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl
// Assume this box only contains paragraphs
wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph);
// Assume this box only contains paragraphs
wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph);
- wx
ASSERT (child != NULL
);
+ wx
CHECK_MSG( child, false, _T("Unknown object in layout")
);
// TODO: what if the child hasn't been laid out (e.g. involved in Undo) but still has 'old' lines
// TODO: what if the child hasn't been laid out (e.g. involved in Undo) but still has 'old' lines
- if (child && !forceQuickLayout && (layoutAll || child->GetLines().GetCount() == 0 || !child->GetRange().IsOutside(invalidRange)))
+ if ( !forceQuickLayout &&
+ (layoutAll ||
+ child->GetLines().IsEmpty() ||
+ !child->GetRange().IsOutside(invalidRange)) )
{
child->Layout(dc, availableSpace, style);
{
child->Layout(dc, availableSpace, style);
@@
-1130,8
+1135,6
@@
bool wxRichTextParagraphLayoutBox::InsertFragment(long position, wxRichTextFragm
return true;
}
return true;
}
-
- return false;
}
/// Make a copy of the fragment corresponding to the given range, putting it in 'fragment'.
}
/// Make a copy of the fragment corresponding to the given range, putting it in 'fragment'.
@@
-3851,6
+3854,7
@@
bool wxRichTextBuffer::PasteFromClipboard(long position)
wxTextDataObject data;
wxTheClipboard->GetData(data);
wxString text(data.GetText());
wxTextDataObject data;
wxTheClipboard->GetData(data);
wxString text(data.GetText());
+ text.Replace(_T("\r\n"), _T("\n"));
InsertTextWithUndo(position+1, text, GetRichTextCtrl());
InsertTextWithUndo(position+1, text, GetRichTextCtrl());