]> git.lyx.org Git - lyx.git/blobdiff - src/TocBackend.h
LFUN_UNICODE_INSERT - unicode-insert
[lyx.git] / src / TocBackend.h
index c592f3d07c944a81d991056de48ce112f62995ef..ca584e51e5829941f711530d5f6b8e9f7fbe40b3 100644 (file)
 
 #include "pariterator.h"
 
+namespace lyx {
+
 class Buffer;
 class LyXView;
 class Paragraph;
 class FuncRequest;
 class LCursor;
 
-namespace lyx {
-
 ///
 /**
 */
 class TocBackend
 {
 public:
-
        ///
        /**
        */
@@ -51,7 +50,7 @@ public:
                Item(
                        ParConstIterator const & par_it = ParConstIterator(),
                        int d = -1,
-                       std::string const & s = std::string());
+                       docstring const & s = docstring());
                ///
                ~Item() {}
                ///
@@ -61,9 +60,9 @@ public:
                ///
                int const depth() const;
                ///
-               std::string const & str() const;
+               docstring const & str() const;
                ///
-               std::string const asString() const;
+               docstring const asString() const;
                /// set cursor in LyXView to this Item
                void goTo(LyXView & lv_) const;
                /// the action corresponding to the goTo above
@@ -77,7 +76,7 @@ public:
                int depth_;
 
                /// Full item string
-               std::string str_;
+               docstring str_;
        };
 
        ///
@@ -109,7 +108,7 @@ public:
        /// Return the first Toc Item before the cursor
        TocIterator const item(std::string const & type, ParConstIterator const &);
 
-       void asciiTocList(std::string const & type, std::ostream & os) const;
+       void asciiTocList(std::string const & type, odocstream & os) const;
 
 private:
        /// 
@@ -124,8 +123,7 @@ private:
 inline
 bool operator==(TocBackend::Item const & a, TocBackend::Item const & b)
 {
-       return a.id() == b.id() && a.str() == b.str();
-       // No need to compare depth.
+       return a.id() == b.id() && a.str() == b.str() && a.depth() == b.depth();
 }