From 769dd0cee1633d22ac9ecb6d4ee676aa15a77403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 31 Dec 2007 08:58:05 +0000 Subject: [PATCH] use iterator in wxTextBuffer::Translate() instead of c_str() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/textbuf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/textbuf.cpp b/src/common/textbuf.cpp index 17e00fac41..b6e8362c85 100644 --- a/src/common/textbuf.cpp +++ b/src/common/textbuf.cpp @@ -80,14 +80,14 @@ wxString wxTextBuffer::Translate(const wxString& text, wxTextFileType type) wxString eol = GetEOL(type), result; // optimization: we know that the length of the new string will be about - // the same as the length of the old one, so prealloc memory to aviod + // the same as the length of the old one, so prealloc memory to avoid // unnecessary relocations result.Alloc(text.Len()); wxChar chLast = 0; - for ( const wxChar *pc = text.c_str(); *pc; pc++ ) + for ( wxString::const_iterator i = text.begin(); i != text.end(); ++i ) { - wxChar ch = *pc; + wxChar ch = *i; switch ( ch ) { case _T('\n'): // Dos/Unix line termination