LyXText -> Text

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18103 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-04-29 23:33:02 +00:00
parent 295eea310e
commit e0d54dd3b4
70 changed files with 289 additions and 289 deletions

View File

@ -33,7 +33,7 @@
#include "LaTeXFeatures.h"
#include "LyXAction.h"
#include "Lexer.h"
#include "LyXText.h"
#include "Text.h"
#include "LyXRC.h"
#include "LyXVC.h"
#include "Messages.h"
@ -184,7 +184,7 @@ public:
*/
bool file_fully_loaded;
/// our LyXText that should be wrapped in an InsetText
/// our Text that should be wrapped in an InsetText
InsetText inset;
///
@ -236,9 +236,9 @@ Buffer::~Buffer()
}
LyXText & Buffer::text() const
Text & Buffer::text() const
{
return const_cast<LyXText &>(pimpl_->inset.text_);
return const_cast<Text &>(pimpl_->inset.text_);
}

View File

@ -43,7 +43,7 @@ class InsetText;
class Font;
class Lexer;
class LyXRC;
class LyXText;
class Text;
class LyXVC;
class LaTeXFeatures;
class Language;
@ -62,7 +62,7 @@ class Undo;
/** The buffer object.
* This is the buffer object. It contains all the informations about
* a document loaded into LyX.
* The buffer object owns the LyXText (wrapped in an InsetText), which
* The buffer object owns the Text (wrapped in an InsetText), which
* contains the individual paragraphs of the document.
*
*
@ -349,7 +349,7 @@ public:
void fully_loaded(bool);
/// Our main text (inside the top InsetText)
LyXText & text() const;
Text & text() const;
/// Our top InsetText!
Inset & inset() const;

View File

@ -40,7 +40,7 @@
#include "lyxfind.h"
#include "LyXFunc.h"
#include "Layout.h"
#include "LyXText.h"
#include "Text.h"
#include "TextClass.h"
#include "LyXRC.h"
#include "Session.h"
@ -417,7 +417,7 @@ void BufferView::updateScrollbar()
return;
}
LyXText & t = buffer_->text();
Text & t = buffer_->text();
TextMetrics & tm = text_metrics_[&t];
int const parsize = int(t.paragraphs().size() - 1);
@ -485,7 +485,7 @@ void BufferView::scrollDocView(int value)
if (!buffer_)
return;
LyXText & t = buffer_->text();
Text & t = buffer_->text();
TextMetrics & tm = text_metrics_[&t];
float const bar = value / float(wh_ * t.paragraphs().size());
@ -506,7 +506,7 @@ void BufferView::setCursorFromScrollbar()
if (!buffer_)
return;
LyXText & t = buffer_->text();
Text & t = buffer_->text();
int const height = 2 * defaultRowHeight();
int const first = height;
@ -668,7 +668,7 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
case LFUN_FILE_INSERT_PLAINTEXT_PARA:
case LFUN_FILE_INSERT_PLAINTEXT:
case LFUN_BOOKMARK_SAVE:
// FIXME: Actually, these LFUNS should be moved to LyXText
// FIXME: Actually, these LFUNS should be moved to Text
flag.enabled(cursor_.inTexted());
break;
case LFUN_FONT_STATE:
@ -906,7 +906,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
cursor_.selHandle(true);
buffer_->text().cursorBottom(cursor_);
// accept everything in a single step to support atomic undo
buffer_->text().acceptOrRejectChanges(cursor_, LyXText::ACCEPT);
buffer_->text().acceptOrRejectChanges(cursor_, Text::ACCEPT);
break;
case LFUN_ALL_CHANGES_REJECT:
@ -916,7 +916,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
buffer_->text().cursorBottom(cursor_);
// reject everything in a single step to support atomic undo
// Note: reject does not work recursively; the user may have to repeat the operation
buffer_->text().acceptOrRejectChanges(cursor_, LyXText::REJECT);
buffer_->text().acceptOrRejectChanges(cursor_, Text::REJECT);
break;
case LFUN_WORD_FIND:
@ -1102,7 +1102,7 @@ void BufferView::workAreaResize(int width, int height)
}
Inset const * BufferView::getCoveringInset(LyXText const & text, int x, int y)
Inset const * BufferView::getCoveringInset(Text const & text, int x, int y)
{
pit_type pit = text.getPitNearY(*this, y);
BOOST_ASSERT(pit != -1);
@ -1127,7 +1127,7 @@ Inset const * BufferView::getCoveringInset(LyXText const & text, int x, int y)
size_t cell_number = inset->nargs();
// Check all the inner cell.
for (size_t i = 0; i != cell_number; ++i) {
LyXText const * inner_text = inset->getText(i);
Text const * inner_text = inset->getText(i);
if (inner_text) {
// Try deeper.
Inset const * inset_deeper =
@ -1167,7 +1167,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
cur.selection() = cursor_.selection();
// Either the inset under the cursor or the
// surrounding LyXText will handle this event.
// surrounding Text will handle this event.
// make sure we stay within the screen...
cmd.y = min(max(cmd.y, -1), height_);
@ -1209,7 +1209,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
// between background updates and text updates. So we use the hammer
// solution for now. We could also avoid the updateMetrics() below
// by using the first and last pit of the CoordCache. Have a look
// at LyXText::getPitNearY() to see what I mean.
// at Text::getPitNearY() to see what I mean.
//
//metrics_info_.pit1 = first pit of CoordCache;
//metrics_info_.pit2 = last pit of CoordCache;
@ -1257,7 +1257,7 @@ void BufferView::scroll(int /*lines*/)
// if (!buffer_)
// return;
//
// LyXText const * t = &buffer_->text();
// Text const * t = &buffer_->text();
// int const line_height = defaultRowHeight();
//
// // The new absolute coordinate
@ -1300,24 +1300,24 @@ void BufferView::gotoLabel(docstring const & label)
}
TextMetrics const & BufferView::textMetrics(LyXText const * t) const
TextMetrics const & BufferView::textMetrics(Text const * t) const
{
return const_cast<BufferView *>(this)->textMetrics(t);
}
TextMetrics & BufferView::textMetrics(LyXText const * t)
TextMetrics & BufferView::textMetrics(Text const * t)
{
TextMetricsCache::iterator tmc_it = text_metrics_.find(t);
if (tmc_it == text_metrics_.end()) {
tmc_it = text_metrics_.insert(
make_pair(t, TextMetrics(this, const_cast<LyXText *>(t)))).first;
make_pair(t, TextMetrics(this, const_cast<Text *>(t)))).first;
}
return tmc_it->second;
}
ParagraphMetrics const & BufferView::parMetrics(LyXText const * t,
ParagraphMetrics const & BufferView::parMetrics(Text const * t,
pit_type pit) const
{
return textMetrics(t).parMetrics(pit);
@ -1452,7 +1452,7 @@ ViewMetricsInfo const & BufferView::viewMetricsInfo()
// FIXME: We should split-up updateMetrics() for the singlepar case.
void BufferView::updateMetrics(bool singlepar)
{
LyXText & buftext = buffer_->text();
Text & buftext = buffer_->text();
TextMetrics & tm = textMetrics(&buftext);
pit_type size = int(buftext.paragraphs().size());

View File

@ -42,7 +42,7 @@ class FuncRequest;
class FuncStatus;
class Intl;
class Cursor;
class LyXText;
class Text;
class ParIterator;
class ParagraphMetrics;
class ViewMetricsInfo;
@ -207,10 +207,10 @@ public:
void updateMetrics(bool singlepar = false);
///
TextMetrics const & textMetrics(LyXText const * t) const;
TextMetrics & textMetrics(LyXText const * t);
TextMetrics const & textMetrics(Text const * t) const;
TextMetrics & textMetrics(Text const * t);
///
ParagraphMetrics const & parMetrics(LyXText const *, pit_type) const;
ParagraphMetrics const & parMetrics(Text const *, pit_type) const;
///
CoordCache & coordCache() {
@ -254,7 +254,7 @@ private:
/// Search recursively for the the innermost inset that covers (x, y) position.
/// \retval 0 if no inset is found.
Inset const * getCoveringInset(
LyXText const & text, //< The LyXText where we start searching.
Text const & text, //< The Text where we start searching.
int x, //< x-coordinate on screen
int y //< y-coordinate on screen
);
@ -299,8 +299,8 @@ private:
/// last visited inset (kept to send setMouseHover(false) )
Inset * last_inset_;
/// A map from a LyXText to the associated text metrics
typedef std::map<LyXText const *, TextMetrics> TextMetricsCache;
/// A map from a Text to the associated text metrics
typedef std::map<Text const *, TextMetrics> TextMetricsCache;
mutable TextMetricsCache text_metrics_;
};

View File

@ -12,7 +12,7 @@
#include "CoordCache.h"
#include "debug.h"
#include "LyXText.h"
#include "Text.h"
#include "insets/Inset.h"
@ -49,7 +49,7 @@ void CoordCache::clear()
}
Point CoordCache::get(LyXText const * text, pit_type pit) const
Point CoordCache::get(Text const * text, pit_type pit) const
{
ParPosCache::const_iterator const it = pars_.find(text);
BOOST_ASSERT(it != pars_.end());
@ -63,9 +63,9 @@ void CoordCache::dump() const
{
lyxerr << "ParPosCache contains:" << std::endl;
for (ParPosCache::const_iterator it = getParPos().begin(); it != getParPos().end(); ++it) {
LyXText const * lt = it->first;
Text const * lt = it->first;
InnerParPosCache const & cache = it->second;
lyxerr << "LyXText:" << lt << std::endl;
lyxerr << "Text:" << lt << std::endl;
for (InnerParPosCache::const_iterator jt = cache.begin(); jt != cache.end(); ++jt) {
pit_type pit = jt->first;
Paragraph const & par = lt->getPar(pit);

View File

@ -21,7 +21,7 @@
namespace lyx {
class Inset;
class LyXText;
class Text;
class MathData;
class Paragraph;
@ -113,14 +113,14 @@ public:
class CoordCache {
public:
void clear();
Point get(LyXText const *, pit_type) const;
Point get(Text const *, pit_type) const;
/// A map from paragraph index number to screen point
typedef std::map<pit_type, Point> InnerParPosCache;
/// A map from a LyXText to the map of paragraphs to screen points
typedef std::map<LyXText const *, InnerParPosCache> ParPosCache;
/// A map from a Text to the map of paragraphs to screen points
typedef std::map<Text const *, InnerParPosCache> ParPosCache;
/// A map from a CursorSlice to screen points
typedef std::map<LyXText const *, InnerParPosCache> SliceCache;
typedef std::map<Text const *, InnerParPosCache> SliceCache;
/// A map from MathData to position on the screen
CoordCacheBase<MathData> & arrays() { return arrays_; }
@ -128,7 +128,7 @@ public:
/// A map from insets to positions on the screen
CoordCacheBase<Inset> & insets() { return insets_; }
CoordCacheBase<Inset> const & getInsets() const { return insets_; }
/// A map from (LyXText, paragraph) pair to screen positions
/// A map from (Text, paragraph) pair to screen positions
ParPosCache & parPos() { return pars_; }
ParPosCache const & getParPos() const { return pars_; }
///

View File

@ -28,7 +28,7 @@
#include "LyXFunc.h" // only for setMessage()
#include "LyXRC.h"
#include "Row.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"
#include "ParIterator.h"
@ -1233,7 +1233,7 @@ Encoding const * Cursor::getEncoding() const
if (operator[](s).text())
break;
CursorSlice const & sl = operator[](s);
LyXText const & text = *sl.text();
Text const & text = *sl.text();
Font font = text.getPar(sl.pit()).getFont(
bv().buffer()->params(), sl.pos(), outerFont(sl.pit(), text.paragraphs()));
return font.language()->encoding();
@ -1274,7 +1274,7 @@ Font Cursor::getFont() const
if (operator[](s).text())
break;
CursorSlice const & sl = operator[](s);
LyXText const & text = *sl.text();
Text const & text = *sl.text();
Font font = text.getPar(sl.pit()).getFont(
bv().buffer()->params(),
sl.pos(),

View File

@ -15,7 +15,7 @@
#include "CursorSlice.h"
#include "debug.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "mathed/InsetMath.h"

View File

@ -28,14 +28,14 @@ namespace lyx {
class Inset;
class MathData;
class LyXText;
class Text;
class Paragraph;
/// This encapsulates a single slice of a document iterator as used e.g.
/// for cursors.
// After IU, the distinction of MathInset and InsetOld as well as
// that of MathData and LyXText should vanish. They are conceptually the
// that of MathData and Text should vanish. They are conceptually the
// same (now...)
class CursorSlice {
@ -95,9 +95,9 @@ public:
/// texted specific stuff
///
/// returns text corresponding to this position
LyXText * text() { return inset_->getText(idx_); }
Text * text() { return inset_->getText(idx_); }
/// returns text corresponding to this position
LyXText const * text() const { return inset_->getText(idx_); }
Text const * text() const { return inset_->getText(idx_); }
/// paragraph in this cell
Paragraph & paragraph();
/// paragraph in this cell

View File

@ -28,7 +28,7 @@
#include "lfuns.h"
#include "LyXFunc.h"
#include "LyXRC.h"
#include "LyXText.h"
#include "Text.h"
#include "TextClassList.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"
@ -382,9 +382,9 @@ void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
}
// do not copy text (also nested in insets) which is marked as deleted
// acceptChanges() is defined for LyXText rather than ParagraphList
// Thus we must wrap copy_pars into a LyXText object and cross our fingers
LyXText lt;
// acceptChanges() is defined for Text rather than ParagraphList
// Thus we must wrap copy_pars into a Text object and cross our fingers
Text lt;
copy_pars.swap(lt.paragraphs());
lt.acceptChanges(buf.params());
copy_pars.swap(lt.paragraphs());
@ -520,7 +520,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
// and cur.selEnd()
if (cur.inTexted()) {
LyXText * text = cur.text();
Text * text = cur.text();
BOOST_ASSERT(text);
// make sure that the depth behind the selection are restored, too
@ -602,7 +602,7 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
return;
if (cur.inTexted()) {
LyXText * text = cur.text();
Text * text = cur.text();
BOOST_ASSERT(text);
// ok we have a selection. This is always between cur.selBegin()
// and sel_end cursor
@ -701,7 +701,7 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
textclass_type textclass, ErrorList & errorList)
{
if (cur.inTexted()) {
LyXText * text = cur.text();
Text * text = cur.text();
BOOST_ASSERT(text);
pit_type endpit;

View File

@ -14,7 +14,7 @@
#include "DocIterator.h"
#include "debug.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "mathed/MathData.h"
@ -152,13 +152,13 @@ MathAtom & DocIterator::nextAtom()
}
LyXText * DocIterator::text()
Text * DocIterator::text()
{
BOOST_ASSERT(!empty());
return top().text();
}
LyXText const * DocIterator::text() const
Text const * DocIterator::text() const
{
BOOST_ASSERT(!empty());
return top().text();
@ -246,7 +246,7 @@ MathData & DocIterator::cell()
}
LyXText * DocIterator::innerText()
Text * DocIterator::innerText()
{
BOOST_ASSERT(!empty());
// Go up until first non-0 text is hit
@ -257,7 +257,7 @@ LyXText * DocIterator::innerText()
return 0;
}
LyXText const * DocIterator::innerText() const
Text const * DocIterator::innerText() const
{
BOOST_ASSERT(!empty());
// go up until first non-0 text is hit

View File

@ -20,7 +20,7 @@
namespace lyx {
class LyXText;
class Text;
class MathAtom;
class Paragraph;
@ -158,17 +158,17 @@ public:
/// the paragraph we're in
Paragraph const & paragraph() const;
///
LyXText * text();
Text * text();
///
LyXText const * text() const;
Text const * text() const;
/// the containing inset or the cell, respectively
Inset * realInset() const;
///
Inset * innerInsetOfType(int code) const;
///
LyXText * innerText();
Text * innerText();
///
LyXText const * innerText() const;
Text const * innerText() const;
//
// elementary moving

View File

@ -15,14 +15,14 @@
#include "FontIterator.h"
#include "Buffer.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
namespace lyx {
FontIterator::FontIterator(Buffer const & buffer, LyXText const & text,
FontIterator::FontIterator(Buffer const & buffer, Text const & text,
Paragraph const & par, pos_type pos)
: buffer_(buffer), text_(text), par_(par), pos_(pos),
font_(text.getFont(buffer, par, pos)),

View File

@ -9,7 +9,7 @@
* Full author contact details are available in file CREDITS.
*
*
* Calling LyXText::getFont is slow. While rebreaking we scan a
* Calling Text::getFont is slow. While rebreaking we scan a
* paragraph from left to right calling getFont for every char. This
* simple class address this problem by hidding an optimization trick
* (not mine btw -AB): the font is reused in the whole font span. The
@ -28,7 +28,7 @@
namespace lyx {
class Buffer;
class LyXText;
class Text;
class Paragraph;
@ -36,7 +36,7 @@ class FontIterator : std::iterator<std::forward_iterator_tag, Font>
{
public:
///
FontIterator(Buffer const & buffer, LyXText const & text,
FontIterator(Buffer const & buffer, Text const & text,
Paragraph const & par, pos_type pos);
///
Font const & operator*() const;
@ -49,7 +49,7 @@ private:
///
Buffer const & buffer_;
///
LyXText const & text_;
Text const & text_;
///
Paragraph const & par_;
///

View File

@ -29,7 +29,7 @@ class BufferView;
class FuncRequest;
class FuncStatus;
class KeySymbol;
class LyXText;
class Text;
class LyXView;

View File

@ -187,11 +187,6 @@ lyx_SOURCES = \
ServerSocket.h \
lyx_sty.cpp \
lyx_sty.h \
TextClass.cpp \
TextClass.h \
TextClassList.cpp \
TextClassList.h \
LyXText.h \
LyXVC.cpp \
LyXVC.h \
MenuBackend.cpp \
@ -243,11 +238,16 @@ lyx_SOURCES = \
tex-accent.h \
TexRow.cpp \
TexRow.h \
Text.h \
Text.cpp \
Text2.cpp \
Text3.cpp \
TextClass.cpp \
TextClass.h \
TextClassList.cpp \
TextClassList.h \
tex-strings.cpp \
tex-strings.h \
text2.cpp \
text3.cpp \
text.cpp \
TextMetrics.cpp \
TextMetrics.h \
Thesaurus.cpp \

View File

@ -13,7 +13,7 @@
#include "ParIterator.h"
#include "Paragraph.h"
#include "LyXText.h"
#include "Text.h"
#include "insets/Inset.h"

View File

@ -22,7 +22,7 @@
namespace lyx {
class Inset;
class LyXText;
class Text;
class ParagraphList;

View File

@ -1326,7 +1326,7 @@ Font const Paragraph::getFirstFontSettings(BufferParams const & bparams) const
// Gets the fully instantiated font at a given position in a paragraph
// This is basically the same function as LyXText::GetFont() in text2.cpp.
// This is basically the same function as Text::GetFont() in text2.cpp.
// The difference is that this one is used for generating the LaTeX file,
// and thus cosmetic "improvements" are disallowed: This has to deliver
// the true picture of the buffer. (Asger)

View File

@ -56,7 +56,7 @@ public:
unsigned int ascent() const { return dim_.ascent(); }
/// descend of paragraph below baseline
unsigned int descent() const { return dim_.descent(); }
/// LyXText updates the rows using this access point
/// Text updates the rows using this access point
RowList & rows() { return rows_; }
/// The painter and others use this
RowList const & rows() const { return rows_; }

View File

@ -20,7 +20,7 @@
#include "gettext.h"
#include "Layout.h"
#include "Lexer.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "tex-strings.h"

View File

@ -16,7 +16,7 @@
#include <config.h>
#include "LyXText.h"
#include "Text.h"
#include "Author.h"
#include "Buffer.h"
@ -343,7 +343,7 @@ void readParagraph(Buffer const & buf, Paragraph & par, Lexer & lex,
double LyXText::spacing(Buffer const & buffer,
double Text::spacing(Buffer const & buffer,
Paragraph const & par) const
{
if (par.params().spacing().isDefault())
@ -352,7 +352,7 @@ double LyXText::spacing(Buffer const & buffer,
}
int LyXText::singleWidth(Buffer const & buffer, Paragraph const & par,
int Text::singleWidth(Buffer const & buffer, Paragraph const & par,
pos_type pos) const
{
return singleWidth(par, pos, par.getChar(pos),
@ -360,7 +360,7 @@ int LyXText::singleWidth(Buffer const & buffer, Paragraph const & par,
}
int LyXText::singleWidth(Paragraph const & par,
int Text::singleWidth(Paragraph const & par,
pos_type pos, char_type c, Font const & font) const
{
// The most common case is handled first (Asger)
@ -385,7 +385,7 @@ int LyXText::singleWidth(Paragraph const & par,
}
int LyXText::leftMargin(Buffer const & buffer, int max_width, pit_type pit) const
int Text::leftMargin(Buffer const & buffer, int max_width, pit_type pit) const
{
BOOST_ASSERT(pit >= 0);
BOOST_ASSERT(pit < int(pars_.size()));
@ -393,7 +393,7 @@ int LyXText::leftMargin(Buffer const & buffer, int max_width, pit_type pit) cons
}
int LyXText::leftMargin(Buffer const & buffer, int max_width,
int Text::leftMargin(Buffer const & buffer, int max_width,
pit_type const pit, pos_type const pos) const
{
BOOST_ASSERT(pit >= 0);
@ -401,7 +401,7 @@ int LyXText::leftMargin(Buffer const & buffer, int max_width,
Paragraph const & par = pars_[pit];
BOOST_ASSERT(pos >= 0);
BOOST_ASSERT(pos <= par.size());
//lyxerr << "LyXText::leftMargin: pit: " << pit << " pos: " << pos << endl;
//lyxerr << "Text::leftMargin: pit: " << pit << " pos: " << pos << endl;
TextClass const & tclass = buffer.params().getTextClass();
Layout_ptr const & layout = par.layout();
@ -573,13 +573,13 @@ int LyXText::leftMargin(Buffer const & buffer, int max_width,
}
Color_color LyXText::backgroundColor() const
Color_color Text::backgroundColor() const
{
return Color_color(Color::color(background_color_));
}
void LyXText::breakParagraph(Cursor & cur, bool keep_layout)
void Text::breakParagraph(Cursor & cur, bool keep_layout)
{
BOOST_ASSERT(this == cur.text());
@ -661,7 +661,7 @@ void LyXText::breakParagraph(Cursor & cur, bool keep_layout)
// insert a character, moves all the following breaks in the
// same Paragraph one to the right and make a rebreak
void LyXText::insertChar(Cursor & cur, char_type c)
void Text::insertChar(Cursor & cur, char_type c)
{
BOOST_ASSERT(this == cur.text());
BOOST_ASSERT(c != Paragraph::META_INSET);
@ -751,7 +751,7 @@ void LyXText::insertChar(Cursor & cur, char_type c)
}
void LyXText::charInserted()
void Text::charInserted()
{
// Here we call finishUndo for every 20 characters inserted.
// This is from my experience how emacs does it. (Lgb)
@ -768,7 +768,7 @@ void LyXText::charInserted()
// the cursor set functions have a special mechanism. When they
// realize, that you left an empty paragraph, they will delete it.
bool LyXText::cursorRightOneWord(Cursor & cur)
bool Text::cursorRightOneWord(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
@ -789,7 +789,7 @@ bool LyXText::cursorRightOneWord(Cursor & cur)
}
bool LyXText::cursorLeftOneWord(Cursor & cur)
bool Text::cursorLeftOneWord(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
@ -810,7 +810,7 @@ bool LyXText::cursorLeftOneWord(Cursor & cur)
}
void LyXText::selectWord(Cursor & cur, word_location loc)
void Text::selectWord(Cursor & cur, word_location loc)
{
BOOST_ASSERT(this == cur.text());
CursorSlice from = cur.top();
@ -829,7 +829,7 @@ void LyXText::selectWord(Cursor & cur, word_location loc)
// Select the word currently under the cursor when no
// selection is currently set
bool LyXText::selectWordWhenUnderCursor(Cursor & cur, word_location loc)
bool Text::selectWordWhenUnderCursor(Cursor & cur, word_location loc)
{
BOOST_ASSERT(this == cur.text());
if (cur.selection())
@ -839,7 +839,7 @@ bool LyXText::selectWordWhenUnderCursor(Cursor & cur, word_location loc)
}
void LyXText::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
{
BOOST_ASSERT(this == cur.text());
@ -943,7 +943,7 @@ void LyXText::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
}
void LyXText::acceptChanges(BufferParams const & bparams)
void Text::acceptChanges(BufferParams const & bparams)
{
pit_type pars_size = static_cast<pit_type>(pars_.size());
@ -978,7 +978,7 @@ void LyXText::acceptChanges(BufferParams const & bparams)
}
void LyXText::rejectChanges(BufferParams const & bparams)
void Text::rejectChanges(BufferParams const & bparams)
{
pit_type pars_size = static_cast<pit_type>(pars_.size());
@ -1014,7 +1014,7 @@ void LyXText::rejectChanges(BufferParams const & bparams)
// Delete from cursor up to the end of the current or next word.
void LyXText::deleteWordForward(Cursor & cur)
void Text::deleteWordForward(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
if (cur.lastpos() == 0)
@ -1031,7 +1031,7 @@ void LyXText::deleteWordForward(Cursor & cur)
// Delete from cursor to start of current or prior word.
void LyXText::deleteWordBackward(Cursor & cur)
void Text::deleteWordBackward(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
if (cur.lastpos() == 0)
@ -1048,7 +1048,7 @@ void LyXText::deleteWordBackward(Cursor & cur)
// Kill to end of line.
void LyXText::deleteLineForward(Cursor & cur)
void Text::deleteLineForward(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
if (cur.lastpos() == 0) {
@ -1069,7 +1069,7 @@ void LyXText::deleteLineForward(Cursor & cur)
}
void LyXText::changeCase(Cursor & cur, LyXText::TextCase action)
void Text::changeCase(Cursor & cur, Text::TextCase action)
{
BOOST_ASSERT(this == cur.text());
CursorSlice from;
@ -1170,7 +1170,7 @@ void LyXText::changeCase(Cursor & cur, LyXText::TextCase action)
}
bool LyXText::erase(Cursor & cur)
bool Text::erase(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
bool needsUpdate = false;
@ -1211,7 +1211,7 @@ bool LyXText::erase(Cursor & cur)
}
bool LyXText::backspacePos0(Cursor & cur)
bool Text::backspacePos0(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
if (cur.pit() == 0)
@ -1262,7 +1262,7 @@ bool LyXText::backspacePos0(Cursor & cur)
}
bool LyXText::backspace(Cursor & cur)
bool Text::backspace(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
bool needsUpdate = false;
@ -1306,7 +1306,7 @@ bool LyXText::backspace(Cursor & cur)
}
bool LyXText::dissolveInset(Cursor & cur) {
bool Text::dissolveInset(Cursor & cur) {
BOOST_ASSERT(this == cur.text());
if (isMainText(*cur.bv().buffer()) || cur.inset().nargs() != 1)
@ -1351,14 +1351,14 @@ bool LyXText::dissolveInset(Cursor & cur) {
// only used for inset right now. should also be used for main text
void LyXText::draw(PainterInfo & pi, int x, int y) const
void Text::draw(PainterInfo & pi, int x, int y) const
{
paintTextInset(*this, pi, x, y);
}
// only used for inset right now. should also be used for main text
void LyXText::drawSelection(PainterInfo & pi, int x, int) const
void Text::drawSelection(PainterInfo & pi, int x, int) const
{
Cursor & cur = pi.base.bv->cursor();
if (!cur.selection())
@ -1460,20 +1460,20 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const
}
bool LyXText::isLastRow(pit_type pit, Row const & row) const
bool Text::isLastRow(pit_type pit, Row const & row) const
{
return row.endpos() >= pars_[pit].size()
&& pit + 1 == pit_type(paragraphs().size());
}
bool LyXText::isFirstRow(pit_type pit, Row const & row) const
bool Text::isFirstRow(pit_type pit, Row const & row) const
{
return row.pos() == 0 && pit == 0;
}
void LyXText::getWord(CursorSlice & from, CursorSlice & to,
void Text::getWord(CursorSlice & from, CursorSlice & to,
word_location const loc)
{
Paragraph const & from_par = pars_[from.pit()];
@ -1499,7 +1499,7 @@ void LyXText::getWord(CursorSlice & from, CursorSlice & to,
--from.pos();
break;
case NEXT_WORD:
lyxerr << "LyXText::getWord: NEXT_WORD not implemented yet"
lyxerr << "Text::getWord: NEXT_WORD not implemented yet"
<< endl;
break;
case PARTIAL_WORD:
@ -1513,7 +1513,7 @@ void LyXText::getWord(CursorSlice & from, CursorSlice & to,
}
void LyXText::write(Buffer const & buf, std::ostream & os) const
void Text::write(Buffer const & buf, std::ostream & os) const
{
ParagraphList::const_iterator pit = paragraphs().begin();
ParagraphList::const_iterator end = paragraphs().end();
@ -1523,7 +1523,7 @@ void LyXText::write(Buffer const & buf, std::ostream & os) const
}
bool LyXText::read(Buffer const & buf, Lexer & lex, ErrorList & errorList)
bool Text::read(Buffer const & buf, Lexer & lex, ErrorList & errorList)
{
depth_type depth = 0;
@ -1574,7 +1574,7 @@ bool LyXText::read(Buffer const & buf, Lexer & lex, ErrorList & errorList)
return true;
}
int LyXText::cursorX(BufferView const & bv, CursorSlice const & sl,
int Text::cursorX(BufferView const & bv, CursorSlice const & sl,
bool boundary) const
{
TextMetrics const & tm = bv.textMetrics(sl.text());
@ -1668,9 +1668,9 @@ int LyXText::cursorX(BufferView const & bv, CursorSlice const & sl,
}
int LyXText::cursorY(BufferView const & bv, CursorSlice const & sl, bool boundary) const
int Text::cursorY(BufferView const & bv, CursorSlice const & sl, bool boundary) const
{
//lyxerr << "LyXText::cursorY: boundary: " << boundary << std::endl;
//lyxerr << "Text::cursorY: boundary: " << boundary << std::endl;
ParagraphMetrics const & pm = bv.parMetrics(this, sl.pit());
if (pm.rows().empty())
return 0;
@ -1692,7 +1692,7 @@ int LyXText::cursorY(BufferView const & bv, CursorSlice const & sl, bool boundar
// Returns the current font and depth as a message.
docstring LyXText::currentState(Cursor & cur)
docstring Text::currentState(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
Buffer & buf = cur.buffer();
@ -1771,7 +1771,7 @@ docstring LyXText::currentState(Cursor & cur)
}
docstring LyXText::getPossibleLabel(Cursor & cur) const
docstring Text::getPossibleLabel(Cursor & cur) const
{
pit_type pit = cur.pit();
@ -1834,7 +1834,7 @@ docstring LyXText::getPossibleLabel(Cursor & cur) const
}
void LyXText::setCursorFromCoordinates(Cursor & cur, int const x, int const y)
void Text::setCursorFromCoordinates(Cursor & cur, int const x, int const y)
{
BOOST_ASSERT(this == cur.text());
pit_type pit = getPitNearY(cur.bv(), y);
@ -1884,7 +1884,7 @@ void LyXText::setCursorFromCoordinates(Cursor & cur, int const x, int const y)
}
void LyXText::charsTranspose(Cursor & cur)
void Text::charsTranspose(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
/**
* \file LyXText.h
* \file Text.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@ -11,8 +11,8 @@
* Full author contact details are available in file CREDITS.
*/
#ifndef LYXTEXT_H
#define LYXTEXT_H
#ifndef TEXT_H
#define TEXT_H
#include "Bidi.h"
#include "DispatchResult.h"
@ -44,10 +44,10 @@ class Spacing;
/// This class encapsulates the main text data and operations in LyX
class LyXText {
class Text {
public:
/// constructor
explicit LyXText();
explicit Text();
///
Font getFont(Buffer const & buffer, Paragraph const & par,
@ -155,9 +155,9 @@ public:
};
/// accept or reject the selected change
void acceptOrRejectChanges(Cursor & cur, ChangeOp op);
/// accept the changes within the complete LyXText
/// accept the changes within the complete Text
void acceptChanges(BufferParams const & bparams);
/// reject the changes within the complete LyXText
/// reject the changes within the complete Text
void rejectChanges(BufferParams const & bparams);
/// returns true if par was empty and was removed
@ -176,7 +176,7 @@ public:
///
void recUndo(Cursor & cur, pit_type first) const;
/// sets cursor only within this LyXText.
/// sets cursor only within this Text.
/// x,y are screen coordinates
void setCursorFromCoordinates(Cursor & cur, int x, int y);
@ -282,7 +282,7 @@ public:
/// Returns an inset if inset was hit, or 0 if not.
/// \warning This method is not recursive! It will return the
/// outermost inset within this LyXText.
/// outermost inset within this Text.
/// \sa BufferView::getCoveringInset() to get the innermost inset.
Inset * checkInsetHit(BufferView &, int x, int y);

View File

@ -19,7 +19,7 @@
#include <config.h>
#include "LyXText.h"
#include "Text.h"
#include "Buffer.h"
#include "buffer_funcs.h"
@ -73,21 +73,21 @@ using std::max;
using std::min;
LyXText::LyXText()
Text::Text()
: current_font(Font::ALL_INHERIT),
background_color_(Color::background),
autoBreakRows_(false)
{}
bool LyXText::isMainText(Buffer const & buffer) const
bool Text::isMainText(Buffer const & buffer) const
{
return &buffer.text() == this;
}
//takes screen x,y coordinates
Inset * LyXText::checkInsetHit(BufferView & bv, int x, int y)
Inset * Text::checkInsetHit(BufferView & bv, int x, int y)
{
pit_type pit = getPitNearY(bv, y);
BOOST_ASSERT(pit != -1);
@ -143,7 +143,7 @@ Inset * LyXText::checkInsetHit(BufferView & bv, int x, int y)
// The difference is that this one is used for displaying, and thus we
// are allowed to make cosmetic improvements. For instance make footnotes
// smaller. (Asger)
Font LyXText::getFont(Buffer const & buffer, Paragraph const & par,
Font Text::getFont(Buffer const & buffer, Paragraph const & par,
pos_type const pos) const
{
BOOST_ASSERT(pos >= 0);
@ -217,7 +217,7 @@ Font LyXText::getFont(Buffer const & buffer, Paragraph const & par,
// the pi/mi parameters, and stored locally in a lyxtext in font_.
// This is where the two are integrated in the final fully realized
// font.
void LyXText::applyOuterFont(Buffer const & buffer, Font & font) const {
void Text::applyOuterFont(Buffer const & buffer, Font & font) const {
Font lf(font_);
lf.reduce(buffer.params().getFont());
lf.realize(font);
@ -226,7 +226,7 @@ void LyXText::applyOuterFont(Buffer const & buffer, Font & font) const {
}
Font LyXText::getLayoutFont(Buffer const & buffer, pit_type const pit) const
Font Text::getLayoutFont(Buffer const & buffer, pit_type const pit) const
{
Layout_ptr const & layout = pars_[pit].layout();
@ -247,7 +247,7 @@ Font LyXText::getLayoutFont(Buffer const & buffer, pit_type const pit) const
}
Font LyXText::getLabelFont(Buffer const & buffer, Paragraph const & par) const
Font Text::getLabelFont(Buffer const & buffer, Paragraph const & par) const
{
Layout_ptr const & layout = par.layout();
@ -267,7 +267,7 @@ Font LyXText::getLabelFont(Buffer const & buffer, Paragraph const & par) const
}
void LyXText::setCharFont(Buffer const & buffer, pit_type pit,
void Text::setCharFont(Buffer const & buffer, pit_type pit,
pos_type pos, Font const & fnt)
{
Font font = fnt;
@ -308,7 +308,7 @@ void LyXText::setCharFont(Buffer const & buffer, pit_type pit,
// return past-the-last paragraph influenced by a layout change on pit
pit_type LyXText::undoSpan(pit_type pit)
pit_type Text::undoSpan(pit_type pit)
{
pit_type end = paragraphs().size();
pit_type nextpit = pit + 1;
@ -326,7 +326,7 @@ pit_type LyXText::undoSpan(pit_type pit)
}
void LyXText::setLayout(Buffer const & buffer, pit_type start, pit_type end,
void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end,
string const & layout)
{
BOOST_ASSERT(start != end);
@ -345,7 +345,7 @@ void LyXText::setLayout(Buffer const & buffer, pit_type start, pit_type end,
// set layout over selection and make a total rebreak of those paragraphs
void LyXText::setLayout(Cursor & cur, string const & layout)
void Text::setLayout(Cursor & cur, string const & layout)
{
BOOST_ASSERT(this == cur.text());
// special handling of new environment insets
@ -374,21 +374,21 @@ void LyXText::setLayout(Cursor & cur, string const & layout)
}
static bool changeDepthAllowed(LyXText::DEPTH_CHANGE type,
static bool changeDepthAllowed(Text::DEPTH_CHANGE type,
Paragraph const & par, int max_depth)
{
if (par.layout()->labeltype == LABEL_BIBLIO)
return false;
int const depth = par.params().depth();
if (type == LyXText::INC_DEPTH && depth < max_depth)
if (type == Text::INC_DEPTH && depth < max_depth)
return true;
if (type == LyXText::DEC_DEPTH && depth > 0)
if (type == Text::DEC_DEPTH && depth > 0)
return true;
return false;
}
bool LyXText::changeDepthAllowed(Cursor & cur, DEPTH_CHANGE type) const
bool Text::changeDepthAllowed(Cursor & cur, DEPTH_CHANGE type) const
{
BOOST_ASSERT(this == cur.text());
// this happens when selecting several cells in tabular (bug 2630)
@ -408,7 +408,7 @@ bool LyXText::changeDepthAllowed(Cursor & cur, DEPTH_CHANGE type) const
}
void LyXText::changeDepth(Cursor & cur, DEPTH_CHANGE type)
void Text::changeDepth(Cursor & cur, DEPTH_CHANGE type)
{
BOOST_ASSERT(this == cur.text());
pit_type const beg = cur.selBegin().pit();
@ -434,7 +434,7 @@ void LyXText::changeDepth(Cursor & cur, DEPTH_CHANGE type)
// set font over selection
void LyXText::setFont(Cursor & cur, Font const & font, bool toggleall)
void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
{
BOOST_ASSERT(this == cur.text());
// if there is no selection just set the current_font
@ -486,7 +486,7 @@ void LyXText::setFont(Cursor & cur, Font const & font, bool toggleall)
// the cursor set functions have a special mechanism. When they
// realize you left an empty paragraph, they will delete it.
bool LyXText::cursorHome(Cursor & cur)
bool Text::cursorHome(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
ParagraphMetrics const & pm = cur.bv().parMetrics(this, cur.pit());
@ -495,7 +495,7 @@ bool LyXText::cursorHome(Cursor & cur)
}
bool LyXText::cursorEnd(Cursor & cur)
bool Text::cursorEnd(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
// if not on the last row of the par, put the cursor before
@ -517,21 +517,21 @@ bool LyXText::cursorEnd(Cursor & cur)
}
bool LyXText::cursorTop(Cursor & cur)
bool Text::cursorTop(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
return setCursor(cur, 0, 0);
}
bool LyXText::cursorBottom(Cursor & cur)
bool Text::cursorBottom(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
return setCursor(cur, cur.lastpit(), boost::prior(paragraphs().end())->size());
}
void LyXText::toggleFree(Cursor & cur, Font const & font, bool toggleall)
void Text::toggleFree(Cursor & cur, Font const & font, bool toggleall)
{
BOOST_ASSERT(this == cur.text());
// If the mask is completely neutral, tell user
@ -564,7 +564,7 @@ void LyXText::toggleFree(Cursor & cur, Font const & font, bool toggleall)
}
docstring LyXText::getStringToIndex(Cursor const & cur)
docstring Text::getStringToIndex(Cursor const & cur)
{
BOOST_ASSERT(this == cur.text());
@ -590,7 +590,7 @@ docstring LyXText::getStringToIndex(Cursor const & cur)
}
void LyXText::setParagraph(Cursor & cur,
void Text::setParagraph(Cursor & cur,
Spacing const & spacing, LyXAlignment align,
docstring const & labelwidthstring, bool noindent)
{
@ -623,7 +623,7 @@ void LyXText::setParagraph(Cursor & cur,
// this really should just insert the inset and not move the cursor.
void LyXText::insertInset(Cursor & cur, Inset * inset)
void Text::insertInset(Cursor & cur, Inset * inset)
{
BOOST_ASSERT(this == cur.text());
BOOST_ASSERT(inset);
@ -634,7 +634,7 @@ void LyXText::insertInset(Cursor & cur, Inset * inset)
// needed to insert the selection
void LyXText::insertStringAsLines(Cursor & cur, docstring const & str)
void Text::insertStringAsLines(Cursor & cur, docstring const & str)
{
cur.buffer().insertStringAsLines(pars_, cur.pit(), cur.pos(),
current_font, str, autoBreakRows_);
@ -643,7 +643,7 @@ void LyXText::insertStringAsLines(Cursor & cur, docstring const & str)
// turn double CR to single CR, others are converted into one
// blank. Then insertStringAsLines is called
void LyXText::insertStringAsParagraphs(Cursor & cur, docstring const & str)
void Text::insertStringAsParagraphs(Cursor & cur, docstring const & str)
{
docstring linestr = str;
bool newline_inserted = false;
@ -668,7 +668,7 @@ void LyXText::insertStringAsParagraphs(Cursor & cur, docstring const & str)
}
bool LyXText::setCursor(Cursor & cur, pit_type par, pos_type pos,
bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos,
bool setfont, bool boundary)
{
Cursor old = cur;
@ -677,7 +677,7 @@ bool LyXText::setCursor(Cursor & cur, pit_type par, pos_type pos,
}
void LyXText::setCursor(CursorSlice & cur, pit_type par, pos_type pos)
void Text::setCursor(CursorSlice & cur, pit_type par, pos_type pos)
{
BOOST_ASSERT(par != int(paragraphs().size()));
cur.pit() = par;
@ -701,7 +701,7 @@ void LyXText::setCursor(CursorSlice & cur, pit_type par, pos_type pos)
}
void LyXText::setCursorIntern(Cursor & cur,
void Text::setCursorIntern(Cursor & cur,
pit_type par, pos_type pos, bool setfont, bool boundary)
{
BOOST_ASSERT(this == cur.text());
@ -712,7 +712,7 @@ void LyXText::setCursorIntern(Cursor & cur,
}
void LyXText::setCurrentFont(Cursor & cur)
void Text::setCurrentFont(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
pos_type pos = cur.pos();
@ -751,7 +751,7 @@ void LyXText::setCurrentFont(Cursor & cur)
}
// y is screen coordinate
pit_type LyXText::getPitNearY(BufferView & bv, int y) const
pit_type Text::getPitNearY(BufferView & bv, int y) const
{
BOOST_ASSERT(!paragraphs().empty());
BOOST_ASSERT(bv.coordCache().getParPos().find(this) != bv.coordCache().getParPos().end());
@ -829,7 +829,7 @@ pit_type LyXText::getPitNearY(BufferView & bv, int y) const
}
Row const & LyXText::getRowNearY(BufferView const & bv, int y, pit_type pit) const
Row const & Text::getRowNearY(BufferView const & bv, int y, pit_type pit) const
{
ParagraphMetrics const & pm = bv.parMetrics(this, pit);
@ -846,10 +846,10 @@ Row const & LyXText::getRowNearY(BufferView const & bv, int y, pit_type pit) con
// x,y are absolute screen coordinates
// sets cursor recursively descending into nested editable insets
Inset * LyXText::editXY(Cursor & cur, int x, int y)
Inset * Text::editXY(Cursor & cur, int x, int y)
{
if (lyxerr.debugging(Debug::WORKAREA)) {
lyxerr << "LyXText::editXY(cur, " << x << ", " << y << ")" << std::endl;
lyxerr << "Text::editXY(cur, " << x << ", " << y << ")" << std::endl;
cur.bv().coordCache().dump();
}
pit_type pit = getPitNearY(cur.bv(), y);
@ -899,7 +899,7 @@ Inset * LyXText::editXY(Cursor & cur, int x, int y)
}
bool LyXText::checkAndActivateInset(Cursor & cur, bool front)
bool Text::checkAndActivateInset(Cursor & cur, bool front)
{
if (cur.selection())
return false;
@ -913,7 +913,7 @@ bool LyXText::checkAndActivateInset(Cursor & cur, bool front)
}
bool LyXText::cursorLeft(Cursor & cur)
bool Text::cursorLeft(Cursor & cur)
{
// Tell BufferView to test for FitCursor in any case!
cur.updateFlags(Update::FitCursor);
@ -946,7 +946,7 @@ bool LyXText::cursorLeft(Cursor & cur)
}
bool LyXText::cursorRight(Cursor & cur)
bool Text::cursorRight(Cursor & cur)
{
// Tell BufferView to test for FitCursor in any case!
cur.updateFlags(Update::FitCursor);
@ -978,7 +978,7 @@ bool LyXText::cursorRight(Cursor & cur)
}
bool LyXText::cursorUp(Cursor & cur)
bool Text::cursorUp(Cursor & cur)
{
// Tell BufferView to test for FitCursor in any case!
cur.updateFlags(Update::FitCursor);
@ -1037,7 +1037,7 @@ bool LyXText::cursorUp(Cursor & cur)
}
bool LyXText::cursorDown(Cursor & cur)
bool Text::cursorDown(Cursor & cur)
{
// Tell BufferView to test for FitCursor in any case!
cur.updateFlags(Update::FitCursor);
@ -1098,7 +1098,7 @@ bool LyXText::cursorDown(Cursor & cur)
}
bool LyXText::cursorUpParagraph(Cursor & cur)
bool Text::cursorUpParagraph(Cursor & cur)
{
bool updated = false;
if (cur.pos() > 0)
@ -1109,7 +1109,7 @@ bool LyXText::cursorUpParagraph(Cursor & cur)
}
bool LyXText::cursorDownParagraph(Cursor & cur)
bool Text::cursorDownParagraph(Cursor & cur)
{
bool updated = false;
if (cur.pit() != cur.lastpit())
@ -1122,7 +1122,7 @@ bool LyXText::cursorDownParagraph(Cursor & cur)
// fix the cursor `cur' after a characters has been deleted at `where'
// position. Called by deleteEmptyParagraphMechanism
void LyXText::fixCursorAfterDelete(CursorSlice & cur, CursorSlice const & where)
void Text::fixCursorAfterDelete(CursorSlice & cur, CursorSlice const & where)
{
// Do nothing if cursor is not in the paragraph where the
// deletion occured,
@ -1140,7 +1140,7 @@ void LyXText::fixCursorAfterDelete(CursorSlice & cur, CursorSlice const & where)
}
bool LyXText::deleteEmptyParagraphMechanism(Cursor & cur,
bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
Cursor & old, bool & need_anchor_change)
{
//LYXERR(Debug::DEBUG) << "DEPM: cur:\n" << cur << "old:\n" << old << endl;
@ -1244,7 +1244,7 @@ bool LyXText::deleteEmptyParagraphMechanism(Cursor & cur,
}
void LyXText::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges)
void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges)
{
BOOST_ASSERT(first >= 0 && first <= last && last < (int) pars_.size());
@ -1265,7 +1265,7 @@ void LyXText::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool
}
// don't delete anything if this is the only remaining paragraph within the given range
// note: LyXText::acceptOrRejectChanges() sets the cursor to 'first' after calling DEPM
// note: Text::acceptOrRejectChanges() sets the cursor to 'first' after calling DEPM
if (first == last)
continue;
@ -1285,13 +1285,13 @@ void LyXText::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool
}
void LyXText::recUndo(Cursor & cur, pit_type first, pit_type last) const
void Text::recUndo(Cursor & cur, pit_type first, pit_type last) const
{
recordUndo(cur, Undo::ATOMIC, first, last);
}
void LyXText::recUndo(Cursor & cur, pit_type par) const
void Text::recUndo(Cursor & cur, pit_type par) const
{
recordUndo(cur, Undo::ATOMIC, par, par);
}

View File

@ -15,7 +15,7 @@
#include <config.h>
#include "LyXText.h"
#include "Text.h"
#include "BranchList.h"
#include "FloatList.h"
@ -100,7 +100,7 @@ namespace {
bool toggleall = false;
void toggleAndShow(Cursor & cur, LyXText * text,
void toggleAndShow(Cursor & cur, Text * text,
Font const & font, bool toggleall = true)
{
text->toggleFree(cur, font, toggleall);
@ -201,7 +201,7 @@ string const freefont2string()
}
void LyXText::cursorPrevious(Cursor & cur)
void Text::cursorPrevious(Cursor & cur)
{
pos_type cpos = cur.pos();
pit_type cpar = cur.pit();
@ -220,7 +220,7 @@ void LyXText::cursorPrevious(Cursor & cur)
}
void LyXText::cursorNext(Cursor & cur)
void Text::cursorNext(Cursor & cur)
{
pos_type cpos = cur.pos();
pit_type cpar = cur.pit();
@ -250,7 +250,7 @@ void specialChar(Cursor & cur, InsetSpecialChar::Kind kind)
}
bool doInsertInset(Cursor & cur, LyXText * text,
bool doInsertInset(Cursor & cur, Text * text,
FuncRequest const & cmd, bool edit, bool pastesel)
{
Inset * inset = createInset(&cur.bv(), cmd);
@ -284,7 +284,7 @@ bool doInsertInset(Cursor & cur, LyXText * text,
} // anon namespace
void LyXText::number(Cursor & cur)
void Text::number(Cursor & cur)
{
Font font(Font::ALL_IGNORE);
font.setNumber(Font::TOGGLE);
@ -292,15 +292,15 @@ void LyXText::number(Cursor & cur)
}
bool LyXText::isRTL(Buffer const & buffer, Paragraph const & par) const
bool Text::isRTL(Buffer const & buffer, Paragraph const & par) const
{
return par.isRightToLeftPar(buffer.params());
}
void LyXText::dispatch(Cursor & cur, FuncRequest & cmd)
void Text::dispatch(Cursor & cur, FuncRequest & cmd)
{
LYXERR(Debug::ACTION) << "LyXText::dispatch: cmd: " << cmd << endl;
LYXERR(Debug::ACTION) << "Text::dispatch: cmd: " << cmd << endl;
// FIXME: We use the update flag to indicates wether a singlePar or a
// full screen update is needed. We reset it here but shall we restore it
@ -797,15 +797,15 @@ void LyXText::dispatch(Cursor & cur, FuncRequest & cmd)
break;
case LFUN_WORD_UPCASE:
changeCase(cur, LyXText::text_uppercase);
changeCase(cur, Text::text_uppercase);
break;
case LFUN_WORD_LOWCASE:
changeCase(cur, LyXText::text_lowercase);
changeCase(cur, Text::text_lowercase);
break;
case LFUN_WORD_CAPITALIZE:
changeCase(cur, LyXText::text_capitalization);
changeCase(cur, Text::text_capitalization);
break;
case LFUN_CHARS_TRANSPOSE:
@ -1575,7 +1575,7 @@ void LyXText::dispatch(Cursor & cur, FuncRequest & cmd)
LYXERR(Debug::ACTION)
<< BOOST_CURRENT_FUNCTION
<< ": Command " << cmd
<< " not DISPATCHED by LyXText" << endl;
<< " not DISPATCHED by Text" << endl;
cur.undispatched();
break;
}
@ -1584,7 +1584,7 @@ void LyXText::dispatch(Cursor & cur, FuncRequest & cmd)
// FIXME: The cursor flag is reset two lines below
// so we need to check here if some of the LFUN did touch that.
// for now only LyXText::erase() and LyXText::backspace() do that.
// for now only Text::erase() and Text::backspace() do that.
// The plan is to verify all the LFUNs and then to remove this
// singleParUpdate boolean altogether.
if (cur.result().update() & Update::Force) {
@ -1629,7 +1629,7 @@ void LyXText::dispatch(Cursor & cur, FuncRequest & cmd)
}
bool LyXText::getStatus(Cursor & cur, FuncRequest const & cmd,
bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
BOOST_ASSERT(cur.text() == this);
@ -1991,7 +1991,7 @@ bool LyXText::getStatus(Cursor & cur, FuncRequest const & cmd,
}
void LyXText::pasteString(Cursor & cur, docstring const & clip,
void Text::pasteString(Cursor & cur, docstring const & clip,
bool asParagraphs)
{
cur.clearSelection();

View File

@ -31,7 +31,7 @@
#include "Color.h"
#include "Length.h"
#include "LyXRC.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "ParagraphParameters.h"
#include "VSpace.h"
@ -106,7 +106,7 @@ int numberOfHfills(Paragraph const & par, Row const & row)
} // namespace anon
TextMetrics::TextMetrics(BufferView * bv, LyXText * text)
TextMetrics::TextMetrics(BufferView * bv, Text * text)
: bv_(bv), text_(text)
{
BOOST_ASSERT(bv_);
@ -145,7 +145,7 @@ bool TextMetrics::metrics(MetricsInfo & mi, Dimension & dim)
BOOST_ASSERT(mi.base.textwidth);
max_width_ = mi.base.textwidth;
//lyxerr << "LyXText::metrics: width: " << mi.base.textwidth
//lyxerr << "Text::metrics: width: " << mi.base.textwidth
// << " maxWidth: " << max_width_ << "\nfont: " << mi.base.font << endl;
bool changed = false;
@ -765,7 +765,7 @@ void TextMetrics::setHeightOfRow(pit_type const pit,
// FIXME: the correct way is to do the following is to move the
// following code in another method specially tailored for the
// main LyXText. The following test is thus bogus.
// main Text. The following test is thus bogus.
// Top and bottom margin of the document (only at top-level)
if (main_text_) {
if (pit == 0 && row.pos() == 0)
@ -788,7 +788,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
{
Buffer const & buffer = *bv_->buffer();
/// For the main LyXText, it is possible that this pit is not
/// For the main Text, it is possible that this pit is not
/// yet in the CoordCache when moving cursor up.
/// x Paragraph coordinate is always 0 for main text anyway.
int const xo = main_text_? 0 : bv_->coordCache().get(text_, pit).x_;
@ -934,7 +934,7 @@ pos_type TextMetrics::x2pos(pit_type pit, int row, int x) const
}
//int LyXText::pos2x(pit_type pit, pos_type pos) const
//int Text::pos2x(pit_type pit, pos_type pos) const
//{
// ParagraphMetrics const & pm = parMetrics(pit);
// Row const & r = pm.rows()[row];

View File

@ -24,17 +24,17 @@
namespace lyx {
class BufferView;
class LyXText;
class Text;
class MetricsInfo;
/// A map from a LyXText to the map of paragraphs metrics
/// A map from a Text to the map of paragraphs metrics
class TextMetrics
{
public:
/// Default constructor (only here for STL containers).
TextMetrics(): text_(0) {}
/// The only useful constructor.
TextMetrics(BufferView *, LyXText *);
TextMetrics(BufferView *, Text *);
///
ParagraphMetrics const & parMetrics(pit_type) const;
///
@ -111,7 +111,7 @@ private:
/// The text contents (the model).
/// \todo FIXME: this should be const.
LyXText * text_;
Text * text_;
bool main_text_;
/// A map from paragraph index number to paragraph metrics
@ -125,8 +125,8 @@ private:
/*
/// A map from paragraph index number to screen point
typedef std::map<pit_type, Point> InnerParPosCache;
/// A map from a LyXText to the map of paragraphs to screen points
typedef std::map<LyXText const *, InnerParPosCache> ParPosCache;
/// A map from a Text to the map of paragraphs to screen points
typedef std::map<Text const *, InnerParPosCache> ParPosCache;
/// Paragraph grouped by owning text
ParPosCache pars_;
*/

View File

@ -19,7 +19,7 @@
#include "Cursor.h"
#include "debug.h"
#include "LyXRC.h"
#include "LyXText.h"
#include "Text.h"
#include "Trans.h"
#include "support/lstrings.h"
@ -242,7 +242,7 @@ void TransManager::disableKeymap()
}
void TransManager::translateAndInsert(char_type c, LyXText * text, Cursor & cur)
void TransManager::translateAndInsert(char_type c, Text * text, Cursor & cur)
{
docstring res = active_->process(c, *this);
@ -256,14 +256,14 @@ void TransManager::translateAndInsert(char_type c, LyXText * text, Cursor & cur
}
void TransManager::insert(docstring const & str, LyXText * text, Cursor & cur)
void TransManager::insert(docstring const & str, Text * text, Cursor & cur)
{
for (string::size_type i = 0, n = str.size(); i < n; ++i)
text->insertChar(cur, str[i]);
}
void TransManager::deadkey(char_type c, tex_accent accent, LyXText * t, Cursor & cur)
void TransManager::deadkey(char_type c, tex_accent accent, Text * t, Cursor & cur)
{
if (c == 0 && active_ != &default_) {
// A deadkey was pressed that cannot be printed

View File

@ -22,7 +22,7 @@
namespace lyx {
class Cursor;
class LyXText;
class Text;
class Trans;
/// Translation state
@ -148,7 +148,7 @@ private:
///
static Trans default_;
///
void insert(docstring const &, LyXText *, Cursor & cur);
void insert(docstring const &, Text *, Cursor & cur);
public:
///
TransManager();
@ -169,13 +169,13 @@ public:
return trans_fsm_.currentState->backspace();
}
///
void translateAndInsert(char_type, LyXText *, Cursor &);
void translateAndInsert(char_type, Text *, Cursor &);
///
docstring const deadkey(char_type, KmodInfo);
///
docstring const normalkey(char_type);
///
void deadkey(char_type, tex_accent, LyXText *, Cursor &);
void deadkey(char_type, tex_accent, Text *, Cursor &);
};

View File

@ -21,7 +21,7 @@
#include "Cursor.h"
#include "debug.h"
#include "BufferView.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "ParagraphList.h"
@ -104,9 +104,9 @@ void doRecordUndo(Undo::undo_kind kind,
undo.array = new MathData(cell.cell());
} else {
// some more effort needed here as 'the whole cell' of the
// main LyXText _is_ the whole document.
// main Text _is_ the whole document.
// record the relevant paragraphs
LyXText const * text = cell.text();
Text const * text = cell.text();
BOOST_ASSERT(text);
ParagraphList const & plist = text->paragraphs();
ParagraphList::const_iterator first = plist.begin();
@ -184,7 +184,7 @@ bool textUndoOrRedo(BufferView & bv,
undo.array = 0;
} else {
// Some finer machinery is needed here.
LyXText * text = dit.text();
Text * text = dit.text();
BOOST_ASSERT(text);
BOOST_ASSERT(undo.pars);
ParagraphList & plist = text->paragraphs();

View File

@ -16,7 +16,7 @@
#include "BufferView.h"
#include "gettext.h"
#include "lengthcommon.h"
#include "LyXText.h"
#include "Text.h"
#include "support/convert.h"
#include "support/lstrings.h"

View File

@ -355,7 +355,7 @@ bool needEnumCounterReset(ParIterator const & it)
void setCaptionLabels(Inset & inset, string const & type,
docstring const label, Counters & counters)
{
LyXText * text = inset.getText(0);
Text * text = inset.getText(0);
if (!text)
return;
@ -598,7 +598,7 @@ bool updateCurrentLabel(Buffer const & buf,
if (it == par_iterator_end(buf.inset()))
return false;
// if (it.lastpit == 0 && LyXText::isMainText(buf))
// if (it.lastpit == 0 && Text::isMainText(buf))
// return false;
switch (it->layout()->labeltype) {

View File

@ -29,7 +29,7 @@
#include "LyX.h"
#include "Layout.h"
#include "LyXRC.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "Undo.h"

View File

@ -32,7 +32,7 @@
#include "callback.h"
#include "LyXFunc.h"
#include "LyXRC.h"
#include "LyXText.h"
#include "Text.h"
#include "MenuBackend.h"
#include "Paragraph.h"

View File

@ -33,7 +33,7 @@
#include "Font.h"
#include "LyXRC.h"
#include "Row.h"
#include "LyXText.h"
#include "Text.h"
#include "LyXView.h"
#include "MetricsInfo.h"
#include "Paragraph.h"
@ -280,7 +280,7 @@ void WorkArea::showCursor()
CursorShape shape = BAR_SHAPE;
LyXText const & text = *buffer_view_->cursor().innerText();
Text const & text = *buffer_view_->cursor().innerText();
Font const & realfont = text.real_current_font;
BufferParams const & bp = buffer_view_->buffer()->params();
bool const samelang = realfont.language() == bp.language;

View File

@ -15,7 +15,7 @@
#include "BufferView.h"
#include "debug.h"
#include "gettext.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "ParIterator.h"

View File

@ -28,7 +28,7 @@
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "gettext.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "MetricsInfo.h"

View File

@ -37,7 +37,7 @@ class LaTeXFeatures;
class Color_color;
class Cursor;
class Lexer;
class LyXText;
class Text;
class MetricsInfo;
class Dimension;
class PainterInfo;
@ -401,7 +401,7 @@ public:
virtual bool allowSpellCheck() const { return false; }
/// if this insets owns text cells (e.g. InsetText) return cell num
virtual LyXText * getText(int /*num*/) const { return 0; }
virtual Text * getText(int /*num*/) const { return 0; }
/** Adds a LaTeX snippet to the Preview Loader for transformation
* into a bitmap image. Does not start the laoding process.

View File

@ -493,7 +493,7 @@ void InsetBoxMailer::string2params(string const & in,
return print_mailer_error("InsetBoxMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
// by LyXText::readInset
// by Text::readInset
string id;
lex >> id;
if (!lex || id != "Box")

View File

@ -304,7 +304,7 @@ void InsetBranchMailer::string2params(string const & in,
return print_mailer_error("InsetBranchMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
// by LyXText::readInset
// by Text::readInset
string id;
lex >> id;
if (!lex || id != "Branch")

View File

@ -25,7 +25,7 @@
#include "LaTeXFeatures.h"
#include "Color.h"
#include "Lexer.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"

View File

@ -24,7 +24,7 @@
namespace lyx {
class LyXText;
class Text;
class Paragraph;
class CursorSlice;

View File

@ -202,7 +202,7 @@ void InsetCommandMailer::string2params(string const & name,
return print_mailer_error("InsetCommandMailer", in, 1, name);
// This is part of the inset proper that is usually swallowed
// by LyXText::readInset
// by Text::readInset
string id;
lex >> id;
if (!lex || id != "LatexCommand")

View File

@ -203,7 +203,7 @@ void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
switch (cmd.action) {
case LFUN_QUOTE_INSERT: {
// We need to bypass the fancy quotes in LyXText
// We need to bypass the fancy quotes in Text
FuncRequest f(LFUN_SELF_INSERT, "\"");
dispatch(cur, f);
break;

View File

@ -877,7 +877,7 @@ void InsetExternalMailer::string2params(string const & in,
return print_mailer_error("InsetExternalMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
// by LyXText::readInset
// by Text::readInset
string id;
lex >> id;
if (!lex || id != "External")

View File

@ -441,7 +441,7 @@ void InsetFloatMailer::string2params(string const & in,
return print_mailer_error("InsetFloatMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
// by LyXText::readInset
// by Text::readInset
string id;
lex >> id;
if (!lex || id != "Float")

View File

@ -835,7 +835,7 @@ void InsetIncludeMailer::string2params(string const & in,
return print_mailer_error("InsetIncludeMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
// by LyXText::readInset
// by Text::readInset
string id;
lex >> id;
if (!lex || id != "Include")

View File

@ -17,7 +17,7 @@
#include "DispatchResult.h"
#include "FuncRequest.h"
#include "InsetList.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "ParIterator.h"
#include "sgml.h"

View File

@ -14,7 +14,7 @@
#include "debug.h"
#include "Color.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "LaTeXFeatures.h"
#include "OutputParams.h"

View File

@ -14,7 +14,7 @@
#include "debug.h"
#include "Color.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
#include "Paragraph.h"

View File

@ -399,7 +399,7 @@ void InsetNoteMailer::string2params(string const & in,
return print_mailer_error("InsetNoteMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
// by LyXText::readInset
// by Text::readInset
string id;
lex >> id;
if (!lex || id != "Note")

View File

@ -15,7 +15,7 @@
#include "debug.h"
#include "gettext.h"
#include "Color.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
#include "TextMetrics.h"

View File

@ -3194,7 +3194,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
if (cmd.button() == mouse_button::button2) {
if (cap::selection()) {
// See comment in LyXText::dispatch why we
// See comment in Text::dispatch why we
// do this
// FIXME This does not use paste_tabular,
// another reason why paste_tabular should go.
@ -3284,7 +3284,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
cell(cur.idx())->dispatch(cur, cmd);
cur.dispatched(); // override the cell's decision
if (sl == cur.top())
// if our LyXText didn't do anything to the cursor
// if our Text didn't do anything to the cursor
// then we try to put the cursor into the cell below
// setting also the right targetX.
if (tabular.row_of_cell(cur.idx()) != tabular.rows() - 1) {
@ -3314,13 +3314,13 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
cell(cur.idx())->dispatch(cur, cmd);
cur.dispatched(); // override the cell's decision
if (sl == cur.top())
// if our LyXText didn't do anything to the cursor
// if our Text didn't do anything to the cursor
// then we try to put the cursor into the cell above
// setting also the right targetX.
if (tabular.row_of_cell(cur.idx()) != 0) {
cur.idx() = tabular.getCellAbove(cur.idx());
cur.pit() = cur.lastpit();
LyXText const * text = cell(cur.idx())->getText(0);
Text const * text = cell(cur.idx())->getText(0);
TextMetrics const & tm = cur.bv().textMetrics(text);
ParagraphMetrics const & pm =
tm.parMetrics(cur.lastpit());
@ -4627,7 +4627,7 @@ void InsetTabular::getSelection(Cursor & cur,
}
LyXText * InsetTabular::getText(int idx) const
Text * InsetTabular::getText(int idx) const
{
return size_t(idx) < nargs() ? cell(idx)->getText(0) : 0;
}

View File

@ -726,7 +726,7 @@ public:
///
boost::shared_ptr<InsetText> cell(idx_type);
///
LyXText * getText(int) const;
Text * getText(int) const;
/// set the change for the entire inset
void setChange(Change const & change);

View File

@ -29,7 +29,7 @@
#include "lyxfind.h"
#include "Lexer.h"
#include "LyXRC.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
#include "output_docbook.h"

View File

@ -15,7 +15,7 @@
#include "Inset.h"
#include "RowList_fwd.h"
#include "Font.h"
#include "LyXText.h"
#include "Text.h"
#include "support/types.h"
@ -95,8 +95,8 @@ public:
///
bool showInsetDialog(BufferView *) const;
///
LyXText * getText(int i) const {
return (i == 0) ? const_cast<LyXText*>(&text_) : 0;
Text * getText(int i) const {
return (i == 0) ? const_cast<Text*>(&text_) : 0;
}
///
virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
@ -160,7 +160,7 @@ private:
bool wide_inset_;
public:
///
mutable LyXText text_;
mutable Text text_;
///
mutable Font font_;
///

View File

@ -16,7 +16,7 @@
#include "debug.h"
#include "gettext.h"
#include "Font.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "support/std_ostream.h"

View File

@ -20,7 +20,7 @@
#include "gettext.h"
#include "Color.h"
#include "Lexer.h"
#include "LyXText.h"
#include "Text.h"
#include "MetricsInfo.h"
#include "OutputParams.h"

View File

@ -270,7 +270,7 @@ void InsetWrapMailer::string2params(string const & in, InsetWrapParams & params)
return print_mailer_error("InsetWrapMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
// by LyXText::readInset
// by Text::readInset
string id;
lex >> id;
if (!lex || id != "Wrap")

View File

@ -23,7 +23,7 @@
#include "debug.h"
#include "FuncRequest.h"
#include "gettext.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "ParIterator.h"
#include "Undo.h"

View File

@ -21,7 +21,7 @@ namespace lyx {
class BufferView;
class FuncRequest;
class LyXText;
class Text;
/** Encode the parameters needed to find \c search as a string
* that can be dispatched to the LyX core in a FuncRequest wrapper.

View File

@ -26,7 +26,7 @@
#include "InsetMathRef.h"
#include "bufferview_funcs.h"
#include "LyXText.h"
#include "Text.h"
#include "Buffer.h"
#include "BufferParams.h"
@ -1274,7 +1274,7 @@ void InsetMathHull::mutateToText()
string str = os.str();
// insert this text
LyXText * lt = view_->cursor().innerText();
Text * lt = view_->cursor().innerText();
string::const_iterator cit = str.begin();
string::const_iterator end = str.end();
for (; cit != end; ++cit)

View File

@ -110,7 +110,7 @@ void InsetMathMBox::doDispatch(Cursor & cur, FuncRequest & cmd)
}
LyXText * InsetMathMBox::getText(int) const
Text * InsetMathMBox::getText(int) const
{
return &text_;
}

View File

@ -17,7 +17,7 @@
#define MATH_MBOXINSET_H
#include "InsetMathDim.h"
#include "LyXText.h"
#include "Text.h"
namespace lyx {
@ -50,7 +50,7 @@ public:
int latex(Buffer const &, odocstream & os,
OutputParams const & runparams) const;
///
LyXText * getText(int) const;
Text * getText(int) const;
///
void cursorPos(BufferView const & bv, CursorSlice const & sl,
bool boundary, int & x, int & y) const;
@ -58,7 +58,7 @@ protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
///
mutable LyXText text_;
mutable Text text_;
private:
virtual std::auto_ptr<Inset> doClone() const;

View File

@ -44,7 +44,7 @@
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "gettext.h"
#include "LyXText.h"
#include "Text.h"
#include "OutputParams.h"
#include "Undo.h"
@ -915,7 +915,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
rdelim)));
}
// Don't call cur.undispatched() if we did nothing, this would
// lead to infinite recursion via LyXText::dispatch().
// lead to infinite recursion via Text::dispatch().
break;
}
@ -1144,7 +1144,7 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd)
} else if (cmd.button() == mouse_button::button2) {
MathData ar;
if (cap::selection()) {
// See comment in LyXText::dispatch why we do this
// See comment in Text::dispatch why we do this
cap::copySelectionToStack();
cmd = FuncRequest(LFUN_PASTE, "0");
doDispatch(cur, cmd);

View File

@ -14,7 +14,7 @@
#include "BufferParams.h"
#include "debug.h"
#include "LyXText.h"
#include "Text.h"
#include "Paragraph.h"
#include "ParagraphParameters.h"

View File

@ -65,7 +65,7 @@ bool refreshInside;
class RowPainter {
public:
/// initialise and run painter
RowPainter(PainterInfo & pi, LyXText const & text,
RowPainter(PainterInfo & pi, Text const & text,
pit_type pit, Row const & row, int x, int y);
// paint various parts
@ -99,8 +99,8 @@ private:
/// Painter to use
Painter & pain_;
/// LyXText for the row
LyXText const & text_;
/// Text for the row
Text const & text_;
TextMetrics & text_metrics_;
ParagraphList const & pars_;
@ -128,7 +128,7 @@ private:
RowPainter::RowPainter(PainterInfo & pi,
LyXText const & text, pit_type pit, Row const & row, int x, int y)
Text const & text, pit_type pit, Row const & row, int x, int y)
: bv_(*pi.base.bv), pain_(pi.pain), text_(text),
text_metrics_(pi.base.bv->textMetrics(&text)),
pars_(text.paragraphs()),
@ -841,7 +841,7 @@ void RowPainter::paintText()
bool CursorOnRow(PainterInfo & pi, pit_type const pit,
RowList::const_iterator rit, LyXText const & text)
RowList::const_iterator rit, Text const & text)
{
// Is there a cursor on this row (or inside inset on row)
Cursor & cur = pi.base.bv->cursor();
@ -858,7 +858,7 @@ bool CursorOnRow(PainterInfo & pi, pit_type const pit,
bool innerCursorOnRow(PainterInfo & pi, pit_type pit,
RowList::const_iterator rit, LyXText const & text)
RowList::const_iterator rit, Text const & text)
{
// Is there a cursor inside an inset on this row, and is this inset
// the only "character" on this row
@ -895,7 +895,7 @@ bool inNarrowInset(PainterInfo & pi)
void paintPar
(PainterInfo & pi, LyXText const & text, pit_type pit, int x, int y,
(PainterInfo & pi, Text const & text, pit_type pit, int x, int y,
bool repaintAll)
{
// lyxerr << " paintPar: pit: " << pit << " at y: " << y << endl;
@ -1009,7 +1009,7 @@ void paintText(BufferView & bv,
{
BOOST_ASSERT(bv.buffer());
Buffer const & buffer = *bv.buffer();
LyXText & text = buffer.text();
Text & text = buffer.text();
bool const select = bv.cursor().selection();
ViewMetricsInfo const & vi = bv.viewMetricsInfo();
@ -1051,7 +1051,7 @@ void paintText(BufferView & bv,
}
void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y)
void paintTextInset(Text const & text, PainterInfo & pi, int x, int y)
{
// lyxerr << " paintTextInset: y: " << y << endl;

View File

@ -18,7 +18,7 @@
namespace lyx {
class LyXText;
class Text;
class BufferView;
class PainterInfo;
class ViewMetricsInfo;
@ -29,7 +29,7 @@ namespace frontend { class Painter; }
void paintText(BufferView & bv, frontend::Painter & painter);
/// paint the rows of a text inset
void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y);
void paintTextInset(Text const & text, PainterInfo & pi, int x, int y);
/// some space for drawing the 'nested' markers (in pixel)
inline int nestMargin() { return 15; }

View File

@ -16,7 +16,7 @@
#include "Buffer.h"
#include "BufferParams.h"
#include "Counters.h"
#include "LyXText.h"
#include "Text.h"
#include "OutputParams.h"
#include "Paragraph.h"

View File

@ -17,7 +17,7 @@
#include "Buffer.h"
#include "BufferParams.h"
#include "FuncRequest.h"
#include "LyXText.h"
#include "Text.h"
#include "LyXAction.h"
#include "Paragraph.h"
#include "ParIterator.h"