Changeset 175


Ignore:
Timestamp:
Jan 3, 2007, 6:32:51 PM (15 years ago)
Author:
Eugene Romanenko
Message:

Copy unicode text to clipboard in Odin32 format (for OpenOffice? etc...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/clipbrd.cpp

    r156 r175  
    4646
    4747
    48 #define kUnicodeMime "text/unicode"
     48#define kUnicodeMimeMozilla "text/unicode"
     49#define kUnicodeMimeOdin    "Odin32 UnicodeText"
    4950
    5051inline ULONG RegisterClipboardFormat(PCSZ pcszFormat)
     
    5960void initClipbrd()
    6061{
    61     RegisterClipboardFormat( kUnicodeMime );
     62    RegisterClipboardFormat( kUnicodeMimeMozilla );
     63    RegisterClipboardFormat( kUnicodeMimeOdin );
    6264}
    6365
     
    98100        void *shmemsys = NULL;
    99101
    100         // place to clipboard as unicode
     102        // place to clipboard as unicode for Odin
    101103        if ( DosAllocSharedMem( &shmemuni, NULL, olen, fALLOCSHR ) == 0 )
    102104        {
     
    109111            memcpy( memuni, shmemuni, olen );
    110112
    111             ULONG ulFormatID = RegisterClipboardFormat( kUnicodeMime );
     113            ULONG ulFormatID = RegisterClipboardFormat( kUnicodeMimeOdin );
    112114            WinSetClipbrdData( hab, (ULONG)shmemuni, ulFormatID, CFI_POINTER );
     115
     116            // place to clipboard as unicode for Mozilla
     117            if ( DosAllocSharedMem( &shmemuni, NULL, olen, fALLOCSHR ) == 0 )
     118            {
     119                memcpy( shmemuni, memuni, olen );
     120                ulFormatID = RegisterClipboardFormat( kUnicodeMimeMozilla );
     121                WinSetClipbrdData( hab, (ULONG)shmemuni, ulFormatID, CFI_POINTER );
     122            }
    113123
    114124            int liglen = uniLigaturesLength( (UniChar *)memuni );
Note: See TracChangeset for help on using the changeset viewer.