#include <config.h>
-#include FORMS_H_LOCATION
-
-
#ifdef __GNUG__
#pragma implementation "lyxtext.h"
#endif
if (par->getChar(pos) == Paragraph::META_INSET) {
Inset * inset = par->getInset(pos);
if (inset) {
- if (inset->Editable()==Inset::HIGHLY_EDITABLE) {
+ if (inset->editable()==Inset::HIGHLY_EDITABLE) {
UpdatableInset * uinset = static_cast<UpdatableInset *>(inset);
- uinset->SetFont(bv, fnt, toggleall, true);
+ uinset->setFont(bv, fnt, toggleall, true);
}
- font = inset->ConvertFont(font);
+ font = inset->convertFont(font);
}
}
LyXFont font(fnt);
// Let the insets convert their font
if (par->getChar(pos) == Paragraph::META_INSET) {
- font = par->getInset(pos)->ConvertFont(font);
+ font = par->getInset(pos)->convertFont(font);
}
LyXLayout const & layout =
int y = cur.y() - tmprow->baseline();
setHeightOfRow(bview, tmprow);
+
+#if 0
Paragraph * first_phys_par = tmprow->par();
// find the first row of the paragraph
y -= tmprow->height();
setHeightOfRow(bview, tmprow);
}
+#else
+ while (tmprow->previous() && tmprow->previous()->par() == tmprow->par()) {
+ tmprow = tmprow->previous();
+ y -= tmprow->height();
+ setHeightOfRow(bview, tmprow);
+ }
+#endif
// we can set the refreshing parameters now
status = LyXText::NEED_MORE_REFRESH;
int y = cur.y() - tmprow->baseline();
setHeightOfRow(bview, tmprow);
+
+#if 0
Paragraph * first_phys_par = tmprow->par();
// find the first row of the paragraph
tmprow = tmprow->previous();
y -= tmprow->height();
}
-
+#else
+ while (tmprow->previous() && tmprow->previous()->par() == tmprow->par()) {
+ tmprow = tmprow->previous();
+ y -= tmprow->height();
+ }
+#endif
// we can set the refreshing parameters now
if (status == LyXText::UNCHANGED || y < refresh_y) {
refresh_y = y;
Paragraph const * endpar) const
{
Row * tmprow2;
- Paragraph * tmppar = 0, * first_phys_par = 0;
+ Paragraph * tmppar = 0;
+ Paragraph * first_phys_par = 0;
Row * tmprow = cur.row();
int y = cur.y() - tmprow->baseline();
-
- if (!tmprow->previous()){
+
+#if 0
+ if (!tmprow->previous()) {
first_phys_par = firstParagraph(); // a trick/hack for UNDO
} else {
first_phys_par = tmprow->par();
y -= tmprow->height();
}
}
-
+#else
+ if (!tmprow->previous()) {
+ // a trick/hack for UNDO
+ // Can somebody please tell me _why_ this solves
+ // anything. (Lgb)
+ first_phys_par = firstParagraph();
+ } else {
+ first_phys_par = tmprow->par();
+ while (tmprow->previous()
+ && tmprow->previous()->par() == first_phys_par) {
+ tmprow = tmprow->previous();
+ y -= tmprow->height();
+ }
+ }
+#endif
+
// we can set the refreshing parameters now
status = LyXText::NEED_MORE_REFRESH;
refresh_y = y;
selection.set(false);
if (inset_owner && (selection.set() || lsel))
- inset_owner->SetUpdateStatus(bview, InsetText::SELECTION);
+ inset_owner->setUpdateStatus(bview, InsetText::SELECTION);
}
selection.cursor = cursor;
}
if (inset_owner)
- inset_owner->SetUpdateStatus(bview, InsetText::CURSOR_PAR);
+ inset_owner->setUpdateStatus(bview, InsetText::CURSOR_PAR);
}
// the caption hack:
if (layout.labeltype == LABEL_SENSITIVE) {
bool isOK (par->InInset() && par->InInset()->owner() &&
- (par->InInset()->owner()->LyxCode() == Inset::FLOAT_CODE));
+ (par->InInset()->owner()->lyxCode() == Inset::FLOAT_CODE));
if (isOK) {
InsetFloat * tmp = static_cast<InsetFloat*>(par->InInset()->owner());
// inset now after the Undo LyX tries to call inset->Edit(...) again
// and cannot do this as the cursor is behind the inset and GetInset
// does not return the inset!
- if (inset->Editable() == Inset::HIGHLY_EDITABLE) {
+ if (inset->editable() == Inset::HIGHLY_EDITABLE) {
cursorLeft(bview, true);
}
#endif
selection.start.par()->previous(),
undoendpar);
- CutAndPaste cap;
-
// there are two cases: cut only within one paragraph or
// more than one paragraph
if (selection.start.par() == selection.end.par()) {
// only within one paragraph
endpar = selection.end.par();
int pos = selection.end.pos();
- cap.cutSelection(selection.start.par(), &endpar,
+ CutAndPaste::cutSelection(selection.start.par(), &endpar,
selection.start.pos(), pos,
bview->buffer()->params.textclass, doclear);
selection.end.pos(pos);
} else {
endpar = selection.end.par();
int pos = selection.end.pos();
- cap.cutSelection(selection.start.par(), &endpar,
+ CutAndPaste::cutSelection(selection.start.par(), &endpar,
selection.start.pos(), pos,
bview->buffer()->params.textclass, doclear);
cursor.par(endpar);
|| selection.start.pos() < selection.end.pos()))
selection.start.pos(selection.start.pos() + 1);
- CutAndPaste cap;
-
- cap.copySelection(selection.start.par(), selection.end.par(),
+ CutAndPaste::copySelection(selection.start.par(), selection.end.par(),
selection.start.pos(), selection.end.pos(),
bview->buffer()->params.textclass);
}
void LyXText::pasteSelection(BufferView * bview)
{
- CutAndPaste cap;
-
// this does not make sense, if there is nothing to paste
- if (!cap.checkPastePossible(cursor.par()))
+ if (!CutAndPaste::checkPastePossible(cursor.par()))
return;
setUndo(bview->buffer(), Undo::INSERT,
Paragraph * actpar = cursor.par();
int pos = cursor.pos();
- cap.pasteSelection(&actpar, &endpar, pos,
+ CutAndPaste::pasteSelection(&actpar, &endpar, pos,
bview->buffer()->params.textclass);
redoParagraphs(bview, cursor, endpar);
} while (res.par() &&
!(res.par()->getChar(res.pos()) == Paragraph::META_INSET
&& (inset = res.par()->getInset(res.pos())) != 0
- && find(codes.begin(), codes.end(), inset->LyxCode())
+ && find(codes.begin(), codes.end(), inset->lyxCode())
!= codes.end()
&& (contents.empty() ||
static_cast<InsetCommand *>(res.par()->getInset(res.pos()))->getContents()