some debug stuff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2421 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-08-05 22:12:27 +00:00
parent f6eefacf4b
commit 7c984f40f2
5 changed files with 44 additions and 8 deletions

View File

@ -194,6 +194,9 @@ string const currentState(BufferView * bv)
break;
}
}
#if 1
state << _(", Paragraph: ") << text->cursor.par()->id();
#endif
}
return state.str().c_str();
}

View File

@ -550,6 +550,7 @@ int InsetCollapsable::scroll(bool recursive) const
Paragraph * InsetCollapsable::getParFromID(int id) const
{
lyxerr[Debug::INFO] << "Looking for paragraph " << id << endl;
return inset.getParFromID(id);
}

View File

@ -1998,6 +1998,7 @@ void InsetText::clearInset(Painter & pain, int baseline, bool & cleared) const
Paragraph * InsetText::getParFromID(int id) const
{
#if 0
Paragraph * result = par;
Paragraph * ires = 0;
while (result && result->id() != id) {
@ -2006,6 +2007,22 @@ Paragraph * InsetText::getParFromID(int id) const
result = result->next();
}
return result;
#else
Paragraph * tmp = par;
while (tmp) {
int tmp_id = tmp->id();
lyxerr << "Looking at paragraph: " << tmp_id << endl;
if (tmp->id() == id) {
return tmp;
}
Paragraph * tmp2 = tmp->getParFromID(id);
if (tmp2 != 0) {
return tmp2;
}
tmp = tmp->next();
}
return 0;
#endif
}

View File

@ -1393,10 +1393,13 @@ string const LyXFunc::dispatch(int ac,
lyxerr[Debug::INFO] << "No matching paragraph found! ["
<< id << "]" << std::endl;
break;
} else {
lyxerr << "Paragraph " << par->id()
<< " found." << endl;
}
// Set the cursor
TEXT()->setCursor(owner->view(), par, 0);
owner->view()->text->setCursor(owner->view(), par, 0);
owner->view()->setState();
owner->showState();

View File

@ -2137,14 +2137,26 @@ void LyXText::setCursorIntern(BufferView * bview, Paragraph * par,
bool setfont, bool boundary) const
{
InsetText * it = static_cast<InsetText *>(par->inInset());
if (it && (it != inset_owner)) {
it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont,
boundary);
} else {
setCursor(bview, cursor, par, pos, boundary);
if (setfont)
setCurrentFont(bview);
if (it) {
lyxerr << "InsetText is " << it << endl;
lyxerr << "inset_owner is " << inset_owner << endl;
if (it != inset_owner) {
#warning I belive this code is wrong. (Lgb)
#warning Jürgen, have a look at this. (Lgb)
// Jürgen, would you like to have a look?
// I guess we need to move the outer cursor
// and open and lock the inset (bla bla bla)
// stuff I don't know... so can you have a look?
// (Lgb)
it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont,
boundary);
return;
}
}
setCursor(bview, cursor, par, pos, boundary);
if (setfont)
setCurrentFont(bview);
}