From ad6814549242c8d855b1c69d3a24cdc03afe8aee Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 19 Jun 2008 13:35:19 +0000 Subject: [PATCH] Fix http://bugzilla.lyx.org/show_bug.cgi?id=4941 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25323 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/TocWidget.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index 9aa2c07b78..1194cc8d5d 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -220,6 +220,17 @@ void TocWidget::enableControls(bool enable) } +/// Test if synchronized navigation is possible +static bool canNavigate(QString const & type) +{ + // It is not possible to have synchronous navigation in a correctl + // and efficient way with the label type because Toc::item() do a linear + // seatch. Even if fixed, it might even not be desirable to do so if we + // want to support drag&drop of labels and references. + return type != "label"; +} + + void TocWidget::updateView() { if (!gui_view_.view()) { @@ -244,7 +255,8 @@ void TocWidget::updateView() depthSL->setMaximum(gui_view_.tocModels().depth(current_type_)); depthSL->setValue(depth_); setTreeDepth(depth_); - select(gui_view_.tocModels().currentIndex(current_type_)); + if (canNavigate(current_type_)) + select(gui_view_.tocModels().currentIndex(current_type_)); }