From: Jean-Marc Lasgouttes Date: Mon, 15 Nov 1999 10:44:32 +0000 (+0000) Subject: askForText() does not abort anymore when clicking 'cancel' X-Git-Tag: 1.6.10~22525 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=aafb97936818638cf851d5aadf17e020148db100;p=lyx.git askForText() does not abort anymore when clicking 'cancel' git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@310 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index fcd777e256..76641c2267 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-11-15 Jean-Marc Lasgouttes + + * src/lyx_gui_misc.C (askForText): when fl_show_input() returns + NULL, make sure to return an empty string (it is not possible to + set a string to NULL). + 1999-11-10 Jean-Marc Lasgouttes * src/support/LRegex.C: use regex_t instead of re_pattern_buffer. diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index ff860e9dcd..2a0b816ab1 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -396,12 +396,15 @@ int AskConfirmation(string const & s1, string const & s2, string const & s3) // Asks for a text string askForText(string const & msg, string const & dflt) { - string tmp; + const char * tmp; fl_set_resource("flInput.cancel.label", idex(_("Cancel|^["))); fl_set_resource("flInput.ok.label", idex(_("OK|#O"))); fl_set_resource("flInput.clear.label", idex(_("Clear|#e"))); tmp = fl_show_input(msg.c_str(), dflt.c_str()); - return tmp; + if (tmp != 0) + return tmp; + else + return string(); } // Inform the user that the buffer is read-only, and that changes in the