cosmetics

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22885 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2008-02-09 09:08:59 +00:00
parent 0c6c52943b
commit 69d566afea
2 changed files with 16 additions and 24 deletions

View File

@ -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);

View File

@ -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 <map>
#include <vector>
#include <string>
#include "ParIterator.h"
#include "support/strfwd.h"
#include <map>
#include <vector>
#include <string>
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);
}