Unicode compilation fix (bug 809707)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Sep 2003 11:35:06 +0000 (11:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Sep 2003 11:35:06 +0000 (11:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/textctrl.cpp

index 6a3af8adab6b4235ecdb8d94cabad21aa0000ebe..9730fe999206679d1c29958eea687c2c0f31f826 100644 (file)
@@ -530,6 +530,7 @@ wxString wxTextCtrl::GetRange(long from, long to) const
             if ( to == -1 )
                 to = len;
 
+#if !wxUSE_UNICODE
             // we must use EM_STREAMOUT if we don't want to lose all characters
             // not representable in the current character set (EM_GETTEXTRANGE
             // simply replaces them with question marks...)
@@ -556,6 +557,7 @@ wxString wxTextCtrl::GetRange(long from, long to) const
 
             // StreamOut() wasn't used or failed, try to do it in normal way
             if ( str.empty() )
+#endif // !wxUSE_UNICODE
             {
                 // alloc one extra WORD as needed by the control
                 wxStringBuffer tmp(str, ++len);
@@ -563,7 +565,7 @@ wxString wxTextCtrl::GetRange(long from, long to) const
 
                 TEXTRANGE textRange;
                 textRange.chrg.cpMin = from;
-                textRange.chrg.cpMax = to == -1 ? len : to;
+                textRange.chrg.cpMax = to;
                 textRange.lpstrText = p;
 
                 (void)SendMessage(GetHwnd(), EM_GETTEXTRANGE,