From 5d41611407a908b90f436ec0cfcdf729c3e27c51 Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Thu, 1 Feb 2007 19:27:37 +0000 Subject: [PATCH] * 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 --- src/BufferView.C | 18 +----------------- src/BufferView.h | 6 ------ src/factory.C | 4 ++-- src/frontends/WorkArea.C | 2 +- src/lyx_cb.C | 6 +++--- src/lyxfunc.C | 2 +- src/mathed/InsetMathHull.C | 2 +- src/mathed/InsetMathNest.C | 4 ++-- 8 files changed, 11 insertions(+), 33 deletions(-) diff --git a/src/BufferView.C b/src/BufferView.C index 0490cb2b21..8771f0d2e5 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -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(this)->textMetrics(t); diff --git a/src/BufferView.h b/src/BufferView.h index 103d4d10b7..357e33e8cb 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -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); diff --git a/src/factory.C b/src/factory.C index 5f08b9dfb0..1909285996 100644 --- a/src/factory.C +++ b/src/factory.C @@ -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); } diff --git a/src/frontends/WorkArea.C b/src/frontends/WorkArea.C index abe266cd79..51c28c6974 100644 --- a/src/frontends/WorkArea.C +++ b/src/frontends/WorkArea.C @@ -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; diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 896f1a99b2..f40c18d1e4 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -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); } diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 1d0a8b49b9..faa3f42d4f 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -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(); diff --git a/src/mathed/InsetMathHull.C b/src/mathed/InsetMathHull.C index dc6391c595..55a51dc0ff 100644 --- a/src/mathed/InsetMathHull.C +++ b/src/mathed/InsetMathHull.C @@ -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) diff --git a/src/mathed/InsetMathNest.C b/src/mathed/InsetMathNest.C index 3dbf73ccb9..fa5edce18f 100644 --- a/src/mathed/InsetMathNest.C +++ b/src/mathed/InsetMathNest.C @@ -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; -- 2.39.2