From 31002e44b5b5d096f31216a1606dbfd8653c45cf Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 11 Mar 2007 12:48:38 +0000 Subject: [PATCH] Fixed wrapping with tabs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44766 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index bbdebd1b79..4ac92a5b52 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -3921,9 +3921,11 @@ bool wxRichTextParagraph::FindWrapPosition(const wxRichTextRange& range, wxDC& d else { int spacePos = plainText.Find(wxT(' '), true); - if (spacePos != wxNOT_FOUND) + int tabPos = plainText.Find(wxT('\t'), true); + int pos = wxMax(spacePos, tabPos); + if (pos != wxNOT_FOUND) { - int positionsFromEndOfString = plainText.length() - spacePos - 1; + int positionsFromEndOfString = plainText.length() - pos - 1; breakPosition = breakPosition - positionsFromEndOfString; } } -- 2.45.2