removed unused code

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@708 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-04-29 00:47:16 +00:00
parent 7249746cf6
commit 41878b0abf
7 changed files with 3 additions and 204 deletions

View File

@ -244,14 +244,6 @@ void BufferView::update(signed char f)
}
#if 0
void BufferView::smallUpdate(signed char f)
{
pimpl_->smallUpdate(f);
}
#endif
void BufferView::setState()
{
pimpl_->setState();

View File

@ -48,10 +48,6 @@ public:
void update();
///
void update(signed char f);
#if 0
///
void smallUpdate(signed char f);
#endif
///
void updateScrollbar();
///

View File

@ -1192,38 +1192,6 @@ void BufferView::Pimpl::update(signed char f)
}
#if 0
void BufferView::Pimpl::smallUpdate(signed char f)
{
#if 1
update(f);
#else
screen->SmallUpdate();
if (screen->TopCursorVisible()
!= screen->first) {
update(f);
return;
}
fitCursor();
//updateScrollbar();
if (!bv_->text->selection)
bv_->text->sel_cursor = bv_->text->cursor;
if (f == 1 || f == -1) {
if (buffer_->isLyxClean()) {
buffer_->markDirty();
owner_->getMiniBuffer()->setTimer(4);
} else {
buffer_->markDirty();
}
}
#endif
}
#endif
// Callback for cursor timer
void BufferView::Pimpl::cursorToggle()
{

View File

@ -38,10 +38,6 @@ struct BufferView::Pimpl {
void update();
///
void update(signed char f);
#if 0
///
void smallUpdate(signed char f);
#endif
///
void gotoError();
/// Update pixmap of screen

View File

@ -1658,11 +1658,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_BREAKLINE:
owner->view()->beforeChange();
owner->view()->text->InsertChar(LyXParagraph::META_NEWLINE);
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
SetUpdateTimer(0.01);
moveCursorUpdate(false);
break;
@ -1704,11 +1700,7 @@ string LyXFunc::Dispatch(int ac,
owner->view()->text->Delete();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
// It is possible to make it a lot faster still
// just comment out the lone below...
owner->view()->showCursor();
@ -1751,21 +1743,13 @@ string LyXFunc::Dispatch(int ac,
owner->view()->text->Delete();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
}
} else {
owner->view()->text->Delete();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
}
} else {
owner->view()->cut();
@ -1833,11 +1817,7 @@ string LyXFunc::Dispatch(int ac,
owner->view()->text->Backspace();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
// It is possible to make it a lot faster still
// just comment out the lone below...
owner->view()->showCursor();
@ -1875,11 +1855,7 @@ string LyXFunc::Dispatch(int ac,
owner->view()->text->Backspace();
owner->view()->text->sel_cursor
= cursor;
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate (1);
#endif
}
} else
owner->view()->cut();
@ -1891,11 +1867,7 @@ string LyXFunc::Dispatch(int ac,
{
owner->view()->beforeChange();
owner->view()->text->BreakParagraph(0);
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
SetUpdateTimer(0.01);
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
@ -1908,11 +1880,7 @@ string LyXFunc::Dispatch(int ac,
{
owner->view()->beforeChange();
owner->view()->text->BreakParagraph(1);
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
SetUpdateTimer(0.01);
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
@ -1945,11 +1913,7 @@ string LyXFunc::Dispatch(int ac,
}
else {
owner->view()->text->BreakParagraph(0);
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
}
SetUpdateTimer(0.01);
owner->view()->text->sel_cursor = cursor;
@ -2009,11 +1973,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_QUOTE:
owner->view()->beforeChange();
owner->view()->text->InsertChar('\"'); // This " matches the single quote in the code
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
SetUpdateTimer();
moveCursorUpdate(false);
break;
@ -2192,12 +2152,10 @@ string LyXFunc::Dispatch(int ac,
case LFUN_CIRCLE:
case LFUN_OGONEK:
{
char c;
char c = 0;
if (keyseq.length == -1 && keyseq.getiso() != 0)
c = keyseq.getiso();
else
c = 0;
owner->getIntl()->getTrans()->
deadkey(c, get_accent(action).accent,
@ -2209,11 +2167,8 @@ string LyXFunc::Dispatch(int ac,
keyseq.length = 0;
// copied verbatim from do_accent_char
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
SetUpdateTimer();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
@ -2567,11 +2522,7 @@ string LyXFunc::Dispatch(int ac,
owner->view()->text->InsertChar(argument[i]);
// This needs to be in the loop, or else we
// won't break lines correctly. (Asger)
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
}
SetUpdateTimer();
owner->view()->text->sel_cursor =
@ -2609,11 +2560,7 @@ string LyXFunc::Dispatch(int ac,
datetmp_len = (int) strftime(datetmp, 32, arg.c_str(), now_tm);
for (int i = 0; i < datetmp_len; i++) {
owner->view()->text->InsertChar(datetmp[i]);
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
}
SetUpdateTimer();
owner->view()->text->sel_cursor = owner->view()->text->cursor;
@ -2668,11 +2615,7 @@ string LyXFunc::Dispatch(int ac,
owner->getIntl()->getTrans()->TranslateAndInsert(argument[i], owner->view()->text);
}
#if 1
owner->view()->update(1);
#else
owner->view()->smallUpdate(1);
#endif
SetUpdateTimer();
owner->view()->text->sel_cursor =

View File

@ -79,11 +79,6 @@ public:
we only update the current row. */
void Update();
#if 0
/** Updates part of the screen. Updates till row with cursor,
or only current row */
void SmallUpdate();
#endif
/// first visible pixel-row
unsigned long first;
@ -96,13 +91,8 @@ private:
/// y1 and y2 are coordinates of the screen
void DrawFromTo(int y1, int y2);
#if 1
/// y is a coordinate of the text
void DrawOneRow(Row * row, long y_text);
#else
/// y is a coordinate of the text
void DrawOneRow(Row * row, long & y_text);
#endif
///
WorkArea & owner;

View File

@ -114,28 +114,15 @@ void LyXScreen::DrawFromTo(int y1, int y2)
}
#if 1
void LyXScreen::DrawOneRow(Row * row, long y_text)
{
long y = y_text - first;
if (y + row->height > 0 && y - row->height <= long(owner.height())) {
/* ok there is something visible */
// ok there is something visible
text->GetVisibleRow(y, row, y + first);
}
}
#else
void LyXScreen::DrawOneRow(Row * row, long & y_text)
{
long y = y_text - first;
if (y + row->height > 0 && y - row->height <= long(owner.height())) {
/* ok there is something visible */
text->GetVisibleRow(y, row, y + first);
}
y_text += row->height;
}
#endif
/* draws the screen, starting with textposition y. uses as much already
@ -391,7 +378,6 @@ bool LyXScreen::FitCursor()
void LyXScreen::Update()
{
#if 1
switch(text->status) {
case LyXText::NEED_MORE_REFRESH:
{
@ -417,81 +403,9 @@ void LyXScreen::Update()
// Nothing needs done
break;
}
#else
if (text->status == LyXText::NEED_MORE_REFRESH
|| screen_refresh_y > -1 ) {
long y = 0;
if (screen_refresh_y > -1
&& screen_refresh_y < text->refresh_y)
y = screen_refresh_y;
else
y = text->refresh_y;
//if (y < first) y = first;
y = max(y, long(first));
DrawFromTo(y - first, owner.height());
text->refresh_y = 0;
text->status = LyXText::UNCHANGED;
screen_refresh_y = -1;
expose(0, y - first,
owner.workWidth(), owner.height() - (y - first));
} else if (text->status == LyXText::NEED_VERY_LITTLE_REFRESH) {
/* ok I will update the current cursor row */
long y = text->refresh_y;
DrawOneRow(text->refresh_row, y);
text->status = LyXText::UNCHANGED;
expose(0, text->refresh_y - first,
owner.workWidth(), text->refresh_row->height);
}
#endif
}
#if 0
void LyXScreen::SmallUpdate()
{
#if 1
Update();
#else
if (text->status == LyXText::NEED_MORE_REFRESH) {
/* ok I will update till the current cursor row */
Row * row = text->refresh_row;
long y = text->refresh_y;
long y2 = y;
if (y > long(text->cursor.y)) {
Update();
return;
}
while (row
&& row != text->cursor.row
&& y < long(first + owner.height())) {
DrawOneRow(row, y);
row = row->next;
}
DrawOneRow(row, y);
screen_refresh_y = y;
screen_refresh_row = row->next;
text->status = LyXText::UNCHANGED;
// Is the right regin exposed?
expose(0, y2 - first,
owner.workWidth(), y - y2);
} else if (text->status == LyXText::NEED_VERY_LITTLE_REFRESH) {
/* ok I will update the current cursor row */
long y = text->refresh_y;
DrawOneRow(text->refresh_row, y);
text->status = LyXText::UNCHANGED;
expose(0, text->refresh_y - first,
owner.workWidth(), text->refresh_row->height);
}
#endif
}
#endif
void LyXScreen::ToggleSelection(bool kill_selection)
{
/* only if there is a selection */