Paragraph * InsetText::getParFromID(int id) const
{
+#if 0
Paragraph * result = par;
Paragraph * ires = 0;
while (result && result->id() != id) {
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
}
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();
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);
}