move 42, kill 12

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5120 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-08-27 14:43:49 +00:00
parent 38fd440edb
commit 527cd00d2f
5 changed files with 39 additions and 50 deletions

View File

@ -230,9 +230,3 @@ bool BufferView::dispatch(FuncRequest const & ev)
{
return pimpl_->dispatch(ev);
}
void BufferView::moveCursorUpdate(bool selecting, bool fitcur)
{
pimpl_->moveCursorUpdate(selecting, fitcur);
}

View File

@ -190,8 +190,6 @@ public:
void stuffClipboard(string const &) const;
///
bool dispatch(FuncRequest const & argument);
///
void moveCursorUpdate(bool selecting, bool fitcur = true);
private:
///
struct Pimpl;

View File

@ -1227,36 +1227,6 @@ void BufferView::Pimpl::stuffClipboard(string const & stuff) const
*/
void BufferView::Pimpl::moveCursorUpdate(bool selecting, bool fitcur)
{
LyXText * lt = bv_->getLyXText();
if (selecting || lt->selection.mark()) {
lt->setSelection(bv_);
if (lt->bv_owner)
toggleToggle();
else
updateInset(lt->inset_owner, false);
}
if (lt->bv_owner) {
if (fitcur)
update(lt, BufferView::SELECT|BufferView::FITCUR);
else
update(lt, BufferView::SELECT);
showCursor();
} else if (bv_->text->status() != LyXText::UNCHANGED) {
bv_->theLockingInset()->hideInsetCursor(bv_);
update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
showCursor();
}
if (!lt->selection.set())
workarea().haveSelection(false);
switchKeyMap();
}
Inset * BufferView::Pimpl::getInsetByCode(Inset::Code code)
{
#if 0

View File

@ -173,8 +173,6 @@ private:
};
///
std::vector<Position> saved_positions;
///
void moveCursorUpdate(bool selecting, bool fitcur = true);
/// Get next inset of this class from current cursor position
Inset * getInsetByCode(Inset::Code code);
///

View File

@ -42,10 +42,40 @@ extern string current_layout;
namespace {
void finishChange(BufferView * bv, bool fitcur = false)
void moveCursorUpdate(BufferView * bv, bool selecting)
{
LyXText * lt = bv->getLyXText();
if (selecting || lt->selection.mark()) {
lt->setSelection(bv);
if (lt->bv_owner)
bv->toggleToggle();
else
bv->updateInset(lt->inset_owner, false);
}
if (lt->bv_owner) {
//if (fitcur)
// bv->update(lt, BufferView::SELECT|BufferView::FITCUR);
//else
bv->update(lt, BufferView::SELECT);
bv->showCursor();
} else if (bv->text->status() != LyXText::UNCHANGED) {
bv->theLockingInset()->hideInsetCursor(bv);
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
bv->showCursor();
}
if (!lt->selection.set())
bv->workarea().haveSelection(false);
bv->switchKeyMap();
}
void finishChange(BufferView * bv, bool selecting = false)
{
finishUndo();
bv->moveCursorUpdate(fitcur);
moveCursorUpdate(bv, selecting);
bv->owner()->view_state_changed();
}
@ -523,7 +553,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
finishChange(bv, false);
// was:
// finishUndo();
// moveCursorUpdate(false, false);
// moveCursorUpdate(bv, false, false);
// owner_->view_state_changed();
break;
@ -556,7 +586,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
insertChar(bv, Paragraph::META_NEWLINE);
update(bv, true);
setCursor(bv, cursor.par(), cursor.pos());
bv->moveCursorUpdate(false);
moveCursorUpdate(bv, false);
break;
case LFUN_DELETE:
@ -572,7 +602,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
cutSelection(bv, true);
update(bv);
}
bv->moveCursorUpdate(false);
moveCursorUpdate(bv, false);
bv->owner()->view_state_changed();
bv->switchKeyMap();
break;
@ -769,7 +799,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
} else {
specialChar(this, bv, InsetSpecialChar::PROTECTED_SEPARATOR);
}
bv->moveCursorUpdate(false);
moveCursorUpdate(bv, false);
break;
case LFUN_HYPHENATION:
@ -997,7 +1027,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
// this was originally a beforeChange(bv->text), i.e
// the outermost LyXText!
bv->beforeChange(this);
string const clip(bv->workarea().getClipboard());
string const clip = bv->workarea().getClipboard();
if (!clip.empty()) {
if (cmd.argument == "paragraph")
insertStringAsParagraphs(bv, clip);
@ -1030,7 +1060,6 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
Paragraph const * par = cursor.par();
lyx::pos_type pos = cursor.pos();
char c;
if (!pos)
c = ' ';
else if (par->isInset(pos - 1) && par->getInset(pos - 1)->isSpace())
@ -1067,7 +1096,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
update(bv, true);
}
selection.cursor = cursor;
bv->moveCursorUpdate(false);
moveCursorUpdate(bv, false);
break;
}
@ -1100,7 +1129,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
update(bv);
selection.cursor = cursor;
bv->moveCursorUpdate(false);
moveCursorUpdate(bv, false);
// real_current_font.number can change so we need to
// update the minibuffer