]> git.lyx.org Git - features.git/commitdiff
Fix crash when removing last converter (bug 8178)
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 29 May 2012 13:40:07 +0000 (15:40 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 29 May 2012 13:40:07 +0000 (15:40 +0200)
src/frontends/qt4/GuiPrefs.cpp
status.20x

index b32d8f09fbd09e70573ecb0f0ff90ec2474ec7dd..8038fc13195b8eed49d661a159d104cbb8c537d6 100644 (file)
@@ -1695,10 +1695,16 @@ void PrefConverters::updateButtons()
        bool const valid = !(converterED->text().isEmpty()
                || from.name() == to.name());
 
-       int const cnr = convertersLW->currentItem()->type();
-       Converter const & c = form_->converters().get(cnr);
-       string const old_command = c.command;
-       string const old_flag = c.flags;
+       string old_command;
+       string old_flag;
+
+       if (convertersLW->count() > 0) {
+               int const cnr = convertersLW->currentItem()->type();
+               Converter const & c = form_->converters().get(cnr);
+               old_command = c.command;
+               old_flag = c.flags;
+       }
+
        string const new_command = fromqstr(converterED->text());
        string const new_flag = fromqstr(converterFlagED->text());
 
index 5ae89482f5653ef32868820ff4727bcb15dd8064..9343bff625a90e4d7dc5585b2517d58060f0d7f0 100644 (file)
@@ -131,7 +131,7 @@ What's new
 
 * USER INTERFACE
 
-- Fixed crash when modifying or pasting an equation label and there
+- Fix crash when modifying or pasting an equation label and there
   are references to that label in math (bug 8095).
 
 - Fix crash when clicking away in the same math inset just after hitting '\'
@@ -140,6 +140,8 @@ What's new
 - Fix crash when dissolving a math macro whose first argument is another
   parameterless macro (bug 8105).
 
+- Fix crash when removing all converters in preferences (bug 8178).
+
 - Update the current view after dispatching a command through the lyxserver.
   The missing screen update could cause either a failure in executing the
   command or could even crash LyX (bugs 6871 and 8119).