X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwedittags.c;h=f6782bbfde3ec2ec356d16a9920459c1432cb0b4;hb=c29f3526dee9ab2774d7a6e9958ce145c2cd1187;hp=e0ea7ae43ad5b8fc19914f4a986db6fc0c114046;hpb=79173c63a1184a8c99f5b25ae5d20ccf27ac01bc;p=xboard.git diff --git a/winboard/wedittags.c b/winboard/wedittags.c index e0ea7ae..f6782bb 100644 --- a/winboard/wedittags.c +++ b/winboard/wedittags.c @@ -42,7 +42,7 @@ #define _(s) T_(s) /* Module globals */ -static char *editTagsText; +static char *editTagsText, **resPtr; BOOL editTagsUp = FALSE; BOOL canEditTags = FALSE; @@ -122,12 +122,13 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) GetWindowText(hwndText, str, len + 1); p = q = str; while (*q) { - if (*q == '\r'|| *q == '\n') + if (*q == '\r') q++; else *p++ = *q++; } *p = NULLCHAR; + if(resPtr) *resPtr = strdup(str), err = 0; else err = ReplaceTags(str, &gameInfo); if (err) DisplayError(_("Error replacing tags."), err); @@ -171,7 +172,7 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) VOID TagsPopDown(void) { if (editTagsDialog) ShowWindow(editTagsDialog, SW_HIDE); - CheckMenuItem(GetMenu(hwndMain), IDM_EditTags, MF_UNCHECKED); + CheckMenuItem(GetMenu(hwndMain), IDM_Tags, MF_UNCHECKED); editTagsUp = FALSE; } @@ -201,7 +202,7 @@ VOID EitherTagsPopUp(char *tags, char *msg, BOOLEAN edit) editTagsText = p; canEditTags = edit; - CheckMenuItem(GetMenu(hwndMain), IDM_EditTags, MF_CHECKED); + CheckMenuItem(GetMenu(hwndMain), IDM_Tags, MF_CHECKED); if (editTagsDialog) { SendMessage(editTagsDialog, WM_INITDIALOG, 0, 0); ShowWindow(editTagsDialog, SW_SHOW); @@ -221,8 +222,9 @@ VOID TagsPopUp(char *tags, char *msg) SetActiveWindow(hwnd); } -VOID EditTagsPopUp(char *tags) +VOID EditTagsPopUp(char *tags, char **dest) { + resPtr = dest; EitherTagsPopUp(tags, "", TRUE); }