VirtualBox

Ignore:
Timestamp:
Aug 19, 2020 9:12:33 AM (4 years ago)
Author:
vboxsync
Message:

Shared Clipboard/X11: Major cleanup for string conversion functions. Not fully tested yet.

Location:
trunk/src/VBox/Additions/darwin/VBoxClient
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardGuestToHost.cpp

    r82968 r85828  
    222222
    223223    size_t cwcActual; /* (includes a schwarzenegger character) */
    224     int rc = ShClUtf16GetWinSize(pwszData, cbData / sizeof(RTUTF16), &cwcActual);
     224    int rc = ShClUtf16LFLenUtf8(pwszData, cbData / sizeof(RTUTF16), &cwcActual);
    225225    AssertReturn(RT_SUCCESS(rc), rc);
    226226
     
    228228    AssertReturn(pwszWinTmp, VERR_NO_MEMORY);
    229229
    230     rc = ShClUtf16LinToWin(pwszData, cbData / sizeof(RTUTF16), pwszWinTmp, cwcActual);
     230    rc = ShClConvUtf16LFToCRLF(pwszData, cbData / sizeof(RTUTF16), pwszWinTmp, cwcActual);
    231231    if (RT_SUCCESS(rc))
    232232        rc = vbclClipboardHostPasteData(u32ClientId, VBOX_SHCL_FMT_UNICODETEXT,
  • trunk/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardHostToGuest.cpp

    r82968 r85828  
    169169
    170170    /* Convert END-OF-LINE */
    171     rc = ShClUtf16GetLinSize((RTUTF16 *)pData, cbDataSize / 2, &cbActualLen);
     171    rc = ShClUtf16CRLFLenUtf8((RTUTF16 *)pData, cbDataSize / sizeof(RTUTF16), &cbActualLen);
    172172    AssertReturn(RT_SUCCESS(rc), rc);
    173     pDataInternal = (RTUTF16 *)RTMemAlloc(cbActualLen * 2);
     173    pDataInternal = (RTUTF16 *)RTMemAlloc(cbActualLen * sizeof(RTUTF16));
    174174    AssertReturn(pDataInternal, VERR_NO_MEMORY);
    175     rc = ShClUtf16WinToLin((RTUTF16 *)pData, cbDataSize / 2, pDataInternal, cbActualLen);
     175    rc = ShClConvUtf16CRLFToLF((RTUTF16 *)pData, cbDataSize / sizeof(RTUTF16), pDataInternal, cbActualLen);
    176176
    177177    /* Do actual paste */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette