#include "insets/lyxinset.h"
#include "vspace.h"
#include "layout.h"
-#include "support/block.h"
+#include <boost/array.hpp>
#include "language.h"
class BufferParams;
///
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();
///
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();
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);
///
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;
private:
///
- block<int, 10> counter_;
+ 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;
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);
///
///
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);
///
///
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;
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