#include "support/block.h"
#include "language.h"
-#define NEW_WAY 1
-
class BufferParams;
class LyXBuffer;
class TexRow;
void SetInsetOwner(Inset * i);
///
void deleteInsetsLyXText(BufferView *);
+ void resizeInsetsLyXText(BufferView *);
private:
///
TextContainer text;
void fitToSize() {
text.resize(text.size());
}
+ ///
void setContentsFromPar(LyXParagraph * par) {
text = par->text;
}
+ ///
void clearContents() {
text.clear();
}
*/
LyXFont getFont(BufferParams const &, size_type pos) const;
///
- char GetChar(size_type pos);
+ value_type GetChar(size_type pos);
///
- char GetChar(size_type pos) const;
+ value_type GetChar(size_type pos) const;
/// The position must already exist.
- void SetChar(size_type pos, char c) {
+ void SetChar(size_type pos, value_type c) {
text[pos] = c;
}
LyXFont::FONT_SIZE HighestFontInRange(size_type startpos,
size_type endpos) const;
///
- void InsertChar(size_type pos, char c);
-#ifdef NEW_WAY
+ void InsertChar(size_type pos, value_type c);
///
- void InsertChar(size_type pos, char c, LyXFont const &);
-#endif
+ void InsertChar(size_type pos, value_type c, LyXFont const &);
///
void InsertInset(size_type pos, Inset * inset);
-#ifdef NEW_WAY
///
void InsertInset(size_type pos, Inset * inset, LyXFont const &);
-#endif
///
bool InsertInsetAllowed(Inset * inset);
///
friend struct matchIT;
///
struct matchIT {
- /// used by lower_bound
+ /// used by lower_bound and upper_bound
inline
int operator()(LyXParagraph::InsetTable const & a,
- LyXParagraph::size_type pos) const {
- return a.pos < pos;
- }
- /// used by upper_bound
- inline
- int operator()(LyXParagraph::size_type pos,
- LyXParagraph::InsetTable const & a) const {
- return pos < a.pos;
+ LyXParagraph::InsetTable const & b) const {
+ return a.pos < b.pos;
}
};
/** A font entry covers a range of positions. Notice that the
friend struct matchFT;
///
struct matchFT {
- /// used by lower_bound
+ /// used by lower_bound and upper_bound
inline
int operator()(LyXParagraph::FontTable const & a,
- LyXParagraph::size_type pos) const {
- return a.pos < pos;
- }
- /// used by upper_bound
- inline
- int operator()(LyXParagraph::size_type pos,
- LyXParagraph::FontTable const & a) const {
- return pos < a.pos;
+ LyXParagraph::FontTable const & b) const {
+ return a.pos < b.pos;
}
};
}
///
inset_iterator InsetIterator(size_type pos);
-
};
#endif