LyXText::LyXText(BufferView * bv, InsetText * inset, bool ininset,
ParagraphList & paragraphs)
- : height(0), width(0),
- inset_owner(inset), the_locking_inset(0), bv_owner(bv),
+ : height(0), width(0), inset_owner(inset), bv_owner(bv),
in_inset_(ininset), paragraphs_(¶graphs),
cache_pos_(-1)
-{
-}
+{}
void LyXText::init(BufferView * bview)
// No, try to see if we are inside a collapsable inset
if (inset_owner && inset_owner->owner()
&& inset_owner->owner()->isOpen()) {
- bv()->unlockInset(inset_owner->owner());
+ finishUndo();
inset_owner->owner()->close(bv());
bv()->getLyXText()->cursorRight(bv());
+ bv()->updateParagraphDialog();
}
return;
}
else
inset->open(bv());
- bv()->updateInset(inset);
+ bv()->update();
}
-/* used in setlayout */
+// used in setLayout
// Asger is not sure we want to do this...
void LyXText::makeFontEntriesLayoutSpecific(BufferParams const & params,
Paragraph & par)
prev_after_depth = pit->getMaxDepthAfter();
+#warning SERIOUS: Uahh... does this mean we access end->getMaxDepthAfter?
if (pit == end) {
break;
}
}
-
void LyXText::clearSelection()
{
TextCursor::clearSelection();
- // reset this in the bv_owner!
- if (bv_owner && bv_owner->text)
- bv_owner->text->xsel_cache.set(false);
+ // reset this in the bv()!
+ if (bv() && bv()->text)
+ bv()->text->xsel_cache.set(false);
}
{
ParagraphList::iterator cpit = cursorPar();
pos_type end = cpit->getRow(cursor.pos())->endpos();
- /* if not on the last row of the par, put the cursor before
- the final space */
+ // if not on the last row of the par, put the cursor before
+ // the final space
setCursor(cpit, end == cpit->size() ? end : end - 1);
}
// the DTP switches for paragraphs. LyX will store them in the first
// physical paragraph. When a paragraph is broken, the top settings rest,
// the bottom settings are given to the new one. So I can make sure,
-// they do not duplicate themself and you cannnot make dirty things with
+// they do not duplicate themself and you cannot play dirty tricks with
// them!
void LyXText::setParagraph(
recUndo(selection.start.par(), parOffset(undoendpit) - 1);
-
int tmppit = selection.end.par();
while (tmppit != selection.start.par() - 1) {
setCursor(selection.end.par(), selection.end.pos());
setSelection();
setCursor(tmpcursor.par(), tmpcursor.pos());
- if (inset_owner)
- bv()->updateInset(inset_owner);
+ bv()->update();
}
{
if (!cursorPar()->insetAllowed(inset->lyxCode()))
return;
+
recUndo(cursor.par());
freezeUndo();
cursorPar()->insertInset(cursor.pos(), inset);
int y = cursor.y() - crow.baseline() - 1;
setCursorFromCoordinates(x, y);
if (!selecting) {
- int topy = bv_owner->top_y();
+ int topy = bv()->top_y();
int y1 = cursor.y() - topy;
int y2 = y1;
y -= topy;
InsetOld * inset_hit = checkInsetHit(x, y1);
- if (inset_hit && isHighlyEditableInset(inset_hit)) {
+ if (inset_hit && isHighlyEditableInset(inset_hit))
inset_hit->edit(bv(), x, y - (y2 - y1));
- bv()->cursor().push(inset_hit, inset_hit->getText(0));
- }
}
#else
lyxerr << "cursorUp: y " << cursor.y() << " bl: " <<
int y = cursor.y() - crow.baseline() + crow.height() + 1;
setCursorFromCoordinates(x, y);
if (!selecting) {
- int topy = bv_owner->top_y();
+ int topy = bv()->top_y();
int y1 = cursor.y() - topy;
int y2 = y1;
y -= topy;
InsetOld * inset_hit = checkInsetHit(x, y1);
- if (inset_hit && isHighlyEditableInset(inset_hit)) {
- bv()->cursor().push(inset_hit, inset_hit->getText(0));
+ if (inset_hit && isHighlyEditableInset(inset_hit))
inset_hit->edit(bv(), x, y - (y2 - y1));
- }
}
#else
setCursorFromCoordinates(bv()->x_target(),