From 5791f8a8949858ebb9e5c96ede2d1423c537f75b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 12 Jun 2008 16:46:46 +0000 Subject: [PATCH] cosmetics; compile fix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25239 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/TocBackend.h | 5 +++-- src/frontends/qt4/TocWidget.cpp | 17 +++++++++-------- src/frontends/qt4/TocWidget.h | 2 -- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/TocBackend.h b/src/TocBackend.h index 32e3e02e8e..0e3d4f1f7e 100644 --- a/src/TocBackend.h +++ b/src/TocBackend.h @@ -71,10 +71,11 @@ protected: /// -class Toc : public std::vector { +class Toc : public std::vector +{ public: typedef std::vector::const_iterator const_iterator; - const_iterator Toc::item(DocIterator const & dit) const; + const_iterator item(DocIterator const & dit) const; }; typedef Toc::const_iterator TocIterator; diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index 05501f16e9..eb3fc49331 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -90,17 +90,18 @@ void TocWidget::on_updateTB_clicked() gui_view_.tocModels().updateBackend(); } + /* FIXME (Ugras 17/11/06): -I have implemented a getIndexDepth function to get the model indices. In my +I have implemented a indexDepth function to get the model indices. In my opinion, somebody should derive a new qvariant class for tocModelItem -which saves the string data and depth information. that will save the -depth calculation. -*/ -int TocWidget::getIndexDepth(QModelIndex const & index, int depth) +which saves the string data and depth information. That will save the +depth calculation. */ + +static int indexDepth(QModelIndex const & index, int depth = -1) { ++depth; - return (index.parent() == QModelIndex()) - ? depth : getIndexDepth(index.parent(),depth); + return index.parent() == QModelIndex() + ? depth : indexDepth(index.parent(), depth); } @@ -128,7 +129,7 @@ void TocWidget::setTreeDepth(int depth) int size = indices.size(); for (int i = 0; i < size; i++) { QModelIndex index = indices[i]; - tocTV->setExpanded(index, getIndexDepth(index) < depth_); + tocTV->setExpanded(index, indexDepth(index) < depth_); } } diff --git a/src/frontends/qt4/TocWidget.h b/src/frontends/qt4/TocWidget.h index e784a7c5c7..ea145539e9 100644 --- a/src/frontends/qt4/TocWidget.h +++ b/src/frontends/qt4/TocWidget.h @@ -61,8 +61,6 @@ private: /// void enableControls(bool enable = true); /// - int getIndexDepth(QModelIndex const & index, int depth = -1); - /// void setTreeDepth(int depth); /// void outline(int func_code); -- 2.39.2