]> git.lyx.org Git - lyx.git/blobdiff - src/lyxparagraph.h
mathed31.diff
[lyx.git] / src / lyxparagraph.h
index 03b498e7061bf77120f1be98da785ed4b38026ce..85ff91412e2e6bd0904de7a7dba43419ad3169b7 100644 (file)
@@ -124,14 +124,17 @@ public:
        ///
        typedef std::vector<value_type> TextContainer;
        ///
-       typedef int size_type;
+       /* This should be TextContainer::size_type, but we need
+          signed values for now.
+       */
+       typedef TextContainer::difference_type size_type;
 
        ///
        LyXParagraph();
-       /// this konstruktor inserts the new paragraph in a list
+       /// this constructor inserts the new paragraph in a list
        explicit
        LyXParagraph(LyXParagraph * par);
-       /// the destruktors removes the new paragraph from the list
+       /// the destructor removes the new paragraph from the list
        ~LyXParagraph();
 
        ///
@@ -156,14 +159,9 @@ public:
        void validate(LaTeXFeatures &) const;
        
        ///
-       int id() const {
-               return id_;
-       }
+       int id() const;
        ///
-       void id(int id_arg) {
-               id_ = id_arg;
-       }
-
+       void id(int id_arg);
        ///
        void read();
 
@@ -199,18 +197,13 @@ public:
        void MakeSameLayout(LyXParagraph const * par);
 
        /// Is it the first par with same depth and layout?
-       bool IsFirstInSequence() const {
-               LyXParagraph const * dhook = DepthHook(GetDepth());
-               return (dhook == this
-                       || dhook->GetLayout() != GetLayout()
-                       || dhook->GetDepth() != GetDepth());
-       }
+       bool IsFirstInSequence() const;
 
        /** Check if the current paragraph is the last paragraph in a
            proof environment */
        int GetEndLabel(BufferParams const &) const;
        ///
-       Inset * InInset() { return inset_owner; }
+       Inset * InInset();
        ///
        void SetInsetOwner(Inset * i);
        ///
@@ -225,20 +218,13 @@ private:
 
 public:
        ///
-       size_type size() const { return text.size(); }
+       size_type size() const;
        ///
-       void fitToSize() {
-               text.resize(text.size());
-       }
+       void fitToSize();
        ///
-       void setContentsFromPar(LyXParagraph * par) {
-               text = par->text;
-       }
+       void setContentsFromPar(LyXParagraph * par);
        ///
-       void clearContents() {
-               text.clear();
-       }
-       
+       void clearContents();
        /// 
        VSpace added_space_top;
        
@@ -289,11 +275,11 @@ private:
        array<int, 10> counter_;
 public:
        ///
-       void setCounter(int i, int v) { counter_[i] = v; }
+       void setCounter(int i, int v);
        ///
-       int getCounter(int i) const { return counter_[i]; }
+       int getCounter(int i) const;
        ///
-       void incCounter(int i) { counter_[i]++; }
+       void incCounter(int i);
        ///
        bool start_of_appendix;
 
@@ -422,11 +408,10 @@ public:
        LyXFont const getFont(BufferParams const &, size_type pos) const;
        ///
        value_type GetChar(size_type pos) const;
+       ///
+       value_type GetUChar(BufferParams const &, size_type pos) const;
        /// The position must already exist.
-       void SetChar(size_type pos, value_type c) {
-               text[pos] = c;
-       }
-       
+       void SetChar(size_type pos, value_type c);
        ///
        void SetFont(size_type pos, LyXFont const & font);
        ///
@@ -454,8 +439,10 @@ public:
        ///
        void CloseFootnote(size_type pos);
 #endif
-       /// important for cut and paste
-       void CopyIntoMinibuffer(BufferParams const &, size_type pos) const;
+       /** important for cut and paste
+           Temporary change from BufferParams to Buffer. Will revert when we
+           get rid of the argument to Inset::Clone(Buffer const &) */
+       void CopyIntoMinibuffer(Buffer const &, size_type pos) const;
        ///
        void CutIntoMinibuffer(BufferParams const &, size_type pos);
        ///
@@ -647,7 +634,7 @@ public:
                ///
                Inset * operator*() { return (*it).inset; }
                ///
-               size_type getPos() {return (*it).pos; }
+               size_type getPos() const {return (*it).pos; }
                ///
                bool operator==(inset_iterator const & iter) const {
                        return it == iter.it;
@@ -661,15 +648,97 @@ public:
                InsetList::iterator it;
        };
        ///
-       inset_iterator inset_iterator_begin() {
-               return inset_iterator(insetlist.begin());
-       }
+       inset_iterator inset_iterator_begin();
        ///
-       inset_iterator inset_iterator_end() {
-               return inset_iterator(insetlist.end());
-       }
+       inset_iterator inset_iterator_end();
        ///
        inset_iterator InsetIterator(size_type pos);
 };
 
+
+inline
+int LyXParagraph::id() const
+{
+       return id_;
+}
+
+
+inline
+void  LyXParagraph::id(int id_arg)
+{
+       id_ = id_arg;
+}
+
+
+inline
+bool LyXParagraph::IsFirstInSequence() const
+{
+       LyXParagraph const * dhook = DepthHook(GetDepth());
+       return (dhook == this
+               || dhook->GetLayout() != GetLayout()
+               || dhook->GetDepth() != GetDepth());
+}
+
+
+inline
+Inset * LyXParagraph::InInset()
+{
+       return inset_owner;
+}
+
+
+inline
+LyXParagraph::size_type LyXParagraph::size() const
+{
+       return text.size();
+}
+
+
+inline
+void LyXParagraph::clearContents()
+{
+       text.clear();
+}
+
+
+inline
+void LyXParagraph::setCounter(int i, int v)
+{
+       counter_[i] = v;
+}
+
+
+inline
+int LyXParagraph::getCounter(int i) const
+{
+       return counter_[i];
+}
+
+
+inline
+void LyXParagraph::incCounter(int i)
+{
+       counter_[i]++;
+}
+
+
+inline
+void LyXParagraph::SetChar(size_type pos, value_type c)
+{
+       text[pos] = c;
+}
+
+
+inline
+LyXParagraph::inset_iterator LyXParagraph::inset_iterator_begin()
+{
+       return inset_iterator(insetlist.begin());
+}
+
+
+inline
+LyXParagraph::inset_iterator LyXParagraph::inset_iterator_end()
+{
+       return inset_iterator(insetlist.end());
+}
 #endif