From 2132ff0291765de0e6ba1c1febff506e2d9bc308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Sat, 8 Apr 2017 14:40:43 +0200 Subject: [PATCH] Fix wxTextWrapper::Wrap with widthMax=-1 Fix regression introduced in cb2474f where Wrap() stopped treating negative widthMax as documented, i.e. not doing any wrapping at all and only respecting newlines. --- src/common/stattextcmn.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/stattextcmn.cpp b/src/common/stattextcmn.cpp index eb8f05bf3c..203e1f7a51 100644 --- a/src/common/stattextcmn.cpp +++ b/src/common/stattextcmn.cpp @@ -118,6 +118,13 @@ void wxTextWrapper::Wrap(wxWindow *win, const wxString& text, int widthMax) OnNewLine(); } + // Is this a special case when wrapping is disabled? + if ( widthMax < 0 ) + { + DoOutputLine(line); + continue; + } + for ( bool newLine = false; !line.empty(); newLine = true ) { if ( newLine )