Ignore:
Timestamp:
Aug 20, 2006, 9:50:11 AM (19 years ago)
Author:
bird
Message:

fixed a couple of clipboard issues. seems to work now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/synergy/lib/platform/CPMClipboardAnyTextConverter.cpp

    r2752 r2774  
    33 * Copyright (C) 2002 Chris Schoeneman
    44 * Copyright (C) 2006 Knut St. Osmundsen
    5  * 
     5 *
    66 * This package is free software; you can redistribute it and/or
    77 * modify it under the terms of the GNU General Public License
    88 * found in the file COPYING that should have accompanied this file.
    9  * 
     9 *
    1010 * This package is distributed in the hope that it will be useful,
    1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     
    1515
    1616#include "CPMClipboardAnyTextConverter.h"
     17#include "CLog.h"
    1718
    1819//
     
    5051        // copy to memory handle
    5152    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);
    5354    if (rc == NO_ERROR) {
    54         return (ULONG)memcpy(pv, text.data(), cb);
     55                const char *psz = text.c_str();
     56LOG((CLOG_DEBUG "fromIClipboard: psz='%s' cb=%d strlen=%d\n", psz, cb, strlen(psz)));
     57        return (ULONG)memcpy(pv, psz, cb);
    5558    }
    5659    return 0;
    5760}
    5861
    59 void 
     62void
    6063CPMClipboardAnyTextConverter::freePMData(ULONG ulPMData) const
    6164{
     
    6871        // convert text
    6972    const char *psz = (const char *)data;
    70         CString text = doToIClipboard(CString(psz));
     73LOG((CLOG_DEBUG "toIClipboard: psz='%s' strlen=%d\n", psz, strlen(psz)));
     74        CString raw = CString(psz);
     75LOG((CLOG_DEBUG "toIClipboard: raw='%s'\n", raw.c_str()));
     76        CString text = doToIClipboard(raw);
     77LOG((CLOG_DEBUG "toIClipboard: text='%s'\n", text.c_str()));
    7178
    7279        // convert newlines
     
    7784CPMClipboardAnyTextConverter::convertLinefeedToPM(const CString& src) const
    7885{
    79         // note -- we assume src is a valid UTF-8 string
     86        // note -- we assume src is a valid UTF-8 string    L
    8087
    8188        // count newlines in string
Note: See TracChangeset for help on using the changeset viewer.