mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
more cursor dispatch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8396 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
905dd033d3
commit
62e4adaef2
19
src/cursor.C
19
src/cursor.C
@ -79,17 +79,15 @@ DispatchResult LCursor::dispatch(FuncRequest const & cmd0)
|
||||
{
|
||||
//lyxerr << "\nLCursor::dispatch: cmd: " << cmd0 << endl << *this << endl;
|
||||
FuncRequest cmd = cmd0;
|
||||
|
||||
for (int i = cursor_.size() - 1; i >= 1; --i) {
|
||||
current_ = i;
|
||||
CursorSlice const & citem = cursor_[i];
|
||||
lyxerr << "trying to dispatch to inset " << citem.inset_ << endl;
|
||||
for (current_ = cursor_.size() - 1; current_ >= 1; --current_) {
|
||||
lyxerr << "trying to dispatch to inset " << inset() << endl;
|
||||
DispatchResult res = inset()->dispatch(*this, cmd);
|
||||
if (res.dispatched()) {
|
||||
lyxerr << " successfully dispatched to inset " << citem.inset_ << endl;
|
||||
lyxerr << " successfully dispatched to inset " << inset() << endl;
|
||||
return DispatchResult(true, true);
|
||||
}
|
||||
// remove one level of cursor
|
||||
// "Mutate" the request for semi-handled requests that need
|
||||
// additional handling in outer levels.
|
||||
switch (res.val()) {
|
||||
case FINISHED:
|
||||
cmd = FuncRequest(LFUN_FINISHED_LEFT);
|
||||
@ -104,15 +102,16 @@ DispatchResult LCursor::dispatch(FuncRequest const & cmd0)
|
||||
cmd = FuncRequest(LFUN_FINISHED_DOWN);
|
||||
break;
|
||||
default:
|
||||
lyxerr << "not handled on level " << i << " val: " << res.val() << endl;
|
||||
//lyxerr << "not handled on level " << current_
|
||||
// << " val: " << res.val() << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
current_ = 0;
|
||||
BOOST_ASSERT(current_ == 0);
|
||||
lyxerr << "trying to dispatch to main text " << bv_->text()
|
||||
<< " with cursor: " << *this << endl;
|
||||
DispatchResult res = bv_->text()->dispatch(*this, cmd);
|
||||
lyxerr << " result: " << res.val() << endl;
|
||||
//lyxerr << " result: " << res.val() << endl;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,6 @@ int InsetCollapsable::height_collapsed() const
|
||||
|
||||
void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
//lyxerr << "InsetCollapsable::metrics: width: " << mi.base.textwidth << endl;
|
||||
if (status_ == Inlined) {
|
||||
inset.metrics(mi, dim);
|
||||
} else {
|
||||
@ -150,7 +149,6 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
}
|
||||
}
|
||||
dim_ = dim;
|
||||
//lyxerr << "InsetCollapsable::metrics: dim.wid: " << dim.wid << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -217,8 +215,6 @@ InsetCollapsable::lfunMouseRelease(LCursor & cur, FuncRequest const & cmd)
|
||||
if (hitButton(cmd)) {
|
||||
lyxerr << "InsetCollapsable::lfunMouseRelease 2" << endl;
|
||||
setStatus(Collapsed);
|
||||
// drop one level
|
||||
cur.bv().cursor() = cur;
|
||||
return DispatchResult(false, FINISHED_RIGHT);
|
||||
}
|
||||
lyxerr << "InsetCollapsable::lfunMouseRelease 3" << endl;
|
||||
|
Loading…
Reference in New Issue
Block a user