summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2007-03-10 00:27:20 +0000
committerDarkvater <Darkvater@openttd.org>2007-03-10 00:27:20 +0000
commit6f36db349f55ef9079e71ff816d6cdd39d12dc11 (patch)
tree6cd3543eaa1196dc012d846c600d856f6787890b /src
parenta59eec1c3653a52e27fb566569c566b549dd4ef6 (diff)
downloadopenttd-6f36db349f55ef9079e71ff816d6cdd39d12dc11.tar.xz
(svn r9084) -Fix: [win9x] Clipboard paste for Windows95 (doesn't have CF_UNICODETEXT) correctly converts the input to the current locale.
Diffstat (limited to 'src')
-rw-r--r--src/win32.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/win32.cpp b/src/win32.cpp
index 33e5fd964..232fdc6ad 100644
--- a/src/win32.cpp
+++ b/src/win32.cpp
@@ -993,25 +993,26 @@ bool InsertTextBufferClipboard(Textbuf *tb)
uint16 width, length;
if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
- const char *ret;
-
OpenClipboard(NULL);
cbuf = GetClipboardData(CF_UNICODETEXT);
ptr = (const char*)GlobalLock(cbuf);
- ret = convert_from_fs((wchar_t*)ptr, utf8_buf, lengthof(utf8_buf));
+ const char *ret = convert_from_fs((wchar_t*)ptr, utf8_buf, lengthof(utf8_buf));
GlobalUnlock(cbuf);
CloseClipboard();
if (*ret == '\0') return false;
+#if !defined(UNICODE)
} else if (IsClipboardFormatAvailable(CF_TEXT)) {
OpenClipboard(NULL);
cbuf = GetClipboardData(CF_TEXT);
ptr = (const char*)GlobalLock(cbuf);
- ttd_strlcpy(utf8_buf, ptr, lengthof(utf8_buf));
+ ttd_strlcpy(utf8_buf, FS2OTTD(ptr), lengthof(utf8_buf));
+
GlobalUnlock(cbuf);
CloseClipboard();
+#endif /* UNICODE */
} else {
return false;
}