cosmetics; compile fix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25239 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2008-06-12 16:46:46 +00:00
parent 28b77e4f72
commit 5791f8a894
3 changed files with 12 additions and 12 deletions

View File

@ -71,10 +71,11 @@ protected:
/// ///
class Toc : public std::vector<TocItem> { class Toc : public std::vector<TocItem>
{
public: public:
typedef std::vector<TocItem>::const_iterator const_iterator; typedef std::vector<TocItem>::const_iterator const_iterator;
const_iterator Toc::item(DocIterator const & dit) const; const_iterator item(DocIterator const & dit) const;
}; };
typedef Toc::const_iterator TocIterator; typedef Toc::const_iterator TocIterator;

View File

@ -90,17 +90,18 @@ void TocWidget::on_updateTB_clicked()
gui_view_.tocModels().updateBackend(); gui_view_.tocModels().updateBackend();
} }
/* FIXME (Ugras 17/11/06): /* 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 opinion, somebody should derive a new qvariant class for tocModelItem
which saves the string data and depth information. that will save the which saves the string data and depth information. That will save the
depth calculation. depth calculation. */
*/
int TocWidget::getIndexDepth(QModelIndex const & index, int depth) static int indexDepth(QModelIndex const & index, int depth = -1)
{ {
++depth; ++depth;
return (index.parent() == QModelIndex()) return index.parent() == QModelIndex()
? depth : getIndexDepth(index.parent(),depth); ? depth : indexDepth(index.parent(), depth);
} }
@ -128,7 +129,7 @@ void TocWidget::setTreeDepth(int depth)
int size = indices.size(); int size = indices.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
QModelIndex index = indices[i]; QModelIndex index = indices[i];
tocTV->setExpanded(index, getIndexDepth(index) < depth_); tocTV->setExpanded(index, indexDepth(index) < depth_);
} }
} }

View File

@ -61,8 +61,6 @@ private:
/// ///
void enableControls(bool enable = true); void enableControls(bool enable = true);
/// ///
int getIndexDepth(QModelIndex const & index, int depth = -1);
///
void setTreeDepth(int depth); void setTreeDepth(int depth);
/// ///
void outline(int func_code); void outline(int func_code);