- Timestamp:
- Aug 20, 2006, 9:50:11 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/synergy/lib/platform/CPMClipboardAnyTextConverter.cpp
r2752 r2774 3 3 * Copyright (C) 2002 Chris Schoeneman 4 4 * Copyright (C) 2006 Knut St. Osmundsen 5 * 5 * 6 6 * This package is free software; you can redistribute it and/or 7 7 * modify it under the terms of the GNU General Public License 8 8 * found in the file COPYING that should have accompanied this file. 9 * 9 * 10 10 * This package is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 15 15 16 16 #include "CPMClipboardAnyTextConverter.h" 17 #include "CLog.h" 17 18 18 19 // … … 50 51 // copy to memory handle 51 52 PVOID pv = NULL; 52 APIRET rc = DosAllocSharedMem(&pv, NULL, cb , PAG_READ | PAG_WRITE | PAG_COMMIT | OBJ_GETTABLE | OBJ_GIVEABLE);53 APIRET rc = DosAllocSharedMem(&pv, NULL, cb + 1, PAG_READ | PAG_WRITE | PAG_COMMIT | OBJ_GETTABLE | OBJ_GIVEABLE); 53 54 if (rc == NO_ERROR) { 54 return (ULONG)memcpy(pv, text.data(), cb); 55 const char *psz = text.c_str(); 56 LOG((CLOG_DEBUG "fromIClipboard: psz='%s' cb=%d strlen=%d\n", psz, cb, strlen(psz))); 57 return (ULONG)memcpy(pv, psz, cb); 55 58 } 56 59 return 0; 57 60 } 58 61 59 void 62 void 60 63 CPMClipboardAnyTextConverter::freePMData(ULONG ulPMData) const 61 64 { … … 68 71 // convert text 69 72 const char *psz = (const char *)data; 70 CString text = doToIClipboard(CString(psz)); 73 LOG((CLOG_DEBUG "toIClipboard: psz='%s' strlen=%d\n", psz, strlen(psz))); 74 CString raw = CString(psz); 75 LOG((CLOG_DEBUG "toIClipboard: raw='%s'\n", raw.c_str())); 76 CString text = doToIClipboard(raw); 77 LOG((CLOG_DEBUG "toIClipboard: text='%s'\n", text.c_str())); 71 78 72 79 // convert newlines … … 77 84 CPMClipboardAnyTextConverter::convertLinefeedToPM(const CString& src) const 78 85 { 79 // note -- we assume src is a valid UTF-8 string 86 // note -- we assume src is a valid UTF-8 string L 80 87 81 88 // count newlines in string
Note:
See TracChangeset
for help on using the changeset viewer.