X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwclipbrd.c;h=cb4b5f1b4e94f6dd5b432b828af1ab68b43043bb;hb=d3e72e265a417fa9dcbc0e040184b93df99cd894;hp=56543c9f25a4497415b67ebc6c2aea8b3e34c1fb;hpb=7b4dacf6fe9f8c10b6eb4d6070869a3d933dbeb5;p=xboard.git diff --git a/winboard/wclipbrd.c b/winboard/wclipbrd.c index 56543c9..cb4b5f1 100644 --- a/winboard/wclipbrd.c +++ b/winboard/wclipbrd.c @@ -1,7 +1,9 @@ /* * wclipbrd.c -- Clipboard routines for WinBoard * - * Copyright 2000,2009 Free Software Foundation, Inc. + * Copyright 2000, 2009, 2010 Free Software Foundation, Inc. + * + * Enhancements Copyright 2005 Alessandro Scotti * * ------------------------------------------------------------------------ * @@ -30,9 +32,9 @@ #include #include "common.h" -#include "winboard.h" #include "frontend.h" #include "backend.h" +#include "winboard.h" #include "wclipbrd.h" /* Imports from winboard.c */ @@ -48,6 +50,7 @@ CopyFENToClipboard() { char *fen = NULL; + if(gameMode == EditPosition) EditPositionDone(TRUE); // [HGM] mak sure castling rights are set consistently fen = PositionToFEN(currentMove, NULL); if (!fen) { DisplayError("Unable to convert position to FEN.", 0); @@ -298,17 +301,8 @@ VOID PasteGameOrFENFromClipboard() return; } -#if 0 - tmp = buf; - while( *tmp == ' ' || *tmp == '\t' || *tmp == '\r' || *tmp == '\n' ) { - tmp++; - } - - if( *tmp == '[' ) { -#else // [HGM] paste any: make still smarter, to allow pasting of games without tags, recognize FEN in stead if(!ParseFEN(dummyBoard, &dummy, buf) ) { -#endif PasteGameFromString( buf ); } else { @@ -356,15 +350,11 @@ PasteTextFromClipboard(char **text) fprintf(debugFP, "PasteTextFromClipboard(): lock count %d\n", lockCount); } SetLastError(NO_ERROR); -#if 1 /*suggested by Wilkin Ng*/ lockCount = GlobalFlags(hClipMem) & GMEM_LOCKCOUNT; if (lockCount) { locked = GlobalUnlock(hClipMem); } -#else - locked = GlobalUnlock(hClipMem); -#endif err = GetLastError(); if (appData.debugMode) { lockCount = GlobalFlags(hClipMem) & GMEM_LOCKCOUNT;