mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
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:
parent
f6eefacf4b
commit
7c984f40f2
@ -194,6 +194,9 @@ string const currentState(BufferView * bv)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if 1
|
||||
state << _(", Paragraph: ") << text->cursor.par()->id();
|
||||
#endif
|
||||
}
|
||||
return state.str().c_str();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
18
src/text2.C
18
src/text2.C
@ -2137,15 +2137,27 @@ void LyXText::setCursorIntern(BufferView * bview, Paragraph * par,
|
||||
bool setfont, bool boundary) const
|
||||
{
|
||||
InsetText * it = static_cast<InsetText *>(par->inInset());
|
||||
if (it && (it != inset_owner)) {
|
||||
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);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
setCursor(bview, cursor, par, pos, boundary);
|
||||
if (setfont)
|
||||
setCurrentFont(bview);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LyXText::setCurrentFont(BufferView * bview) const
|
||||
|
Loading…
Reference in New Issue
Block a user