Inset * locking_inset = theLockingInset()->getLockingInset();
if ((cursor.pos() - 1 >= 0) &&
- (cursor.par()->getChar(cursor.pos() - 1) ==
- Paragraph::META_INSET) &&
+ cursor.par()->isInset(cursor.pos() - 1) &&
(cursor.par()->getInset(cursor.pos() - 1) ==
locking_inset))
text->setCursor(this, cursor,
if (cursor.pos() < cursor.par()->size()
- && isMetaInset(cursor.par(), cursor.pos())
+ && cursor.par()->isInset(cursor.pos())
&& isEditableInset(cursor.par()->getInset(cursor.pos()))) {
// Check whether the inset really was hit
}
if ((cursor.pos() - 1 >= 0) &&
- isMetaInset(cursor.par(), cursor.pos() - 1) &&
+ cursor.par()->isInset(cursor.pos() - 1) &&
isEditableInset(cursor.par()->getInset(cursor.pos() - 1))) {
Inset * tmpinset = cursor.par()->getInset(cursor.pos()-1);
LyXFont font = text->getFont(buffer_, cursor.par(),
if (is_rtl)
lt->cursorLeft(bv_, false);
if (lt->cursor.pos() < lt->cursor.par()->size()
- && isMetaInset(lt->cursor.par(), lt->cursor.pos())
+ && lt->cursor.par()->isInset(lt->cursor.pos())
&& isHighlyEditableInset(lt->cursor.par()->getInset(lt->cursor.pos()))) {
Inset * tmpinset = lt->cursor.par()->getInset(lt->cursor.pos());
owner_->getLyXFunc()->setMessage(tmpinset->editMessage());
lt->cursorLeft(bv_, false);
if ((is_rtl || cur != lt->cursor) && // only if really moved!
lt->cursor.pos() < lt->cursor.par()->size() &&
- isMetaInset(lt->cursor.par(), lt->cursor.pos()) &&
+ lt->cursor.par()->isInset(lt->cursor.pos()) &&
isHighlyEditableInset(lt->cursor.par()->getInset(lt->cursor.pos()))) {
Inset * tmpinset = lt->cursor.par()->getInset(lt->cursor.pos());
owner_->getLyXFunc()->setMessage(tmpinset->editMessage());
string contents;
if (same_content &&
- isMetaInset(cursor.par(), cursor.pos())) {
+ cursor.par()->isInset(cursor.pos())) {
Inset const * inset = cursor.par()->getInset(cursor.pos());
if (find(codes.begin(), codes.end(), inset->lyxCode())
!= codes.end())
+2001-11-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * BufferView2.C:
+ * BufferView_pimpl.C:
+ * buffer.C:
+ * paragraph.h:
+ * text.C:
+ * text2.C: use par->isInset()
+
2001-11-23 John Levon <moz@compsoc.man.ac.uk>
* paragraph_pimpl.h:
par->layout);
// treat <toc> as a special case for compatibility with old code
- if (par->getChar(0) == Paragraph::META_INSET) {
+ if (par->isInset(0)) {
Inset * inset = par->getInset(0);
Inset::Code lyx_code = inset->lyxCode();
if (lyx_code == Inset::TOC_CODE){
// treat label as a special case for
// more WYSIWYM handling.
- if (par->getChar(0) == Paragraph::META_INSET) {
+ if (par->isInset(0)) {
Inset * inset = par->getInset(0);
Inset::Code lyx_code = inset->lyxCode();
if (lyx_code == Inset::LABEL_CODE){
+2001-11-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * inset.h: fix comment
+
+ * insettext.C: use par->isInset()
+
2001-11-22 Allan Rae <rae@lyx.org>
* insetcollapsable.h:
}
/**
- * returns true if poiinter argument is valid
+ * returns true if pointer argument is valid
* and points to a highly editable inset
*/
inline bool isHighlyEditableInset(Inset * i)
{
return i && i->editable() == Inset::HIGHLY_EDITABLE;
}
+
#endif
x - inset_x, y - inset_y,
button);
} else {
- if (isMetaInset(cpar(bv), cpos(bv))) {
+ if (cpar(bv)->isInset(cpos(bv))) {
inset = static_cast<UpdatableInset*>(cpar(bv)->getInset(cpos(bv)));
if (isHighlyEditableInset(inset)) {
inset->insetButtonRelease(bv,
}
lt->insertInset(bv, inset);
#if 0
- if ((!isMetaInset(cpar(bv), cpos(bv))) ||
+ if ((!cpar(bv)->isInset(cpos(bv))) ||
(cpar(bv)->getInset(cpos(bv)) != inset))
lt->cursorLeft(bv);
#endif
bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
{
- if (isMetaInset(cpar(bv), cpos(bv))) {
+ if (cpar(bv)->isInset(cpos(bv))) {
unsigned int x;
unsigned int y;
Inset * inset =
}
}
- if (style.isEnvironment()){
+ if (style.isEnvironment()) {
if (style.latextype == LATEX_LIST_ENVIRONMENT) {
os << "\\begin{" << style.latexname() << "}{"
<< params().labelWidthString() << "}\n";
Pimpl * pimpl_;
};
-
-inline bool isMetaInset(Paragraph const * par, Paragraph::size_type const pos)
-{
- return par->getChar(pos) == Paragraph::META_INSET;
-}
-
#endif
last_separator = i;
i = par->size() - 1; // this means break
//x = width;
- } else if (par->getChar(i) == Paragraph::META_INSET &&
- par->getInset(i) && par->getInset(i)->display()){
+ } else if (par->isInset(i) && par->getInset(i)
+ && par->getInset(i)->display()) {
par->getInset(i)->display(false);
}
++i;
// Check if any insets are larger
for (Paragraph::size_type pos = row_ptr->pos(); pos <= pos_end; ++pos) {
- if (row_ptr->par()->getChar(pos) == Paragraph::META_INSET) {
+ if (row_ptr->par()->isInset(pos)) {
tmpfont = getFont(bview->buffer(), row_ptr->par(), pos);
tmpinset = row_ptr->par()->getInset(pos);
if (tmpinset) {
}
// the display inset stuff
- if (cursor.row()->par()->getChar(cursor.row()->pos()) == Paragraph::META_INSET
+ if (cursor.row()->par()->isInset(cursor.row()->pos())
&& cursor.row()->par()->getInset(cursor.row()->pos())
&& (cursor.row()->par()->getInset(cursor.row()->pos())->display() ||
cursor.row()->par()->getInset(cursor.row()->pos())->needFullRow()))
// center displayed insets
Inset * inset;
- if (row->par()->getChar(row->pos()) == Paragraph::META_INSET
+ if (row->par()->isInset(row->pos())
&& (inset=row->par()->getInset(row->pos()))
&& (inset->display())) // || (inset->scroll() < 0)))
align = (inset->lyxCode() == Inset::MATHMACRO_CODE)
ns = numberOfSeparators(bview->buffer(), row);
if (ns && row->next() && row->next()->par() == row->par() &&
!(row->next()->par()->isNewline(row->next()->pos() - 1))
- && !(row->next()->par()->getChar(row->next()->pos()) == Paragraph::META_INSET
+ && !(row->next()->par()->isInset(row->next()->pos())
&& row->next()->par()->getInset(row->next()->pos())
&& row->next()->par()->getInset(row->next()->pos())->display())
)
false, cursor.boundary());
// some insets are undeletable here
- if (cursor.par()->getChar(cursor.pos()) == Paragraph::META_INSET) {
+ if (cursor.par()->isInset(cursor.pos())) {
if (!cursor.par()->getInset(cursor.pos())->deletable())
return;
// force complete redo when erasing display insets
Paragraph::size_type const last = rowLastPrintable(p.row);
if (!p.bv->screen()->forceClear() && last == p.row->pos()
- && isMetaInset(p.row->par(), p.row->pos())) {
+ && p.row->par()->isInset(p.row->pos())) {
inset = p.row->par()->getInset(p.row->pos());
if (inset) {
clear_area = inset->doClearArea();
x = int(tmpx);
return c;
}
-
+
// returns pointer to a specified row
Row * LyXText::getRow(Paragraph * par,
LyXFont font = getFont(buf, par, pos);
font.update(fnt, buf->params.language, toggleall);
// Let the insets convert their font
- if (isMetaInset(par, pos)) {
+ if (par->isInset(pos)) {
Inset * inset = par->getInset(pos);
if (isEditableInset(inset)) {
UpdatableInset * uinset =
if (cursor.pos() == 0 && cursor.par()->bibkey) {
inset = cursor.par()->bibkey;
} else if (cursor.pos() < cursor.par()->size()
- && isMetaInset(cursor.par(), cursor.pos())) {
+ && cursor.par()->isInset(cursor.pos())) {
inset = cursor.par()->getInset(cursor.pos());
}
return inset;
}
} while (res.par() &&
- !(isMetaInset(res.par(), res.pos())
+ !(res.par()->isInset(res.pos())
&& (inset = res.par()->getInset(res.pos())) != 0
&& find(codes.begin(), codes.end(), inset->lyxCode())
!= codes.end()