* BufferView.C:

* BufferView.h:
	* lyxfunc.C:
	* factory.C:
	* mathed/InsetMathNest.C:
	* mathed/InsetMathHull.C:
	* lyx_cb.C:
	* frontends/WorkArea.C: remove BufferView::getLyXText() methods, because their
	names were absolutely misleading; resolve indirection where needed


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17016 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Michael Schmitt 2007-02-01 19:27:37 +00:00
parent 340358ab90
commit 5d41611407
8 changed files with 11 additions and 33 deletions

View File

@ -598,7 +598,7 @@ void BufferView::switchKeyMap()
if (!lyxrc.rtl_support)
return;
if (getLyXText()->real_current_font.isRightToLeft()) {
if (cursor_.innerText()->real_current_font.isRightToLeft()) {
if (intl_->keymap == Intl::PRIMARY)
intl_->keyMapSec();
} else {
@ -1223,22 +1223,6 @@ void BufferView::gotoLabel(docstring const & label)
}
LyXText * BufferView::getLyXText()
{
LyXText * text = cursor_.innerText();
BOOST_ASSERT(text);
return text;
}
LyXText const * BufferView::getLyXText() const
{
LyXText const * text = cursor_.innerText();
BOOST_ASSERT(text);
return text;
}
TextMetrics const & BufferView::textMetrics(LyXText const * t) const
{
return const_cast<BufferView *>(this)->textMetrics(t);

View File

@ -125,12 +125,6 @@ public:
/// return the current change at the cursor.
Change const getCurrentChange() const;
/// return the lyxtext we are using.
LyXText * getLyXText();
/// return the lyxtext we are using.
LyXText const * getLyXText() const;
/// move cursor to the named label.
void gotoLabel(docstring const & label);

View File

@ -173,7 +173,7 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
// Try and generate a valid index entry.
InsetCommandParams icp("index");
icp["name"] = cmd.argument().empty() ?
bv->getLyXText()->getStringToIndex(bv->cursor()) :
bv->cursor().innerText()->getStringToIndex(bv->cursor()) :
cmd.argument();
return new InsetIndex(icp);
}
@ -181,7 +181,7 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
case LFUN_NOMENCL_INSERT: {
InsetCommandParams icp("nomenclature");
icp["symbol"] = cmd.argument().empty() ?
bv->getLyXText()->getStringToIndex(bv->cursor()) :
bv->cursor().innerText()->getStringToIndex(bv->cursor()) :
cmd.argument();
return new InsetNomencl(icp);
}

View File

@ -276,7 +276,7 @@ void WorkArea::showCursor()
CursorShape shape = BAR_SHAPE;
LyXText const & text = *buffer_view_->getLyXText();
LyXText const & text = *buffer_view_->cursor().innerText();
LyXFont const & realfont = text.real_current_font;
BufferParams const & bp = buffer_view_->buffer()->params();
bool const samelang = realfont.language() == bp.language;

View File

@ -331,12 +331,12 @@ void insertPlaintextFile(BufferView * bv, string const & f, bool asParagraph)
// clear the selection
LyXText const & text = bv->buffer()->text();
if (&text == bv->getLyXText())
if (&text == bv->cursor().innerText())
bv->cursor().clearSelection();
if (asParagraph)
bv->getLyXText()->insertStringAsParagraphs(bv->cursor(), tmpstr);
bv->cursor().innerText()->insertStringAsParagraphs(bv->cursor(), tmpstr);
else
bv->getLyXText()->insertStringAsLines(bv->cursor(), tmpstr);
bv->cursor().innerText()->insertStringAsLines(bv->cursor(), tmpstr);
}

View File

@ -232,7 +232,7 @@ void LyXFunc::handleKeyFunc(kb_action action)
c = 0;
lyx_view_->view()->getIntl().getTransManager().deadkey(
c, get_accent(action).accent, view()->getLyXText(), view()->cursor());
c, get_accent(action).accent, view()->cursor().innerText(), view()->cursor());
// Need to clear, in case the minibuffer calls these
// actions
keyseq->clear();

View File

@ -1273,7 +1273,7 @@ void InsetMathHull::mutateToText()
string str = os.str();
// insert this text
LyXText * lt = view_->getLyXText();
LyXText * lt = view_->cursor().innerText();
string::const_iterator cit = str.begin();
string::const_iterator end = str.end();
for (; cit != end; ++cit)

View File

@ -667,7 +667,7 @@ void InsetMathNest::doDispatch(LCursor & cur, FuncRequest & cmd)
// if the inset can not be removed from within, delete it
if (!cur.backspace()) {
FuncRequest cmd = FuncRequest(LFUN_CHAR_DELETE_FORWARD);
cur.bv().getLyXText()->dispatch(cur, cmd);
cur.bv().cursor().innerText()->dispatch(cur, cmd);
}
break;
@ -681,7 +681,7 @@ void InsetMathNest::doDispatch(LCursor & cur, FuncRequest & cmd)
// if the inset can not be removed from within, delete it
if (!cur.erase()) {
FuncRequest cmd = FuncRequest(LFUN_CHAR_DELETE_FORWARD);
cur.bv().getLyXText()->dispatch(cur, cmd);
cur.bv().cursor().innerText()->dispatch(cur, cmd);
}
break;