WinWorkstation.st
changeset 3502 250667f59792
parent 3501 17789bd642ec
child 3503 572f841dce6f
--- a/WinWorkstation.st	Sat Sep 15 17:18:42 2001 +0200
+++ b/WinWorkstation.st	Mon Sep 17 11:07:16 2001 +0200
@@ -12629,6 +12629,7 @@
     unsigned char *src, *p;
     WIDECHAR *w_src, *w_p;
 
+    /* Unicode */
     if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
         int n, len, realLen;
 
@@ -12639,9 +12640,9 @@
 	    hData = GetClipboardData(CF_UNICODETEXT);
 	    w_src = GlobalLock(hData);
 	    len = w_src ? wcslen(w_src) : 0;
-	    len = len / sizeof(WIDECHAR);
 printf("wcslen = %d\n", len);
-	    /* see how much we really need (when CRLF is replaced by LF)
+	    /* 
+	     * see how much we really need (when CRLF is replaced by LF)
 	     * and if result is really Unicode ...
 	     */
 	    for (realLen = 0, n=len, w_p=w_src; n; ) {
@@ -12657,9 +12658,10 @@
 		    }
 		}
 	    }
+printf("reallen = %d\n; needUnicode=%d", len, needUnicode);
 	    if (! needUnicode) {
 		s = __MKEMPTYSTRING(realLen);
-	        for (n=0, p=__stringVal(s); len; ) {
+	        for (n=0, p = __stringVal(s); len; ) {
 		    unsigned char ch;
 
 		    *p = ch = *w_src++;
@@ -12675,7 +12677,7 @@
 	    } else {
 	        s = __MKBYTEARRAY(realLen * 2);
 	        __qClass(s) = @global(UnicodeString);
-	        for (n=0, w_p=__stringVal(s); len; ) {
+	        for (n=0, w_p = (WIDECHAR *)__stringVal(s); len; ) {
 		    WIDECHAR w_ch;
 
 		    *w_p = w_ch = *w_src++;
@@ -13902,6 +13904,6 @@
 !WinWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.193 2001-09-15 15:18:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.194 2001-09-17 09:07:16 cg Exp $'
 ! !
 WinWorkstation initialize!