X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwclipbrd.c;h=700ccde0172cdd334b54f68ca479dd5c2ec67346;hb=HEAD;hp=340c4b7558b755543b3e4512a7d2088f1e330a53;hpb=e70077aab0199817f37aef9ed0bdba1bbca93b45;p=xboard.git diff --git a/winboard/wclipbrd.c b/winboard/wclipbrd.c index 340c4b7..700ccde 100644 --- a/winboard/wclipbrd.c +++ b/winboard/wclipbrd.c @@ -1,7 +1,8 @@ /* * wclipbrd.c -- Clipboard routines for WinBoard * - * Copyright 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + * Copyright 2000, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free + * Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -42,7 +43,6 @@ /* Imports from winboard.c */ extern HWND hwndMain; -Boolean ParseFEN(Board b, int *stm, char *FEN); /* File globals */ static char *copyTemp; @@ -54,7 +54,7 @@ CopyFENToClipboard() char *fen = NULL; if(gameMode == EditPosition) EditPositionDone(TRUE); // [HGM] mak sure castling rights are set consistently - fen = PositionToFEN(currentMove, NULL); + fen = PositionToFEN(currentMove, NULL, 1); if (!fen) { DisplayError(_("Unable to convert position to FEN."), 0); return; @@ -260,6 +260,7 @@ VOID PasteGameFromString( char * buf ) { FILE *f; size_t len; + int flip = appData.flipView; if (!pasteTemp) { pasteTemp = tempnam(NULL, "wbpt"); } @@ -276,7 +277,9 @@ VOID PasteGameFromString( char * buf ) free(buf); /* [AS] */ return; } + if(!appData.autoFlipView) appData.flipView = flipView; LoadGameFromFile(pasteTemp, 0, "Clipboard", TRUE); + appData.flipView = flip; free( buf ); /* [AS] */ } @@ -301,11 +304,12 @@ VOID PasteGameOrFENFromClipboard() Board dummyBoard; int dummy; // [HGM] paste any if (!PasteTextFromClipboard(&buf)) { + return; } // [HGM] paste any: make still smarter, to allow pasting of games without tags, recognize FEN in stead - if(!ParseFEN(dummyBoard, &dummy, buf) ) { + if(!ParseFEN(dummyBoard, &dummy, buf, 0) ) { PasteGameFromString( buf ); } else {