From 908c4056119d49b1b90f6618d38c85d080db152d Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 1 Jul 2010 15:28:30 +0000 Subject: [PATCH] Use wxScopedCharBuffer in To8BitData() in ANSI build too. This allows one to write code compatible with both Unicode and ANSI builds. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/string.h | 3 ++- interface/wx/string.h | 7 +------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/wx/string.h b/include/wx/string.h index 58a6ed7cd8..1ab7bd3446 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -1800,7 +1800,8 @@ public: // version for NUL-terminated data: static wxString From8BitData(const char *data) { return wxString(data); } - const char *To8BitData() const { return c_str(); } + const wxScopedCharBuffer To8BitData() const + { return wxScopedCharBuffer::CreateNonOwned(wx_str(), length()); } #endif // Unicode/ANSI // conversions with (possible) format conversions: have to return a diff --git a/interface/wx/string.h b/interface/wx/string.h index 74f34ad6da..a83d50811a 100644 --- a/interface/wx/string.h +++ b/interface/wx/string.h @@ -492,12 +492,7 @@ public: @see wxString::From8BitData() */ - const char* To8BitData() const; - - /** - @overload - */ - const wxCharBuffer To8BitData() const; + const wxScopedCharBuffer To8BitData() const; /** Converts the string to an ASCII, 7-bit string in the form of -- 2.45.2