]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxScopedCharBuffer in To8BitData() in ANSI build too.
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 1 Jul 2010 15:28:30 +0000 (15:28 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 1 Jul 2010 15:28:30 +0000 (15:28 +0000)
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
interface/wx/string.h

index 58a6ed7cd8fe86d1cb545f6bd4031a899d069a91..1ab7bd3446ce76aec850a55c2ead0dc55b834300 100644 (file)
@@ -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
index 74f34ad6dab0d8201374e2decdad260b423b2eb8..a83d50811ac8d4d6a4b96800329365bb140bd526 100644 (file)
@@ -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