wxTinderbox build fixes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35978 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d21423356e
commit
39a1c2f2dd
@ -548,7 +548,7 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl
|
|||||||
int maxWidth = 0;
|
int maxWidth = 0;
|
||||||
|
|
||||||
wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
|
wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
|
||||||
|
|
||||||
bool layoutAll = true;
|
bool layoutAll = true;
|
||||||
|
|
||||||
// Get invalid range, rounding to paragraph start/end.
|
// Get invalid range, rounding to paragraph start/end.
|
||||||
@ -582,7 +582,7 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl
|
|||||||
|
|
||||||
// A way to force speedy rest-of-buffer layout (the 'else' below)
|
// A way to force speedy rest-of-buffer layout (the 'else' below)
|
||||||
bool forceQuickLayout = false;
|
bool forceQuickLayout = false;
|
||||||
|
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
// Assume this box only contains paragraphs
|
// Assume this box only contains paragraphs
|
||||||
@ -1780,7 +1780,7 @@ void wxRichTextParagraphLayoutBox::Reset()
|
|||||||
void wxRichTextParagraphLayoutBox::Invalidate(const wxRichTextRange& invalidRange)
|
void wxRichTextParagraphLayoutBox::Invalidate(const wxRichTextRange& invalidRange)
|
||||||
{
|
{
|
||||||
SetDirty(true);
|
SetDirty(true);
|
||||||
|
|
||||||
if (invalidRange == wxRICHTEXT_ALL)
|
if (invalidRange == wxRICHTEXT_ALL)
|
||||||
{
|
{
|
||||||
m_invalidRange = wxRICHTEXT_ALL;
|
m_invalidRange = wxRICHTEXT_ALL;
|
||||||
@ -1790,7 +1790,7 @@ void wxRichTextParagraphLayoutBox::Invalidate(const wxRichTextRange& invalidRang
|
|||||||
// Already invalidating everything
|
// Already invalidating everything
|
||||||
if (m_invalidRange == wxRICHTEXT_ALL)
|
if (m_invalidRange == wxRICHTEXT_ALL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((invalidRange.GetStart() < m_invalidRange.GetStart()) || m_invalidRange.GetStart() == -1)
|
if ((invalidRange.GetStart() < m_invalidRange.GetStart()) || m_invalidRange.GetStart() == -1)
|
||||||
m_invalidRange.SetStart(invalidRange.GetStart());
|
m_invalidRange.SetStart(invalidRange.GetStart());
|
||||||
if (invalidRange.GetEnd() > m_invalidRange.GetEnd())
|
if (invalidRange.GetEnd() > m_invalidRange.GetEnd())
|
||||||
@ -1802,9 +1802,9 @@ wxRichTextRange wxRichTextParagraphLayoutBox::GetInvalidRange(bool wholeParagrap
|
|||||||
{
|
{
|
||||||
if (m_invalidRange == wxRICHTEXT_ALL || m_invalidRange == wxRICHTEXT_NONE)
|
if (m_invalidRange == wxRICHTEXT_ALL || m_invalidRange == wxRICHTEXT_NONE)
|
||||||
return m_invalidRange;
|
return m_invalidRange;
|
||||||
|
|
||||||
wxRichTextRange range = m_invalidRange;
|
wxRichTextRange range = m_invalidRange;
|
||||||
|
|
||||||
if (wholeParagraphs)
|
if (wholeParagraphs)
|
||||||
{
|
{
|
||||||
wxRichTextParagraph* para1 = GetParagraphAtPosition(range.GetStart());
|
wxRichTextParagraph* para1 = GetParagraphAtPosition(range.GetStart());
|
||||||
@ -2101,7 +2101,7 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
|
|||||||
|
|
||||||
// Add a new line
|
// Add a new line
|
||||||
wxRichTextLine* line = AllocateLine(lineCount);
|
wxRichTextLine* line = AllocateLine(lineCount);
|
||||||
|
|
||||||
// Set relative range so we won't have to change line ranges when paragraphs are moved
|
// Set relative range so we won't have to change line ranges when paragraphs are moved
|
||||||
line->SetRange(wxRichTextRange(actualRange.GetStart() - GetRange().GetStart(), actualRange.GetEnd() - GetRange().GetStart()));
|
line->SetRange(wxRichTextRange(actualRange.GetStart() - GetRange().GetStart(), actualRange.GetEnd() - GetRange().GetStart()));
|
||||||
line->SetPosition(currentPosition);
|
line->SetPosition(currentPosition);
|
||||||
@ -3823,12 +3823,16 @@ bool wxRichTextBuffer::SaveFile(wxOutputStream& stream, int type)
|
|||||||
bool wxRichTextBuffer::CopyToClipboard(const wxRichTextRange& range)
|
bool wxRichTextBuffer::CopyToClipboard(const wxRichTextRange& range)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
wxString text = GetTextForRange(range);
|
wxString text = GetTextForRange(range);
|
||||||
if (!wxTheClipboard->IsOpened() && wxTheClipboard->Open())
|
if (!wxTheClipboard->IsOpened() && wxTheClipboard->Open())
|
||||||
{
|
{
|
||||||
success = wxTheClipboard->SetData(new wxTextDataObject(text));
|
success = wxTheClipboard->SetData(new wxTextDataObject(text));
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
wxUnusedVar(range);
|
||||||
|
#endif
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3836,6 +3840,7 @@ bool wxRichTextBuffer::CopyToClipboard(const wxRichTextRange& range)
|
|||||||
bool wxRichTextBuffer::PasteFromClipboard(long position)
|
bool wxRichTextBuffer::PasteFromClipboard(long position)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
if (CanPasteFromClipboard())
|
if (CanPasteFromClipboard())
|
||||||
{
|
{
|
||||||
if (wxTheClipboard->Open())
|
if (wxTheClipboard->Open())
|
||||||
@ -3876,6 +3881,9 @@ bool wxRichTextBuffer::PasteFromClipboard(long position)
|
|||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
wxUnusedVar(position);
|
||||||
|
#endif
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3883,6 +3891,7 @@ bool wxRichTextBuffer::PasteFromClipboard(long position)
|
|||||||
bool wxRichTextBuffer::CanPasteFromClipboard() const
|
bool wxRichTextBuffer::CanPasteFromClipboard() const
|
||||||
{
|
{
|
||||||
bool canPaste = false;
|
bool canPaste = false;
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
if (!wxTheClipboard->IsOpened() && wxTheClipboard->Open())
|
if (!wxTheClipboard->IsOpened() && wxTheClipboard->Open())
|
||||||
{
|
{
|
||||||
if (wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_BITMAP))
|
if (wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_BITMAP))
|
||||||
@ -3891,6 +3900,7 @@ bool wxRichTextBuffer::CanPasteFromClipboard() const
|
|||||||
}
|
}
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return canPaste;
|
return canPaste;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4906,10 +4916,10 @@ bool wxRichTextPlainTextHandler::DoLoadFile(wxRichTextBuffer *buffer, wxInputStr
|
|||||||
{
|
{
|
||||||
if (ch == 10 && lastCh != 13)
|
if (ch == 10 && lastCh != 13)
|
||||||
str += wxT('\n');
|
str += wxT('\n');
|
||||||
|
|
||||||
if (ch > 0 && ch != 10)
|
if (ch > 0 && ch != 10)
|
||||||
str += wxChar(ch);
|
str += wxChar(ch);
|
||||||
|
|
||||||
lastCh = ch;
|
lastCh = ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5203,4 +5213,3 @@ bool wxRichTextImageBlock::WriteBlock(const wxString& filename, unsigned char* b
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_RICHTEXT
|
// wxUSE_RICHTEXT
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user