X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab14c7aa5727f3248e64e625ac19412799ca69bc..3ef4e126a2198e33ad3ec09a0211d5579865d880:/include/wx/richtext/richtextbuffer.h diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index 0e90377f23..fa9fd77144 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -214,6 +214,7 @@ public: void operator =(const wxRichTextRange& range) { m_start = range.m_start; m_end = range.m_end; } bool operator ==(const wxRichTextRange& range) const { return (m_start == range.m_start && m_end == range.m_end); } + bool operator !=(const wxRichTextRange& range) const { return (m_start != range.m_start && m_end != range.m_end); } wxRichTextRange operator -(const wxRichTextRange& range) const { return wxRichTextRange(m_start - range.m_start, m_end - range.m_end); } wxRichTextRange operator +(const wxRichTextRange& range) const { return wxRichTextRange(m_start + range.m_start, m_end + range.m_end); } @@ -246,6 +247,12 @@ public: /// Swaps the start and end void Swap() { long tmp = m_start; m_start = m_end; m_end = tmp; } + /// Convert to internal form: (n, n) is the range of a single character. + wxRichTextRange ToInternal() const { return wxRichTextRange(m_start, m_end-1); } + + /// Convert from internal to public API form: (n, n+1) is the range of a single character. + wxRichTextRange FromInternal() const { return wxRichTextRange(m_start, m_end+1); } + protected: long m_start; long m_end; @@ -910,8 +917,8 @@ public: virtual bool SetStyle(const wxRichTextRange& range, const wxTextAttrEx& style, bool withUndo = true); /// Get the text attributes for this position. - virtual bool GetStyle(long position, wxTextAttrEx& style) const; - virtual bool GetStyle(long position, wxRichTextAttr& style) const; + virtual bool GetStyle(long position, wxTextAttrEx& style); + virtual bool GetStyle(long position, wxRichTextAttr& style); /// Test if this whole range has character attributes of the specified kind. If any /// of the attributes are different within the range, the test fails. You