From 5e3aae808c480d5b63122c15e45caadce47a481b Mon Sep 17 00:00:00 2001 From: "varada%netscape.com" Date: Fri, 17 Sep 1999 20:29:40 +0000 Subject: [PATCH] Checking in a fix for the browse button not retaining the previous value when the open file dialog is cancelled. --- cck/driver/WizardUI.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cck/driver/WizardUI.cpp b/cck/driver/WizardUI.cpp index ff1d17ef94cf..8800e3d25f79 100644 --- a/cck/driver/WizardUI.cpp +++ b/cck/driver/WizardUI.cpp @@ -538,10 +538,17 @@ BOOL CWizardUI::OnCommand(WPARAM wParam, LPARAM lParam) // This is to browse to a file CFileDialog fileDlg(TRUE, NULL, NULL, OFN_OVERWRITEPROMPT, NULL, NULL); int retVal = fileDlg.DoModal(); - - CString fullFileName = fileDlg.GetPathName(); + CString fullFileName=""; + + WIDGET* editWidget = CurrentNode->pageWidgets[i-1]; - ((CEdit*)editWidget->control)->SetWindowText(fullFileName); +//Checking to see if the open file dialog did get a value or was merely cancelled. +//If it was cancelled then the value of the edit box is not changed. + if (fileDlg.GetPathName() != "") + { + fullFileName = fileDlg.GetPathName(); + ((CEdit*)editWidget->control)->SetWindowText(fullFileName); + } } else if (curWidget->action.function == "BrowseDir") { // The following code is used to browse to a dir