diff --git a/src/TocBackend.cpp b/src/TocBackend.cpp index 8646bc5048..fd28f9572e 100644 --- a/src/TocBackend.cpp +++ b/src/TocBackend.cpp @@ -40,9 +40,8 @@ namespace lyx { // /////////////////////////////////////////////////////////////////////////// -TocItem::TocItem(ParConstIterator const & par_it, int d, - docstring const & s) - : par_it_(par_it), depth_(d), str_(s) +TocItem::TocItem(ParConstIterator const & par_it, int d, docstring const & s) + : par_it_(par_it), depth_(d), str_(s) { } @@ -189,7 +188,7 @@ void TocBackend::update() } -TocIterator const TocBackend::item(string const & type, +TocIterator TocBackend::item(string const & type, ParConstIterator const & par_it) const { TocList::const_iterator toclist_it = tocs_.find(type); diff --git a/src/TocBackend.h b/src/TocBackend.h index 30ed9de75f..0ade843280 100644 --- a/src/TocBackend.h +++ b/src/TocBackend.h @@ -9,21 +9,19 @@ * \author Abdelrazak Younes * * Full author contact details are available in file CREDITS. - * - * TocBackend mainly used in toc.[Ch] */ #ifndef TOC_BACKEND_H #define TOC_BACKEND_H -#include -#include -#include - #include "ParIterator.h" #include "support/strfwd.h" +#include +#include +#include + namespace lyx { @@ -87,29 +85,27 @@ class TocBackend { public: /// - TocBackend(Buffer const * buffer = NULL): buffer_(buffer) {} + TocBackend(Buffer const * buffer = NULL) : buffer_(buffer) {} /// - ~TocBackend() {} - /// - void setBuffer(Buffer const * buffer) - { buffer_ = buffer; } + void setBuffer(Buffer const * buffer) { buffer_ = buffer; } /// void update(); /// void updateItem(ParConstIterator const & pit); /// - TocList const & tocs() const - { return tocs_; } + TocList const & tocs() const { return tocs_; } /// Toc const & toc(std::string const & type) const; /// Return the first Toc Item before the cursor - TocIterator const item( + + TocIterator item( std::string const & type, ///< Type of Toc. ParConstIterator const & ///< The cursor location in the document. - ) const; + ) const; + /// void writePlaintextTocList(std::string const & type, odocstream & os) const; private: @@ -117,18 +113,15 @@ private: TocList tocs_; /// Buffer const * buffer_; - }; // TocBackend -inline -bool operator==(TocItem const & a, TocItem const & b) +inline bool operator==(TocItem const & a, TocItem const & b) { return a.id() == b.id() && a.str() == b.str() && a.depth() == b.depth(); } -inline -bool operator!=(TocItem const & a, TocItem const & b) +inline bool operator!=(TocItem const & a, TocItem const & b) { return !(a == b); }