On Thu, 2005-09-29 at 15:11 +0200, Juergen Spitzmueller wrote:
> Martin Vermeer wrote:
> > > Please fix also GToc.C
> >
> > How?
> 
> It's basically the same fix (around line 128).
> 
> Jürgen

OK, done, attached. Only I don't get it compiled because of some missing
library, which I am not really in the mood to hunt down :-(

I suppose it's OK to check this in anyway.

- Martin
Index: xforms/FormToc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormToc.C,v
retrieving revision 1.62
diff -u -p -r1.62 FormToc.C
--- xforms/FormToc.C	27 Jul 2005 15:22:07 -0000	1.62
+++ xforms/FormToc.C	29 Sep 2005 15:45:30 -0000
@@ -100,7 +100,9 @@ void FormToc::updateType()
 void FormToc::updateContents()
 {
 	vector<string> types = controller().getTypes();
-	string const type = types[fl_get_choice(dialog_->choice_toc_type) - 1];
+	string type;
+	if (!types.empty())
+		type = types[fl_get_choice(dialog_->choice_toc_type) - 1];
 	if (type.empty()) {
 		fl_clear_browser(dialog_->browser_toc);
 		fl_add_browser_line(dialog_->browser_toc,
Index: qt2/QToc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QToc.C,v
retrieving revision 1.32
diff -u -p -r1.32 QToc.C
--- qt2/QToc.C	27 Jul 2005 17:11:17 -0000	1.32
+++ qt2/QToc.C	29 Sep 2005 15:45:30 -0000
@@ -80,7 +80,9 @@ void QToc::update_contents()
 void QToc::updateToc(int newdepth)
 {
 	vector<string> const & choice = controller().getTypes();
-	string const & type = choice[dialog_->typeCO->currentItem()];
+	string type;
+	if (!choice.empty())
+		type = choice[dialog_->typeCO->currentItem()];
 
 	toc::Toc const & contents = controller().getContents(type);
 
Index: gtk/GToc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/gtk/GToc.C,v
retrieving revision 1.8
diff -u -p -r1.8 GToc.C
--- gtk/GToc.C	31 Jul 2005 22:43:27 -0000	1.8
+++ gtk/GToc.C	29 Sep 2005 15:45:30 -0000
@@ -126,7 +126,10 @@ void GToc::updateContents()
 
 	Gtk::TreeModel::iterator it = typecombo_->get_active();
 	vector<string> const & choice = controller().getTypes();
-	string const type = choice[(*it)[listColIndex_]];
+	// Untested:
+	string type;
+	if (!choice.empty())
+		type = choice[(*it)[listColIndex_]];
 	toc::Toc const contents = controller().getContents(type);
 
 	// Check if all elements are the same.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to