mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 22:14:35 +00:00
delete unused variables.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16443 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ceb51f7f76
commit
ad84c0ce5d
@ -577,7 +577,6 @@ void BufferView::center()
|
|||||||
CursorSlice & bot = cursor_.bottom();
|
CursorSlice & bot = cursor_.bottom();
|
||||||
TextMetrics & tm = text_metrics_[bot.text()];
|
TextMetrics & tm = text_metrics_[bot.text()];
|
||||||
pit_type const pit = bot.pit();
|
pit_type const pit = bot.pit();
|
||||||
int max_width = workWidth();
|
|
||||||
tm.redoParagraph(pit);
|
tm.redoParagraph(pit);
|
||||||
ParagraphMetrics const & pm = tm.parMetrics(pit);
|
ParagraphMetrics const & pm = tm.parMetrics(pit);
|
||||||
anchor_ref_ = pit;
|
anchor_ref_ = pit;
|
||||||
|
@ -185,8 +185,10 @@ public:
|
|||||||
void recUndo(LCursor & cur, pit_type first, pit_type last) const;
|
void recUndo(LCursor & cur, pit_type first, pit_type last) const;
|
||||||
///
|
///
|
||||||
void recUndo(LCursor & cur, pit_type first) const;
|
void recUndo(LCursor & cur, pit_type first) const;
|
||||||
/// returns true if par was empty and was removed
|
|
||||||
bool setCursorFromCoordinates(LCursor & cur, int x, int y);
|
/// sets cursor only within this LyXText.
|
||||||
|
/// x,y are screen coordinates
|
||||||
|
void setCursorFromCoordinates(LCursor & cur, int x, int y);
|
||||||
|
|
||||||
/// sets cursor recursively descending into nested editable insets
|
/// sets cursor recursively descending into nested editable insets
|
||||||
/**
|
/**
|
||||||
|
@ -138,8 +138,6 @@ RowPainter::RowPainter(PainterInfo & pi,
|
|||||||
erased_(pi.erased_),
|
erased_(pi.erased_),
|
||||||
xo_(x), yo_(y), width_(text_metrics_.width())
|
xo_(x), yo_(y), width_(text_metrics_.width())
|
||||||
{
|
{
|
||||||
Buffer const & buffer = *bv_.buffer();
|
|
||||||
int const right_margin = text_metrics_.rightMargin(pm_);
|
|
||||||
RowMetrics m = text_metrics_.computeRowMetrics(pit_, row_);
|
RowMetrics m = text_metrics_.computeRowMetrics(pit_, row_);
|
||||||
x_ = m.x + xo_;
|
x_ = m.x + xo_;
|
||||||
|
|
||||||
|
@ -2070,9 +2070,7 @@ pos_type LyXText::x2pos(BufferView const & bv, pit_type pit, int row,
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
// x,y are screen coordinates
|
void LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
|
||||||
// sets cursor only within this LyXText
|
|
||||||
bool LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
|
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(this == cur.text());
|
BOOST_ASSERT(this == cur.text());
|
||||||
pit_type pit = getPitNearY(cur.bv(), y);
|
pit_type pit = getPitNearY(cur.bv(), y);
|
||||||
@ -2117,7 +2115,8 @@ bool LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
|
|||||||
<< " pos: " << pos
|
<< " pos: " << pos
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
return setCursor(cur, pit, pos, true, bound);
|
setCursor(cur, pit, pos, true, bound);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
10
src/text2.C
10
src/text2.C
@ -759,7 +759,6 @@ pos_type LyXText::getColumnNearX(BufferView const & bv, int right_margin,
|
|||||||
TextMetrics const & tm = bv.textMetrics(this);
|
TextMetrics const & tm = bv.textMetrics(this);
|
||||||
int const xo = bv.coordCache().get(this, pit).x_;
|
int const xo = bv.coordCache().get(this, pit).x_;
|
||||||
x -= xo;
|
x -= xo;
|
||||||
int max_witdh = tm.maxWidth();
|
|
||||||
RowMetrics const r = tm.computeRowMetrics(pit, row);
|
RowMetrics const r = tm.computeRowMetrics(pit, row);
|
||||||
Paragraph const & par = pars_[pit];
|
Paragraph const & par = pars_[pit];
|
||||||
|
|
||||||
@ -910,7 +909,6 @@ pit_type LyXText::getPitNearY(BufferView & bv, int y)
|
|||||||
|
|
||||||
TextMetrics & tm = bv.textMetrics(this);
|
TextMetrics & tm = bv.textMetrics(this);
|
||||||
ParagraphMetrics const & pm = tm.parMetrics(it->first);
|
ParagraphMetrics const & pm = tm.parMetrics(it->first);
|
||||||
int max_width = tm.maxWidth();
|
|
||||||
|
|
||||||
// If we are off-screen (before the visible part)
|
// If we are off-screen (before the visible part)
|
||||||
if (y < 0
|
if (y < 0
|
||||||
@ -972,7 +970,6 @@ pit_type LyXText::getPitNearY(BufferView & bv, int y)
|
|||||||
|
|
||||||
Row const & LyXText::getRowNearY(BufferView const & bv, int y, pit_type pit) const
|
Row const & LyXText::getRowNearY(BufferView const & bv, int y, pit_type pit) const
|
||||||
{
|
{
|
||||||
Paragraph const & par = pars_[pit];
|
|
||||||
ParagraphMetrics const & pm = bv.parMetrics(this, pit);
|
ParagraphMetrics const & pm = bv.parMetrics(this, pit);
|
||||||
|
|
||||||
int yy = bv.coordCache().get(this, pit).y_ - pm.ascent();
|
int yy = bv.coordCache().get(this, pit).y_ - pm.ascent();
|
||||||
@ -1002,7 +999,6 @@ InsetBase * LyXText::editXY(LCursor & cur, int x, int y)
|
|||||||
|
|
||||||
TextMetrics const & tm = cur.bv().textMetrics(this);
|
TextMetrics const & tm = cur.bv().textMetrics(this);
|
||||||
ParagraphMetrics const & pm = tm.parMetrics(pit);
|
ParagraphMetrics const & pm = tm.parMetrics(pit);
|
||||||
Buffer const & buffer = cur.buffer();
|
|
||||||
int right_margin = tm.rightMargin(pm);
|
int right_margin = tm.rightMargin(pm);
|
||||||
int xx = x; // is modified by getColumnNearX
|
int xx = x; // is modified by getColumnNearX
|
||||||
pos_type const pos = row.pos()
|
pos_type const pos = row.pos()
|
||||||
@ -1070,13 +1066,15 @@ bool LyXText::cursorLeft(LCursor & cur)
|
|||||||
return setCursor(cur, cur.pit(), cur.pos(), true, true);
|
return setCursor(cur, cur.pit(), cur.pos(), true, true);
|
||||||
}
|
}
|
||||||
if (cur.pos() != 0) {
|
if (cur.pos() != 0) {
|
||||||
bool boundary = cur.boundary();
|
|
||||||
bool updateNeeded = setCursor(cur, cur.pit(), cur.pos() - 1, true, false);
|
bool updateNeeded = setCursor(cur, cur.pit(), cur.pos() - 1, true, false);
|
||||||
if (!checkAndActivateInset(cur, false)) {
|
if (!checkAndActivateInset(cur, false)) {
|
||||||
|
/** FIXME: What's this cause purpose???
|
||||||
|
bool boundary = cur.boundary();
|
||||||
if (false && !boundary &&
|
if (false && !boundary &&
|
||||||
bidi.isBoundary(cur.buffer(), cur.paragraph(), cur.pos() + 1))
|
bidi.isBoundary(cur.buffer(), cur.paragraph(), cur.pos() + 1))
|
||||||
updateNeeded |=
|
updateNeeded |=
|
||||||
setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
|
setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
return updateNeeded;
|
return updateNeeded;
|
||||||
}
|
}
|
||||||
@ -1126,7 +1124,6 @@ bool LyXText::cursorUp(LCursor & cur)
|
|||||||
// Tell BufferView to test for FitCursor in any case!
|
// Tell BufferView to test for FitCursor in any case!
|
||||||
cur.updateFlags(Update::FitCursor);
|
cur.updateFlags(Update::FitCursor);
|
||||||
|
|
||||||
Paragraph const & par = cur.paragraph();
|
|
||||||
ParagraphMetrics const & pm = cur.bv().parMetrics(this, cur.pit());
|
ParagraphMetrics const & pm = cur.bv().parMetrics(this, cur.pit());
|
||||||
|
|
||||||
int row;
|
int row;
|
||||||
@ -1181,7 +1178,6 @@ bool LyXText::cursorDown(LCursor & cur)
|
|||||||
// Tell BufferView to test for FitCursor in any case!
|
// Tell BufferView to test for FitCursor in any case!
|
||||||
cur.updateFlags(Update::FitCursor);
|
cur.updateFlags(Update::FitCursor);
|
||||||
|
|
||||||
Paragraph const & par = cur.paragraph();
|
|
||||||
ParagraphMetrics const & pm = cur.bv().parMetrics(this, cur.pit());
|
ParagraphMetrics const & pm = cur.bv().parMetrics(this, cur.pit());
|
||||||
|
|
||||||
int row;
|
int row;
|
||||||
|
@ -205,9 +205,7 @@ void LyXText::cursorPrevious(LCursor & cur)
|
|||||||
pit_type cpar = cur.pit();
|
pit_type cpar = cur.pit();
|
||||||
|
|
||||||
int x = cur.x_target();
|
int x = cur.x_target();
|
||||||
|
setCursorFromCoordinates(cur, x, 0);
|
||||||
// FIXME: there would maybe a need for this 'updated' boolean in the future...
|
|
||||||
bool updated = setCursorFromCoordinates(cur, x, 0);
|
|
||||||
cur.dispatch(FuncRequest(cur.selection()? LFUN_UP_SELECT: LFUN_UP));
|
cur.dispatch(FuncRequest(cur.selection()? LFUN_UP_SELECT: LFUN_UP));
|
||||||
|
|
||||||
if (cpar == cur.pit() && cpos == cur.pos())
|
if (cpar == cur.pit() && cpos == cur.pos())
|
||||||
@ -226,8 +224,7 @@ void LyXText::cursorNext(LCursor & cur)
|
|||||||
pit_type cpar = cur.pit();
|
pit_type cpar = cur.pit();
|
||||||
|
|
||||||
int x = cur.x_target();
|
int x = cur.x_target();
|
||||||
// FIXME: there would maybe a need for this 'updated' boolean in the future...
|
setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1);
|
||||||
bool updated = setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1);
|
|
||||||
cur.dispatch(FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN));
|
cur.dispatch(FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN));
|
||||||
|
|
||||||
if (cpar == cur.pit() && cpos == cur.pos())
|
if (cpar == cur.pit() && cpos == cur.pos())
|
||||||
|
Loading…
Reference in New Issue
Block a user