- Timestamp:
- Jun 26, 2009 10:19:23 AM (16 years ago)
- Location:
- trunk/src/VBox/GuestHost/SharedClipboard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-helper.cpp
r19505 r20966 53 53 if (pwszSrc[i] == LINEFEED) 54 54 ++cwDest; 55 #ifdef RT_OS_DARWIN 55 56 /* Check for a single carriage return (MacOS) */ 56 57 if (pwszSrc[i] == CARRIAGERETURN) 57 58 ++cwDest; 59 #endif 58 60 if (pwszSrc[i] == 0) 59 61 { … … 117 119 } 118 120 } 121 #ifdef RT_OS_DARWIN 119 122 /* Check for a single carriage return (MacOS) */ 120 123 else if (pwszSrc[i] == CARRIAGERETURN) … … 132 135 continue; 133 136 } 137 #endif 134 138 pu16Dest[j] = pwszSrc[i]; 135 139 } -
trunk/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp
r20551 r20966 2184 2184 if (!testStringFromX11(pCtx, "hello\r\nworld", VINF_SUCCESS)) 2185 2185 ++cErrs; 2186 /* With an embedded CRLF */ 2187 clipSetSelectionValues("text/plain;charset=UTF-8", XA_STRING, 2188 "hello\r\nworld", sizeof("hello\r\nworld"), 8); 2189 if (!testStringFromX11(pCtx, "hello\r\r\nworld", VINF_SUCCESS)) 2190 ++cErrs; 2191 /* With an embedded LFCR */ 2192 clipSetSelectionValues("text/plain;charset=UTF-8", XA_STRING, 2193 "hello\n\rworld", sizeof("hello\n\rworld"), 8); 2194 if (!testStringFromX11(pCtx, "hello\r\n\rworld", VINF_SUCCESS)) 2195 ++cErrs; 2186 2196 /* An empty string */ 2187 2197 clipSetSelectionValues("text/plain;charset=utf-8", XA_STRING, "", … … 2213 2223 if (!testStringFromX11(pCtx, "hello\r\nworld", VINF_SUCCESS)) 2214 2224 ++cErrs; 2225 /* With an embedded CRLF */ 2226 clipSetSelectionValues("COMPOUND_TEXT", XA_STRING, "hello\r\nworld", 2227 sizeof("hello\r\nworld"), 8); 2228 if (!testStringFromX11(pCtx, "hello\r\r\nworld", VINF_SUCCESS)) 2229 ++cErrs; 2230 /* With an embedded LFCR */ 2231 clipSetSelectionValues("COMPOUND_TEXT", XA_STRING, "hello\n\rworld", 2232 sizeof("hello\n\rworld"), 8); 2233 if (!testStringFromX11(pCtx, "hello\r\n\rworld", VINF_SUCCESS)) 2234 ++cErrs; 2215 2235 /* An empty string */ 2216 2236 clipSetSelectionValues("COMPOUND_TEXT", XA_STRING, "", … … 2235 2255 sizeof("Georges\nDupr\xEA"), 8); 2236 2256 if (!testLatin1FromX11(pCtx, "Georges\r\nDupr\xEA", VINF_SUCCESS)) 2257 ++cErrs; 2258 /* With an embedded CRLF */ 2259 clipSetSelectionValues("TEXT", XA_STRING, "Georges\r\nDupr\xEA", 2260 sizeof("Georges\r\nDupr\xEA"), 8); 2261 if (!testLatin1FromX11(pCtx, "Georges\r\r\nDupr\xEA", VINF_SUCCESS)) 2262 ++cErrs; 2263 /* With an embedded LFCR */ 2264 clipSetSelectionValues("TEXT", XA_STRING, "Georges\n\rDupr\xEA", 2265 sizeof("Georges\n\rDupr\xEA"), 8); 2266 if (!testLatin1FromX11(pCtx, "Georges\r\n\rDupr\xEA", VINF_SUCCESS)) 2237 2267 ++cErrs; 2238 2268 /* A non-zero-terminated string */ … … 2334 2364 "hello\nworld", sizeof("hello\nworld"), 8)) 2335 2365 ++cErrs; 2366 /* With an embedded CRCRLF */ 2367 clipSetVBoxUtf16(pCtx, VINF_SUCCESS, "hello\r\r\nworld", 2368 sizeof("hello\r\r\nworld") * 2); 2369 if (!testStringFromVBox(pCtx, "text/plain;charset=UTF-8", 2370 clipGetAtom(NULL, "text/plain;charset=UTF-8"), 2371 "hello\r\nworld", sizeof("hello\r\nworld"), 8)) 2372 ++cErrs; 2373 /* With an embedded CRLFCR */ 2374 clipSetVBoxUtf16(pCtx, VINF_SUCCESS, "hello\r\n\rworld", 2375 sizeof("hello\r\n\rworld") * 2); 2376 if (!testStringFromVBox(pCtx, "text/plain;charset=UTF-8", 2377 clipGetAtom(NULL, "text/plain;charset=UTF-8"), 2378 "hello\n\rworld", sizeof("hello\n\rworld"), 8)) 2379 ++cErrs; 2336 2380 /* An empty string */ 2337 2381 clipSetVBoxUtf16(pCtx, VINF_SUCCESS, "", 2); … … 2370 2414 clipGetAtom(NULL, "COMPOUND_TEXT"), 2371 2415 "hello\nworld", sizeof("hello\nworld"), 8)) 2416 ++cErrs; 2417 /* With an embedded CRCRLF */ 2418 clipSetVBoxUtf16(pCtx, VINF_SUCCESS, "hello\r\r\nworld", 2419 sizeof("hello\r\r\nworld") * 2); 2420 if (!testStringFromVBox(pCtx, "COMPOUND_TEXT", 2421 clipGetAtom(NULL, "COMPOUND_TEXT"), 2422 "hello\r\nworld", sizeof("hello\r\nworld"), 8)) 2423 ++cErrs; 2424 /* With an embedded CRLFCR */ 2425 clipSetVBoxUtf16(pCtx, VINF_SUCCESS, "hello\r\n\rworld", 2426 sizeof("hello\r\n\rworld") * 2); 2427 if (!testStringFromVBox(pCtx, "COMPOUND_TEXT", 2428 clipGetAtom(NULL, "COMPOUND_TEXT"), 2429 "hello\n\rworld", sizeof("hello\n\rworld"), 8)) 2372 2430 ++cErrs; 2373 2431 /* An empty string */
Note:
See TracChangeset
for help on using the changeset viewer.