mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
remove a few rarely neede LyXTExt member functions
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8499 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
5198e1d9a3
commit
9e78fe66de
@ -267,7 +267,9 @@ bool BufferView::insertLyXFile(string const & filen)
|
||||
cursor().clearSelection();
|
||||
text()->breakParagraph(cursor());
|
||||
|
||||
bool res = buffer()->readFile(fname, text()->cursorPar());
|
||||
BOOST_ASSERT(cursor().inTexted());
|
||||
LyXText * text = cursor().text();
|
||||
bool res = buffer()->readFile(fname, text->getPar(cursor().par()));
|
||||
resize();
|
||||
return res;
|
||||
}
|
||||
|
@ -616,9 +616,10 @@ void BufferView::Pimpl::savePosition(unsigned int i)
|
||||
{
|
||||
if (i >= saved_positions_num)
|
||||
return;
|
||||
BOOST_ASSERT(bv_->cursor().inTexted());
|
||||
saved_positions[i] = Position(buffer_->fileName(),
|
||||
bv_->text()->cursorPar()->id(),
|
||||
bv_->text()->cursor().pos());
|
||||
bv_->cursor().paragraph().id(),
|
||||
bv_->cursor().pos());
|
||||
if (i > 0)
|
||||
owner_->message(bformat(_("Saved bookmark %1$s"), tostr(i)));
|
||||
}
|
||||
|
@ -38,9 +38,11 @@ PosIterator::PosIterator(ParagraphList * pl, ParagraphList::iterator pit,
|
||||
|
||||
PosIterator::PosIterator(BufferView & bv)
|
||||
{
|
||||
LyXText * text = bv.getLyXText();
|
||||
lyx::pos_type pos = text->cursor().pos();
|
||||
ParagraphList::iterator pit = text->cursorPar();
|
||||
LCursor & cur = bv.cursor();
|
||||
BOOST_ASSERT(cur.inTexted());
|
||||
LyXText * text = cur.text();
|
||||
lyx::pos_type pos = cur.pos();
|
||||
ParagraphList::iterator pit = text->getPar(cur.par());
|
||||
|
||||
ParIterator par = bv.buffer()->par_iterator_begin();
|
||||
ParIterator end = bv.buffer()->par_iterator_end();
|
||||
|
@ -92,9 +92,6 @@ public:
|
||||
/// Returns whether something would be changed by changeDepth
|
||||
bool changeDepthAllowed(LCursor & cur, bv_funcs::DEPTH_CHANGE type);
|
||||
|
||||
/// get the depth at current cursor position
|
||||
int getDepth() const;
|
||||
|
||||
/// Set font over selection paragraphs and rebreak.
|
||||
void setFont(LCursor & cur, LyXFont const &, bool toggleall = false);
|
||||
|
||||
@ -145,8 +142,6 @@ public:
|
||||
ParagraphList::iterator getPar(par_type par) const;
|
||||
///
|
||||
int parOffset(ParagraphList::iterator pit) const;
|
||||
/// # FIXME: should not be used
|
||||
ParagraphList::iterator cursorPar() const;
|
||||
// Returns the current font and depth as a message.
|
||||
std::string LyXText::currentState(LCursor & cur);
|
||||
|
||||
@ -372,11 +367,7 @@ public:
|
||||
///
|
||||
int cursorY(CursorSlice const & cursor) const;
|
||||
|
||||
/// the current cursor slice
|
||||
CursorSlice & cursor();
|
||||
/// the current cursor slice
|
||||
CursorSlice const & cursor() const;
|
||||
|
||||
///
|
||||
friend class LyXScreen;
|
||||
|
||||
///
|
||||
|
43
src/text.C
43
src/text.C
@ -1294,7 +1294,7 @@ void LyXText::changeCase(LCursor & cur, LyXText::TextCase action)
|
||||
from = cur.selBegin();
|
||||
to = cur.selEnd();
|
||||
} else {
|
||||
from = cursor();
|
||||
from = cur.top();
|
||||
getWord(from, to, lyx::PARTIAL_WORD);
|
||||
setCursor(cur, to.par(), to.pos() + 1);
|
||||
}
|
||||
@ -1436,14 +1436,6 @@ void LyXText::backspace(LCursor & cur)
|
||||
}
|
||||
|
||||
|
||||
ParagraphList::iterator LyXText::cursorPar() const
|
||||
{
|
||||
//lyxerr << "### cursorPar: cursor: " << bv()->cursor() << endl;
|
||||
//lyxerr << "xxx cursorPar: cursor: " << cursor() << endl;
|
||||
return getPar(cursor().par());
|
||||
}
|
||||
|
||||
|
||||
ParagraphList::iterator LyXText::getPar(CursorSlice const & cur) const
|
||||
{
|
||||
return getPar(cur.par());
|
||||
@ -1495,12 +1487,6 @@ LyXText::getRowNearY(int y, ParagraphList::iterator & pit) const
|
||||
}
|
||||
|
||||
|
||||
int LyXText::getDepth() const
|
||||
{
|
||||
return cursorPar()->getDepth();
|
||||
}
|
||||
|
||||
|
||||
RowList::iterator LyXText::firstRow() const
|
||||
{
|
||||
return paragraphs().front().rows.begin();
|
||||
@ -1874,31 +1860,6 @@ int LyXText::cursorY(CursorSlice const & cur) const
|
||||
}
|
||||
|
||||
|
||||
CursorSlice & LyXText::cursor()
|
||||
{
|
||||
//lyxerr << "# accessing slice " << findText(this) << endl;
|
||||
if (this != bv()->cursor().text()) {
|
||||
lyxerr << "cursor: " << bv()->cursor()
|
||||
<< "\ntext: " << bv()->cursor().text()
|
||||
<< "\nthis: " << this << endl;
|
||||
BOOST_ASSERT(false);
|
||||
}
|
||||
return bv()->cursor().top();
|
||||
}
|
||||
|
||||
|
||||
CursorSlice const & LyXText::cursor() const
|
||||
{
|
||||
if (this != bv()->cursor().text()) {
|
||||
lyxerr << "cursor: " << bv()->cursor()
|
||||
<< "\ntext: " << bv()->cursor().text()
|
||||
<< "\nthis: " << this << endl;
|
||||
BOOST_ASSERT(false);
|
||||
}
|
||||
return bv()->cursor().top();
|
||||
}
|
||||
|
||||
|
||||
void LyXText::replaceSelection(LCursor & cur)
|
||||
{
|
||||
BOOST_ASSERT(this == cur.text());
|
||||
@ -1944,7 +1905,7 @@ string LyXText::currentState(LCursor & cur)
|
||||
// os << bformat(_("Font: %1$s"), font.stateText(&buffer->params));
|
||||
|
||||
// The paragraph depth
|
||||
int depth = getDepth();
|
||||
int depth = cur.paragraph().getDepth();
|
||||
if (depth > 0)
|
||||
os << bformat(_(", Depth: %1$s"), tostr(depth));
|
||||
|
||||
|
@ -1036,7 +1036,7 @@ void LyXText::insertStringAsLines(LCursor & cur, string const & str)
|
||||
{
|
||||
ParagraphList::iterator pit = getPar(cur.par());
|
||||
ParagraphList::iterator endpit = boost::next(pit);
|
||||
pos_type pos = cursor().pos();
|
||||
pos_type pos = cur.pos();
|
||||
recordUndo(cur);
|
||||
|
||||
// only to be sure, should not be neccessary
|
||||
|
@ -265,7 +265,7 @@ void LyXText::gotoInset(LCursor & cur,
|
||||
cur.par() = 0;
|
||||
cur.pos() = 0;
|
||||
if (!gotoNextInset(cur, codes, contents)) {
|
||||
cursor() = tmp;
|
||||
cur.top() = tmp;
|
||||
cur.message(_("No more insets"));
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user