]> git.lyx.org Git - features.git/commitdiff
Fix crashes when the list of formts is empty.
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 10 May 2010 21:30:57 +0000 (21:30 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 10 May 2010 21:30:57 +0000 (21:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34393 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiPrefs.cpp

index 796b31591b2ee62f68969cc16efb6834a51dabec..1831d8a8ccffdf28b73cbaa96f6866b5c07d660f 100644 (file)
@@ -1523,6 +1523,8 @@ void PrefConverters::changeConverter()
 
 void PrefConverters::updateButtons()
 {
+       if (form_->formats().size() == 0)
+               return;
        Format const & from = form_->formats().get(converterFromCO->currentIndex());
        Format const & to = form_->formats().get(converterToCO->currentIndex());
        int const sel = form_->converters().getNumber(from.name(), to.name());
@@ -1801,6 +1803,8 @@ void PrefFileformats::updateView()
 
 void PrefFileformats::on_formatsCB_currentIndexChanged(int i)
 {
+       if (form_->formats().size() == 0)
+               return;
        int const nr = formatsCB->itemData(i).toInt();
        Format const f = form_->formats().get(nr);