]> git.lyx.org Git - features.git/commitdiff
askForText() does not abort anymore when clicking 'cancel'
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 15 Nov 1999 10:44:32 +0000 (10:44 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 15 Nov 1999 10:44:32 +0000 (10:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@310 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/lyx_gui_misc.C

index fcd777e2560808f33dcb670f2361a818781b0dc5..76641c2267ad05187e282489fde7268596694657 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-11-15  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * 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  <Jean-Marc.Lasgouttes@inria.fr>
 
        * src/support/LRegex.C: use regex_t instead of re_pattern_buffer.
index ff860e9dcda3b7e5ab183083d2e04f664f2b8445..2a0b816ab1af100638aaaac77686796168bb7733 100644 (file)
@@ -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