Jürgen Spitzmüller wrote:
> > Even better: this.
>
> However, the drawback of this (and the other patch) is that the outline
> widget is not properly updated on buffer switch.

Actually, this problem was not introduced by my patch (it's already in 1.5.3). 
And it's fixed by the attached.

Jürgen
Index: src/frontends/qt4/TocWidget.cpp
===================================================================
--- src/frontends/qt4/TocWidget.cpp	(Revision 22920)
+++ src/frontends/qt4/TocWidget.cpp	(Arbeitskopie)
@@ -248,21 +248,16 @@
 		return;
 	}
 
-	QString current_text = typeCO->currentText();
-	//lyxerr << "current_text " << fromqstr(current_text) << endl;
 	typeCO->blockSignals(true);
 	typeCO->clear();
-	int current_type = -1;
 	for (size_t i = 0; i != type_names.size(); ++i) {
 		QString item = toqstr(type_names[i]);
 		typeCO->addItem(item);
-		if (item == current_text)
-			current_type = i;
 	}
-	if (current_type != -1)
-		typeCO->setCurrentIndex(current_type);
-	else
+	if (form_->selectedType() != -1)
 		typeCO->setCurrentIndex(form_->selectedType());
+	else
+		typeCO->setCurrentIndex(0);
 	typeCO->blockSignals(false);
 
 	setTocModel(typeCO->currentIndex());

Reply via email to