// No, try to see if we are inside a collapsable inset
if (inset_owner && inset_owner->owner()
&& inset_owner->owner()->isOpen()) {
- bv()->unlockInset(static_cast<UpdatableInset *>(inset_owner->owner()));
+ bv()->unlockInset(inset_owner->owner());
inset_owner->owner()->close(bv());
bv()->getLyXText()->cursorRight(bv());
}
}
-// deletes and inserts again all paragaphs between the cursor
+// deletes and inserts again all paragraphs between the cursor
// and the specified par
// This function is needed after SetLayout and SetFont etc.
void LyXText::redoParagraphs(LyXCursor const & cur,
if (tmprit == rows().begin()) {
// A trick/hack for UNDO.
// This is needed because in an UNDO/REDO we could have
- // changed the ownerParagrah() so the paragraph inside
+ // changed the ownerParagraph() so the paragraph inside
// the row is NOT my really first par anymore.
// Got it Lars ;) (Jug 20011206)
first_phys_pit = ownerParagraphs().begin();
}
if (prevrit != rows().end()) {
setHeightOfRow(prevrit);
- const_cast<LyXText *>(this)->postPaint(y - prevrit->height());
+ postPaint(y - prevrit->height());
} else {
setHeightOfRow(rows().begin());
- const_cast<LyXText *>(this)->postPaint(0);
+ postPaint(0);
}
if (tmprit != rows().end())
setHeightOfRow(tmprit);
void LyXText::cursorBottom()
{
-#warning FIXME
- // This is how it should be:
-#ifndef NO_STD_LIST
- ParagraphList::iterator lastpit = boost::prior(ownerParagraphs().end());
-#else
- ParagraphList::iterator lastpit = ownerParagraphs().begin();
- ParagraphList::iterator end = ownerParagraphs().end();
- while (boost::next(lastpit) != end)
- ++lastpit;
-#endif
- int pos = lastpit->size();
- setCursor(lastpit, pos);
+ ParagraphList::iterator lastpit =
+ boost::prior(ownerParagraphs().end());
+ setCursor(lastpit, lastpit->size());
}
isOK = true;
break;
} else {
- tmppit = ownerParagraphs().find(*in->parOwner());
+ tmppit = std::find(ownerParagraphs().begin(), ownerParagraphs().end(), *in->parOwner());
}
}
void LyXText::setCursorIntern(ParagraphList::iterator pit,
pos_type pos, bool setfont, bool boundary)
{
- InsetText * it = static_cast<InsetText *>(pit->inInset());
+ UpdatableInset * it = pit->inInset();
if (it) {
if (it != inset_owner) {
lyxerr[Debug::INSETS] << "InsetText is " << it