X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07d4142fc49c5a282470a3b32af6575939c07baf..21b5902b816cb65bcfe2629fb8b85deb0f14d807:/src/richtext/richtextbuffer.cpp diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 324ce85e36..cac09f4e06 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -1736,7 +1736,7 @@ int wxRichTextParagraphLayoutBox::HitTest(wxDC& dc, const wxPoint& pt, long& tex return wxRICHTEXT_HITTEST_NONE; int ret = wxRICHTEXT_HITTEST_NONE; - if (m_floatCollector) + if (m_floatCollector && (flags & wxRICHTEXT_HITTEST_NO_FLOATING_OBJECTS) == 0) ret = m_floatCollector->HitTest(dc, pt, textPosition, obj, flags); if (ret == wxRICHTEXT_HITTEST_NONE) @@ -4366,7 +4366,7 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style) int paraDescent = 0; // This calculates the partial text extents - GetRangeSize(GetRange(), paraSize, paraDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_CACHE_SIZE, wxPoint(0,0), & partialExtents); + GetRangeSize(GetRange(), paraSize, paraDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_CACHE_SIZE, rect.GetPosition(), & partialExtents); #else node = m_children.GetFirst(); while (node) @@ -6668,13 +6668,13 @@ bool wxRichTextParagraphLayoutBox::InsertTextWithUndo(long pos, const wxString& int length = action->GetNewParagraphs().GetOwnRange().GetLength(); - if (text.length() > 0 && text.Last() != wxT('\n')) + if (!text.empty() && text.Last() != wxT('\n')) { // Don't count the newline when undoing length --; action->GetNewParagraphs().SetPartialParagraph(true); } - else if (text.length() > 0 && text.Last() == wxT('\n')) + else if (!text.empty() && text.Last() == wxT('\n')) length --; action->SetPosition(pos); @@ -8914,7 +8914,7 @@ wxRichTextCell* wxRichTextTable::GetCell(int row, int col) const return wxDynamicCast(obj, wxRichTextCell); } else - return false; + return NULL; } // Returns a selection object specifying the selections between start and end character positions. @@ -9765,7 +9765,11 @@ void wxRichTextAction::UpdateAppearance(long caretPosition, bool sendUpdateEvent m_ctrl->Refresh(false); m_ctrl->PositionCaret(); - m_ctrl->SetDefaultStyleToCursorStyle(); + + // This causes styles to persist when doing programmatic + // content creation except when Freeze/Thaw is used, so + // disable this and check for the consequences. + // m_ctrl->SetDefaultStyleToCursorStyle(); if (sendUpdateEvent) wxTextCtrl::SendTextUpdatedEvent(m_ctrl);