Ejemplo n.º 1
0
Bool WPasteMenuItem( WMenuEditInfo *einfo )
{
    WMenuEntry  *entry;
    void        *data;
    uint_32     dsize;
    Bool        ok;

    data = NULL;
    ok = (einfo != NULL);

    if( ok ) {
        ok = WGetClipData( einfo->win, WItemClipbdFormat, &data, &dsize );
    }

    if( ok ) {
        entry = WMakeMenuEntryFromClipData( data, dsize );
        ok = (entry != NULL);
    }

    if( ok ) {
        ok = WResolveEntries( entry, einfo->info->symbol_table );
    }

    if( ok ) {
        ok = WInsertMenuEntry( einfo, entry, TRUE );
    }

    if( data != NULL ) {
        WMemFree( data );
    }

    return( ok );
}
Ejemplo n.º 2
0
bool WPasteAccelItem( WAccelEditInfo *einfo )
{
    WAccelEntry entry;
    void        *data;
    uint_32     dsize;
    bool        ok;

    data = NULL;
    entry.symbol = NULL;

    ok = (einfo != NULL);

    if( ok ) {
        ok = WGetClipData( einfo->win, WItemClipbdFormat, &data, &dsize );
    }

    if( ok ) {
        ok = WMakeEntryFromClipData( &entry, data, dsize );
    }

    if( ok ) {
        WResolveEntrySymbol( &entry, einfo->info->symbol_table );
        ok = WSetEditWindowKeyEntry( einfo, &entry );
    }

    if( ok ) {
        ok = WInsertAccelEntry( einfo );
    }

    if( entry.symbol != NULL ) {
        WRMemFree( entry.symbol );
    }

    if( data != NULL ) {
        WRMemFree( data );
    }

    return( ok );
}