rename Inset to InsetOld

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7360 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-07-25 21:20:24 +00:00
parent ec004b4318
commit 2e57f2ff0a
97 changed files with 477 additions and 467 deletions

View File

@ -380,7 +380,7 @@ void BufferView::setCursorFromRow(int row)
}
bool BufferView::insertInset(Inset * inset, string const & lout)
bool BufferView::insertInset(InsetOld * inset, string const & lout)
{
return pimpl_->insertInset(inset, lout);
}
@ -517,7 +517,7 @@ bool BufferView::lockInset(UpdatableInset * inset)
if (text->cursor.pos() < text->cursor.par()->size()
&& text->cursor.par()->getChar(text->cursor.pos()) ==
Paragraph::META_INSET) {
Inset * in = text->cursor.par()->getInset(text->cursor.pos());
InsetOld * in = text->cursor.par()->getInset(text->cursor.pos());
if (inset == in) {
theLockingInset(inset);
return true;
@ -594,13 +594,13 @@ int BufferView::unlockInset(UpdatableInset * inset)
}
void BufferView::updateInset(Inset * inset)
void BufferView::updateInset(InsetOld * inset)
{
pimpl_->updateInset(inset);
}
bool BufferView::ChangeInsets(Inset::Code code,
bool BufferView::ChangeInsets(InsetOld::Code code,
string const & from, string const & to)
{
bool need_update = false;
@ -652,7 +652,7 @@ bool BufferView::ChangeRefsIfUnique(string const & from, string const & to)
if (lyx::count(labels.begin(), labels.end(), from) > 1)
return false;
return ChangeInsets(Inset::REF_CODE, from, to);
return ChangeInsets(InsetOld::REF_CODE, from, to);
}
@ -667,7 +667,7 @@ bool BufferView::ChangeCitationsIfUnique(string const & from, string const & to)
> 1)
return false;
return ChangeInsets(Inset::CITE_CODE, from, to);
return ChangeInsets(InsetOld::CITE_CODE, from, to);
}
@ -697,7 +697,7 @@ LyXText * BufferView::getLyXText() const
}
LyXText * BufferView::getParentText(Inset * inset) const
LyXText * BufferView::getParentText(InsetOld * inset) const
{
if (inset->owner()) {
LyXText * txt = inset->getLyXText(this);
@ -711,7 +711,7 @@ LyXText * BufferView::getParentText(Inset * inset) const
}
Language const * BufferView::getParentLanguage(Inset * inset) const
Language const * BufferView::getParentLanguage(InsetOld * inset) const
{
LyXText * text = getParentText(inset);
return text->cursor.par()->getFontSettings(buffer()->params,

View File

@ -80,7 +80,7 @@ public:
/// reload the contained buffer
void reload();
/// create a new buffer based on template
bool newFile(string const & fname, string const & tname,
bool newFile(string const & fname, string const & tname,
bool named = true);
/// load a buffer into the view
bool loadLyXFile(string const & name, bool tolastfiles = true);
@ -94,7 +94,7 @@ public:
/// update for the top-level lyxtext
void update(UpdateCodes uc);
/// update for a particular inset
void updateInset(Inset * inset);
void updateInset(InsetOld * inset);
/// reset the scrollbar to reflect current view position
void updateScrollbar();
/// FIXME
@ -137,7 +137,7 @@ public:
Encoding const * getEncoding() const;
/// return the parent language of the given inset
Language const * getParentLanguage(Inset * inset) const;
Language const * getParentLanguage(InsetOld * inset) const;
/// Select the "current" word
void selectLastWord();
@ -167,7 +167,7 @@ public:
* Insert an inset into the buffer.
* Place it in a layout of lout,
*/
bool insertInset(Inset * inset, string const & lout = string());
bool insertInset(InsetOld * inset, string const & lout = string());
/// Inserts a lyx file at cursor position. return false if it fails
bool insertLyXFile(string const & file);
@ -217,14 +217,14 @@ private:
void theLockingInset(UpdatableInset * inset);
/// return the lyxtext containing this inset
LyXText * getParentText(Inset * inset) const;
LyXText * getParentText(InsetOld * inset) const;
/**
* Change all insets with the given code's contents to a new
* string. May only be used with InsetCommand-derived insets
* Returns true if a screen update is needed.
*/
bool ChangeInsets(Inset::Code code, string const & from,
bool ChangeInsets(InsetOld::Code code, string const & from,
string const & to);

View File

@ -790,7 +790,7 @@ void BufferView::Pimpl::switchKeyMap()
LyXText * text = bv_->getLyXText();
if (text->real_current_font.isRightToLeft()
&& !(bv_->theLockingInset()
&& bv_->theLockingInset()->lyxCode() == Inset::ERT_CODE))
&& bv_->theLockingInset()->lyxCode() == InsetOld::ERT_CODE))
{
if (owner_->getIntl().keymap == Intl::PRIMARY)
owner_->getIntl().KeyMapSec();
@ -866,7 +866,7 @@ void BufferView::Pimpl::stuffClipboard(string const & stuff) const
*/
Inset * BufferView::Pimpl::getInsetByCode(Inset::Code code)
InsetOld * BufferView::Pimpl::getInsetByCode(InsetOld::Code code)
{
#if 0
LyXCursor cursor = bv_->getLyXText()->cursor;
@ -1150,7 +1150,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
string label = ev.argument;
if (label.empty()) {
InsetRef * inset =
static_cast<InsetRef*>(getInsetByCode(Inset::REF_CODE));
static_cast<InsetRef*>(getInsetByCode(InsetOld::REF_CODE));
if (inset) {
label = inset->getContents();
savePosition(0);
@ -1220,7 +1220,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
break;
case LFUN_INSET_INSERT: {
Inset * inset = createInset(ev);
InsetOld * inset = createInset(ev);
if (inset && insertInset(inset)) {
updateInset(inset);
@ -1241,7 +1241,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
case LFUN_FLOAT_LIST:
if (tclass.floats().typeExist(ev.argument)) {
Inset * inset = new InsetFloatList(ev.argument);
InsetOld * inset = new InsetFloatList(ev.argument);
if (!insertInset(inset, tclass.defaultLayoutName()))
delete inset;
} else {
@ -1274,7 +1274,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
params2string(*par, data);
// Will the paragraph accept changes from the dialog?
Inset * const inset = par->inInset();
InsetOld * const inset = par->inInset();
bool const accept =
!(inset && inset->forceDefaultParagraphs(inset));
@ -1366,7 +1366,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
}
bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
bool BufferView::Pimpl::insertInset(InsetOld * inset, string const & lout)
{
// if we are in a locking inset we should try to insert the
// inset there otherwise this is a illegal function now
@ -1427,7 +1427,7 @@ bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
}
void BufferView::Pimpl::updateInset(Inset * inset)
void BufferView::Pimpl::updateInset(InsetOld * inset)
{
if (!inset || !available())
return;
@ -1452,7 +1452,7 @@ void BufferView::Pimpl::updateInset(Inset * inset)
// then check if the inset is a top_level inset (has no owner)
// if yes do the update as always otherwise we have to update the
// toplevel inset where this inset is inside
Inset * tl_inset = inset;
InsetOld * tl_inset = inset;
while (tl_inset->owner())
tl_inset = tl_inset->owner();
if (tl_inset == inset) {

View File

@ -101,9 +101,9 @@ struct BufferView::Pimpl : public boost::signals::trackable {
///
void center();
///
bool insertInset(Inset * inset, string const & lout = string());
bool insertInset(InsetOld * inset, string const & lout = string());
///
void updateInset(Inset * inset);
void updateInset(InsetOld * inset);
/// a function should be executed from the workarea
bool workAreaDispatch(FuncRequest const & ev);
/// a function should be executed
@ -172,7 +172,7 @@ private:
///
std::vector<Position> saved_positions;
/// Get next inset of this class from current cursor position
Inset * getInsetByCode(Inset::Code code);
InsetOld * getInsetByCode(InsetOld::Code code);
///
void MenuInsertLyXFile(string const & filen);
/// our workarea

View File

@ -1,3 +1,7 @@
2003-07-25 Lars Gullik Bjønnes <larsbj@gullik.net>
* rename Inset to InsetOld
2003-07-25 Asger Alstrup <alstrup@diku.dk>
* undo_funcs.h: Removed setCursorParUndo to simplify things a bit.

View File

@ -300,7 +300,7 @@ CutAndPaste::pasteSelection(Buffer const & buffer,
for (; lit != eit; ++lit) {
switch (lit->inset->lyxCode()) {
case Inset::INCLUDE_CODE: {
case InsetOld::INCLUDE_CODE: {
InsetInclude * ii = static_cast<InsetInclude*>(lit->inset);
InsetInclude::Params ip = ii->params();
ip.masterFilename_ = buffer.fileName();
@ -308,7 +308,7 @@ CutAndPaste::pasteSelection(Buffer const & buffer,
break;
}
case Inset::TABULAR_CODE: {
case InsetOld::TABULAR_CODE: {
InsetTabular * it = static_cast<InsetTabular*>(lit->inset);
it->buffer(const_cast<Buffer*>(&buffer));
break;

View File

@ -75,7 +75,7 @@ InsetList::insetIterator(pos_type pos)
}
void InsetList::insert(Inset * inset, lyx::pos_type pos)
void InsetList::insert(InsetOld * inset, lyx::pos_type pos)
{
InsetTable search_elem(pos, 0);
List::iterator end = list.end();
@ -106,7 +106,7 @@ void InsetList::erase(pos_type pos)
}
Inset * InsetList::release(pos_type pos)
InsetOld * InsetList::release(pos_type pos)
{
InsetTable search_elem(pos, 0);
List::iterator end = list.end();
@ -115,7 +115,7 @@ Inset * InsetList::release(pos_type pos)
end,
search_elem, MatchIt());
if (it != end && it->pos == pos) {
Inset * tmp = it->inset;
InsetOld * tmp = it->inset;
it->inset = 0;
return tmp;
}
@ -123,7 +123,7 @@ Inset * InsetList::release(pos_type pos)
}
Inset * InsetList::get(pos_type pos) const
InsetOld * InsetList::get(pos_type pos) const
{
InsetTable search_elem(pos, 0);
List::const_iterator end = list.end();

View File

@ -5,7 +5,7 @@
#include "support/types.h"
class Inset;
class InsetOld;
class BufferView;
@ -17,9 +17,9 @@ public:
///
lyx::pos_type pos;
///
Inset * inset;
InsetOld * inset;
///
InsetTable(lyx::pos_type p, Inset * i) : pos(p), inset(i) {}
InsetTable(lyx::pos_type p, InsetOld * i) : pos(p), inset(i) {}
};
///
typedef std::vector<InsetTable> List;
@ -27,7 +27,7 @@ public:
typedef List::iterator iterator;
///
typedef List::const_iterator const_iterator;
///
~InsetList();
///
@ -41,13 +41,13 @@ public:
///
iterator insetIterator(lyx::pos_type pos);
///
void insert(Inset * inset, lyx::pos_type pos);
void insert(InsetOld * inset, lyx::pos_type pos);
///
void erase(lyx::pos_type pos);
///
Inset * release(lyx::pos_type);
InsetOld * release(lyx::pos_type);
///
Inset * get(lyx::pos_type pos) const;
InsetOld * get(lyx::pos_type pos) const;
///
void increasePosAfterPos(lyx::pos_type pos);
///

View File

@ -818,7 +818,7 @@ string const Buffer::asciiParagraph(Paragraph const & par,
switch (c) {
case Paragraph::META_INSET:
{
Inset const * inset = par.getInset(i);
InsetOld const * inset = par.getInset(i);
if (inset) {
if (linelen > 0) {
buffer << word;
@ -1128,9 +1128,9 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
LyXLayout_ptr const & style = pit->layout();
// treat <toc> as a special case for compatibility with old code
if (pit->isInset(0)) {
Inset * inset = pit->getInset(0);
Inset::Code lyx_code = inset->lyxCode();
if (lyx_code == Inset::TOC_CODE) {
InsetOld * inset = pit->getInset(0);
InsetOld::Code lyx_code = inset->lyxCode();
if (lyx_code == InsetOld::TOC_CODE) {
string const temp = "toc";
sgml::openTag(ofs, depth, false, temp);
continue;
@ -1452,7 +1452,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
char c = par->getChar(i);
if (c == Paragraph::META_INSET) {
Inset * inset = par->getInset(i);
InsetOld * inset = par->getInset(i);
inset->linuxdoc(this, os);
font_old = font;
continue;
@ -1654,9 +1654,9 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
// This is a hack while paragraphs can't have
// attributes, like id in this case.
if (par->isInset(0)) {
Inset * inset = par->getInset(0);
Inset::Code lyx_code = inset->lyxCode();
if (lyx_code == Inset::LABEL_CODE) {
InsetOld * inset = par->getInset(0);
InsetOld::Code lyx_code = inset->lyxCode();
if (lyx_code == InsetOld::LABEL_CODE) {
command_name += " id=\"";
command_name += (static_cast<InsetCommand *>(inset))->getContents();
command_name += '"';
@ -1823,7 +1823,7 @@ void Buffer::simpleDocBookOnePar(ostream & os,
if (par->isInset(i)) {
Inset * inset = par->getInset(i);
InsetOld * inset = par->getInset(i);
// don't print the inset in position 0 if desc_on == 3 (label)
if (i || desc_on != 3) {
if (style->latexparam() == "CDATA")
@ -1995,11 +1995,11 @@ void Buffer::fillWithBibKeys(std::vector<std::pair<string, string> > & keys) con
for (inset_iterator it = inset_const_iterator_begin();
it != inset_const_iterator_end(); ++it) {
if (it->lyxCode() == Inset::BIBTEX_CODE)
if (it->lyxCode() == InsetOld::BIBTEX_CODE)
static_cast<InsetBibtex &>(*it).fillWithBibKeys(this, keys);
else if (it->lyxCode() == Inset::INCLUDE_CODE)
else if (it->lyxCode() == InsetOld::INCLUDE_CODE)
static_cast<InsetInclude &>(*it).fillWithBibKeys(keys);
else if (it->lyxCode() == Inset::BIBITEM_CODE) {
else if (it->lyxCode() == InsetOld::BIBITEM_CODE) {
InsetBibitem & bib = static_cast<InsetBibitem &>(*it);
string const key = bib.getContents();
string const opt = bib.getOptions();
@ -2097,14 +2097,14 @@ void Buffer::inset_iterator::setParagraph()
}
Inset * Buffer::getInsetFromID(int id_arg) const
InsetOld * Buffer::getInsetFromID(int id_arg) const
{
for (inset_iterator it = inset_const_iterator_begin();
it != inset_const_iterator_end(); ++it)
{
if (it->id() == id_arg)
return &(*it);
Inset * in = it->getInsetFromID(id_arg);
InsetOld * in = it->getInsetFromID(id_arg);
if (in)
return in;
}

View File

@ -324,10 +324,10 @@ public:
class inset_iterator {
public:
typedef std::input_iterator_tag iterator_category;
typedef Inset value_type;
typedef InsetOld value_type;
typedef ptrdiff_t difference_type;
typedef Inset * pointer;
typedef Inset & reference;
typedef InsetOld * pointer;
typedef InsetOld & reference;
typedef ParagraphList::iterator base_type;
///
@ -387,7 +387,7 @@ public:
ParConstIterator par_iterator_end() const;
///
Inset * getInsetFromID(int id_arg) const;
InsetOld * getInsetFromID(int id_arg) const;
};
bool operator==(Buffer::inset_iterator const & iter1,

View File

@ -242,7 +242,7 @@ bool changeDepth(BufferView * bv, LyXText * text, DEPTH_CHANGE type, bool test_o
bv->update(BufferView::SELECT);
bool const changed = text->changeDepth(type, false);
if (text->inset_owner)
bv->updateInset((Inset *)text->inset_owner);
bv->updateInset((InsetOld *)text->inset_owner);
bv->update(BufferView::SELECT);
return changed;
}

View File

@ -58,7 +58,7 @@ using namespace lyx::support;
using std::endl;
Inset * createInset(FuncRequest const & cmd)
InsetOld * createInset(FuncRequest const & cmd)
{
BufferView * bv = cmd.view();
BufferParams const & params = bv->buffer()->params;
@ -281,7 +281,7 @@ Inset * createInset(FuncRequest const & cmd)
}
Inset * readInset(LyXLex & lex, Buffer const & buf)
InsetOld * readInset(LyXLex & lex, Buffer const & buf)
{
// consistency check
if (lex.getString() != "\\begin_inset") {
@ -289,7 +289,7 @@ Inset * readInset(LyXLex & lex, Buffer const & buf)
<< endl;
}
Inset * inset = 0;
InsetOld * inset = 0;
lex.next();
string const tmptok = lex.getString();
@ -351,9 +351,9 @@ Inset * readInset(LyXLex & lex, Buffer const & buf)
inset = new InsetFormula;
} else if (tmptok == "Graphics") {
inset = new InsetGraphics;
} else if (tmptok == "Note" || tmptok == "Comment"
} else if (tmptok == "Note" || tmptok == "Comment"
|| tmptok == "Greyedout") {
inset = new InsetNote(buf.params, tmptok);
inset = new InsetNote(buf.params, tmptok);
} else if (tmptok == "Include") {
InsetCommandParams p("Include");
inset = new InsetInclude(p, buf);

View File

@ -12,15 +12,15 @@
#ifndef FACTORY_H
#define FACTORY_H
class Inset;
class InsetOld;
class FuncRequest;
class LyXLex;
class Buffer;
/// creates inset according to 'cmd'
Inset * createInset(FuncRequest const & cmd);
InsetOld * createInset(FuncRequest const & cmd);
/// read inset from a file
Inset * readInset(LyXLex & lex, Buffer const & buf);
InsetOld * readInset(LyXLex & lex, Buffer const & buf);
#endif // FACTORY_H

View File

@ -30,7 +30,7 @@
#include <boost/signals/signal0.hpp>
#include <boost/scoped_ptr.hpp>
class Inset;
class InsetOld;
namespace lyx {
namespace graphics {

View File

@ -15,7 +15,7 @@
#include "LString.h"
#include <boost/scoped_ptr.hpp>
class Inset;
class InsetOld;
namespace lyx {
namespace graphics {

View File

@ -595,7 +595,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
Buffer::inset_iterator end = buffer_.inset_const_iterator_end();
for (; it != end; ++it)
if (it->lyxCode() == Inset::MATHMACRO_CODE)
if (it->lyxCode() == InsetOld::MATHMACRO_CODE)
it->latex(&buffer_, os, runparams);
// All equation lables appear as "(#)" + preview.sty's rendering of

View File

@ -20,7 +20,7 @@
#include <boost/signals/trackable.hpp>
#include <boost/signals/connection.hpp>
class Inset;
class InsetOld;
class BufferView;
namespace lyx {
@ -35,7 +35,7 @@ public:
static bool activated();
///
PreviewedInset(Inset & inset) : inset_(inset), pimage_(0) {}
PreviewedInset(InsetOld & inset) : inset_(inset), pimage_(0) {}
///
virtual ~PreviewedInset() {}
@ -62,7 +62,7 @@ public:
protected:
/// Allow the daughter classes to cast up to the parent inset.
Inset * inset() const { return &inset_; }
InsetOld * inset() const { return &inset_; }
///
BufferView * view() const;
@ -76,7 +76,7 @@ private:
virtual string const latexString() const = 0;
///
Inset & inset_;
InsetOld & inset_;
///
string snippet_;

View File

@ -1,5 +1,7 @@
2003-07-25 Lars Gullik Bjønnes <larsbj@gullik.net>
* rename Inset to InsetOld
* all inset files (clone): return a auto_ptr<InsetBase>
2003-07-23 Angus Leeming <leeming@lyx.org>

View File

@ -33,9 +33,9 @@
#include "debug.h"
// Initialization of the counter for the inset id's,
unsigned int Inset::inset_id = 0;
unsigned int InsetOld::inset_id = 0;
Inset::Inset()
InsetOld::InsetOld()
: InsetBase(),
top_x(0), top_baseline(0), scx(0),
id_(inset_id++), owner_(0), par_owner_(0),
@ -43,7 +43,7 @@ Inset::Inset()
{}
Inset::Inset(Inset const & in)
InsetOld::InsetOld(InsetOld const & in)
: InsetBase(),
top_x(0), top_baseline(0), scx(0), id_(in.id_), owner_(0),
name_(in.name_), background_color_(in.background_color_)
@ -52,26 +52,26 @@ Inset::Inset(Inset const & in)
}
bool Inset::directWrite() const
bool InsetOld::directWrite() const
{
return false;
}
Inset::EDITABLE Inset::editable() const
InsetOld::EDITABLE InsetOld::editable() const
{
return NOT_EDITABLE;
}
bool Inset::autoDelete() const
bool InsetOld::autoDelete() const
{
return false;
}
#if 0
LyXFont const Inset::convertFont(LyXFont const & font) const
LyXFont const InsetOld::convertFont(LyXFont const & font) const
{
#if 1
return font;
@ -82,13 +82,13 @@ LyXFont const Inset::convertFont(LyXFont const & font) const
#endif
string const Inset::editMessage() const
string const InsetOld::editMessage() const
{
return _("Opened inset");
}
LyXText * Inset::getLyXText(BufferView const * bv, bool /*recursive*/) const
LyXText * InsetOld::getLyXText(BufferView const * bv, bool /*recursive*/) const
{
if (owner())
return owner()->getLyXText(bv, false);
@ -97,13 +97,13 @@ LyXText * Inset::getLyXText(BufferView const * bv, bool /*recursive*/) const
}
void Inset::setBackgroundColor(LColor::color color)
void InsetOld::setBackgroundColor(LColor::color color)
{
background_color_ = color;
}
LColor::color Inset::backgroundColor() const
LColor::color InsetOld::backgroundColor() const
{
if (background_color_ == LColor::inherit) {
if (owner())
@ -115,28 +115,28 @@ LColor::color Inset::backgroundColor() const
}
int Inset::id() const
int InsetOld::id() const
{
return id_;
}
void Inset::id(int id_arg)
void InsetOld::id(int id_arg)
{
id_ = id_arg;
}
void Inset::setFont(BufferView *, LyXFont const &, bool, bool)
void InsetOld::setFont(BufferView *, LyXFont const &, bool, bool)
{}
bool Inset::forceDefaultParagraphs(Inset const * inset) const
bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
{
if (owner())
return owner()->forceDefaultParagraphs(inset);
return false;
}
int Inset::latexTextWidth(BufferView * bv) const
int InsetOld::latexTextWidth(BufferView * bv) const
{
if (owner())
return (owner()->latexTextWidth(bv));
@ -144,19 +144,19 @@ int Inset::latexTextWidth(BufferView * bv) const
}
int Inset::ascent() const
int InsetOld::ascent() const
{
return dim_.asc;
}
int Inset::descent() const
int InsetOld::descent() const
{
return dim_.des;
}
int Inset::width() const
int InsetOld::width() const
{
return dim_.wid;
}

View File

@ -12,8 +12,8 @@
* Full author contact details are available in file CREDITS
*/
#ifndef INSET_H
#define INSET_H
#ifndef INSETOLD_H
#define INSETOLD_H
#include "LColor.h"
#include "insetbase.h"
@ -42,11 +42,11 @@ namespace graphics {
}
/// Insets
class Inset : public InsetBase {
class InsetOld : public InsetBase {
public:
/** This is not quite the correct place for this enum. I think
the correct would be to let each subclass of Inset declare
its own enum code. Actually the notion of an Inset::Code
its own enum code. Actually the notion of an InsetOld::Code
should be avoided, but I am not sure how this could be done
in a cleaner way. */
enum Code {
@ -154,9 +154,9 @@ public:
typedef dispatch_result RESULT;
///
Inset();
InsetOld();
///
Inset(Inset const & in);
InsetOld(InsetOld const & in);
///
int ascent() const;
///
@ -172,9 +172,9 @@ public:
/// return true if the inset should be removed automatically
virtual bool autoDelete() const;
/// returns true the inset can hold an inset of given type
virtual bool insetAllowed(Inset::Code) const { return false; }
virtual bool insetAllowed(InsetOld::Code) const { return false; }
/// wrapper around the above
bool insetAllowed(Inset * in) const;
bool insetAllowed(InsetOld * in) const;
///
virtual void write(Buffer const *, std::ostream &) const = 0;
///
@ -191,7 +191,7 @@ public:
virtual int docbook(Buffer const *, std::ostream &, bool) const = 0;
/// returns LyX code associated with the inset. Used for TOC, ...)
virtual Inset::Code lyxCode() const { return NO_CODE; }
virtual InsetOld::Code lyxCode() const { return NO_CODE; }
/// returns true to override begin and end inset in file
virtual bool directWrite() const;
@ -243,7 +243,7 @@ public:
/// try to get a inset pointer from it's id if we have
/// an inset to give back!
virtual Inset * getInsetFromID(int /*id*/) const { return 0; }
virtual InsetOld * getInsetFromID(int /*id*/) const { return 0; }
/// if this insets owns paragraphs (f.ex. InsetText) then it
/// should return it's very first one!
virtual ParagraphList * getParagraphs(int /*num*/) const { return 0; }
@ -289,7 +289,7 @@ public:
virtual bool isLineSeparator() const { return false; }
// if this inset has paragraphs should they be output all as default
// paragraphs with "Standard" layout?
virtual bool forceDefaultParagraphs(Inset const *) const;
virtual bool forceDefaultParagraphs(InsetOld const *) const;
/** returns true if, when outputing LaTeX, font changes should
be closed before generating this inset. This is needed for
insets that may contain several paragraphs */
@ -348,14 +348,14 @@ private:
inline
bool Inset::insetAllowed(Inset * in) const
bool InsetOld::insetAllowed(InsetOld * in) const
{
return insetAllowed(in->lyxCode());
}
inline
bool Inset::checkInsertChar(LyXFont &)
bool InsetOld::checkInsertChar(LyXFont &)
{
return false;
}
@ -364,7 +364,7 @@ bool Inset::checkInsertChar(LyXFont &)
* returns true if pointer argument is valid
* and points to an editable inset
*/
inline bool isEditableInset(Inset const * i)
inline bool isEditableInset(InsetOld const * i)
{
return i && i->editable();
}
@ -373,9 +373,9 @@ inline bool isEditableInset(Inset const * i)
* returns true if pointer argument is valid
* and points to a highly editable inset
*/
inline bool isHighlyEditableInset(Inset const * i)
inline bool isHighlyEditableInset(InsetOld const * i)
{
return i && i->editable() == Inset::HIGHLY_EDITABLE;
return i && i->editable() == InsetOld::HIGHLY_EDITABLE;
}
#endif

View File

@ -43,7 +43,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
Inset::Code lyxCode() const { return Inset::BIBITEM_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::BIBITEM_CODE; }
/// keep .lyx format compatible
bool directWrite() const { return true; }
///

View File

@ -37,7 +37,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::BIBTEX_CODE; }
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;

View File

@ -79,8 +79,8 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const
// See if we can find the name of the float this caption
// belongs to.
Inset * i1 = owner();
Inset * i2 = i1 ? i1->owner() : 0;
InsetOld * i1 = owner();
InsetOld * i2 = i1 ? i1->owner() : 0;
string type;
if (i2->lyxCode() == FLOAT_CODE)
type = static_cast<InsetFloat *>(i2)->params().type;

View File

@ -30,7 +30,7 @@ public:
///
virtual bool needFullRow() const;
///
virtual Inset::Code lyxCode() const;
virtual InsetOld::Code lyxCode() const;
///
virtual string const editMessage() const;
///
@ -60,7 +60,7 @@ bool InsetCaption::needFullRow() const
inline
Inset::Code InsetCaption::lyxCode() const
InsetOld::Code InsetCaption::lyxCode() const
{
return CAPTION_CODE;
}

View File

@ -33,7 +33,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
Inset::Code lyxCode() const { return Inset::CITE_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::CITE_CODE; }
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
///

View File

@ -75,7 +75,7 @@ InsetCollapsable::InsetCollapsable(InsetCollapsable const & in)
}
bool InsetCollapsable::insertInset(BufferView * bv, Inset * in)
bool InsetCollapsable::insertInset(BufferView * bv, InsetOld * in)
{
if (!insetAllowed(in->lyxCode())) {
lyxerr << "InsetCollapsable::InsertInset: "
@ -195,7 +195,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
}
Inset::EDITABLE InsetCollapsable::editable() const
InsetOld::EDITABLE InsetCollapsable::editable() const
{
return collapsed_ ? IS_EDITABLE : HIGHLY_EDITABLE;
}
@ -288,7 +288,7 @@ int InsetCollapsable::docbook(Buffer const * buf, ostream & os, bool mixcont) co
}
Inset::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
InsetOld::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
{
lyxerr << "InsetCollapsable::localDispatch: "
<< cmd.action << " '" << cmd.argument << "'\n";
@ -390,7 +390,7 @@ bool InsetCollapsable::unlockInsetInInset(BufferView * bv, UpdatableInset * in,
}
bool InsetCollapsable::updateInsetInInset(BufferView * bv, Inset *in)
bool InsetCollapsable::updateInsetInInset(BufferView * bv, InsetOld *in)
{
if (in == this)
return true;
@ -431,7 +431,7 @@ UpdatableInset * InsetCollapsable::getLockingInset() const
}
UpdatableInset * InsetCollapsable::getFirstLockingInsetOfType(Inset::Code c)
UpdatableInset * InsetCollapsable::getFirstLockingInsetOfType(InsetOld::Code c)
{
if (c == lyxCode())
return this;
@ -501,7 +501,7 @@ LyXCursor const & InsetCollapsable::cursor(BufferView * bv) const
}
Inset * InsetCollapsable::getInsetFromID(int id_arg) const
InsetOld * InsetCollapsable::getInsetFromID(int id_arg) const
{
if (id_arg == id())
return const_cast<InsetCollapsable *>(this);

View File

@ -53,9 +53,9 @@ public:
///
EDITABLE editable() const;
///
bool insertInset(BufferView *, Inset * inset);
bool insertInset(BufferView *, InsetOld * inset);
///
virtual bool insetAllowed(Inset::Code code) const {
virtual bool insetAllowed(InsetOld::Code code) const {
return inset.insetAllowed(code);
}
///
@ -70,7 +70,7 @@ public:
bool unlockInsetInInset(BufferView *, UpdatableInset *,
bool lr = false);
///
bool updateInsetInInset(BufferView *, Inset *);
bool updateInsetInInset(BufferView *, InsetOld *);
///
int insetInInsetY() const;
///
@ -96,7 +96,7 @@ public:
}
UpdatableInset * getLockingInset() const;
///
UpdatableInset * getFirstLockingInsetOfType(Inset::Code);
UpdatableInset * getFirstLockingInsetOfType(InsetOld::Code);
///
void setFont(BufferView *, LyXFont const &, bool toggleall = false,
bool selectall = false);
@ -129,7 +129,7 @@ public:
UpdatableInset::scroll(bv, offset);
}
///
Inset * getInsetFromID(int id) const;
InsetOld * getInsetFromID(int id) const;
///
ParagraphList * getParagraphs(int) const;
///

View File

@ -27,7 +27,7 @@
*/
///
class InsetCommand : public Inset {
class InsetCommand : public InsetOld {
public:
///
explicit
@ -54,7 +54,7 @@ public:
///
virtual int docbook(Buffer const *, std::ostream &, bool) const;
///
Inset::Code lyxCode() const { return Inset::NO_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
///
InsetCommandParams const & params() const { return p_; }

View File

@ -28,14 +28,14 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::ENVIRONMENT_CODE; }
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;
///
string const editMessage() const;
///
Inset::EDITABLE editable() const { return HIGHLY_EDITABLE; }
InsetOld::EDITABLE editable() const { return HIGHLY_EDITABLE; }
///
bool isTextInset() const { return true; }
///

View File

@ -211,7 +211,7 @@ void InsetERT::write(Buffer const * buf, ostream & os) const
Paragraph::value_type c = par->getChar(i);
switch (c) {
case Paragraph::META_INSET:
if (par->getInset(i)->lyxCode() != Inset::NEWLINE_CODE) {
if (par->getInset(i)->lyxCode() != InsetOld::NEWLINE_CODE) {
lyxerr << "Element is not allowed in insertERT"
<< endl;
} else {
@ -237,7 +237,7 @@ string const InsetERT::editMessage() const
}
bool InsetERT::insertInset(BufferView *, Inset *)
bool InsetERT::insertInset(BufferView *, InsetOld *)
{
return false;
}
@ -268,7 +268,7 @@ void InsetERT::updateStatus(BufferView * bv, bool swap) const
}
Inset::EDITABLE InsetERT::editable() const
InsetOld::EDITABLE InsetERT::editable() const
{
if (status_ == Collapsed)
return IS_EDITABLE;
@ -416,9 +416,9 @@ int InsetERT::docbook(Buffer const *, ostream & os, bool) const
}
Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
InsetOld::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
{
Inset::RESULT result = UNDISPATCHED;
InsetOld::RESULT result = UNDISPATCHED;
BufferView * bv = cmd.view();
if (inset.paragraphs.begin()->empty()) {

View File

@ -47,7 +47,7 @@ public:
///
~InsetERT();
///
Inset::Code lyxCode() const { return Inset::ERT_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::ERT_CODE; }
///
void read(Buffer const * buf, LyXLex & lex);
///
@ -55,9 +55,9 @@ public:
///
string const editMessage() const;
///
bool insertInset(BufferView *, Inset *);
bool insertInset(BufferView *, InsetOld *);
///
bool insetAllowed(Inset::Code code) const { return code == Inset::NEWLINE_CODE; }
bool insetAllowed(InsetOld::Code code) const { return code == InsetOld::NEWLINE_CODE; }
///
void setFont(BufferView *, LyXFont const &,
bool toggleall = false, bool selectall = false);
@ -109,7 +109,7 @@ public:
///
void getDrawFont(LyXFont &) const;
///
bool forceDefaultParagraphs(Inset const *) const {
bool forceDefaultParagraphs(InsetOld const *) const {
return true;
}

View File

@ -89,7 +89,7 @@ InsetExternal::InsetExternal()
InsetExternal::InsetExternal(InsetExternal const & other)
: Inset(other),
: InsetOld(other),
boost::signals::trackable(),
params_(other.params_),
renderer_(other.renderer_->clone())

View File

@ -24,7 +24,7 @@
class RenderInset;
///
class InsetExternal : public Inset, public boost::signals::trackable {
class InsetExternal : public InsetOld, public boost::signals::trackable {
public:
/// hold parameters settable from the GUI
struct Params {
@ -79,7 +79,7 @@ public:
virtual void validate(LaTeXFeatures & features) const;
/// returns LyX code associated with the inset. Used for TOC, ...)
virtual Inset::Code lyxCode() const { return EXTERNAL_CODE; }
virtual InsetOld::Code lyxCode() const { return EXTERNAL_CODE; }
///
virtual std::auto_ptr<InsetBase> clone() const;

View File

@ -162,7 +162,7 @@ InsetFloat::~InsetFloat()
dispatch_result InsetFloat::localDispatch(FuncRequest const & cmd)
{
Inset::RESULT result = UNDISPATCHED;
InsetOld::RESULT result = UNDISPATCHED;
switch (cmd.action) {
case LFUN_INSET_MODIFY: {
@ -326,13 +326,13 @@ int InsetFloat::docbook(Buffer const * buf, ostream & os, bool mixcont) const
}
bool InsetFloat::insetAllowed(Inset::Code code) const
bool InsetFloat::insetAllowed(InsetOld::Code code) const
{
if (code == Inset::FLOAT_CODE)
if (code == InsetOld::FLOAT_CODE)
return false;
if (inset.getLockingInset() != const_cast<InsetFloat *>(this))
return inset.insetAllowed(code);
if ((code == Inset::FOOT_CODE) || (code == Inset::MARGIN_CODE))
if ((code == InsetOld::FOOT_CODE) || (code == InsetOld::MARGIN_CODE))
return false;
return true;
}

View File

@ -55,7 +55,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;
@ -64,7 +64,7 @@ public:
///
string const editMessage() const;
///
bool insetAllowed(Inset::Code) const;
bool insetAllowed(InsetOld::Code) const;
/** returns true if, when outputing LaTeX, font changes should
be closed before generating this inset. This is needed for
insets that may contain several paragraphs */

View File

@ -60,9 +60,9 @@ string const InsetFloatList::getScreenLabel(Buffer const * buf) const
}
Inset::Code InsetFloatList::lyxCode() const
InsetOld::Code InsetFloatList::lyxCode() const
{
return Inset::FLOAT_LIST_CODE;
return InsetOld::FLOAT_LIST_CODE;
}

View File

@ -38,7 +38,7 @@ public:
///
bool display() const { return true; }
///
Inset::Code lyxCode() const;
InsetOld::Code lyxCode() const;
///
void write(Buffer const *, std::ostream &) const;
///

View File

@ -29,7 +29,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::FOOT_CODE; }
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;

View File

@ -49,10 +49,10 @@ void InsetFootlike::write(Buffer const * buf, ostream & os) const
}
bool InsetFootlike::insetAllowed(Inset::Code code) const
bool InsetFootlike::insetAllowed(InsetOld::Code code) const
{
if ((code == Inset::FOOT_CODE) || (code == Inset::MARGIN_CODE)
|| (code == Inset::FLOAT_CODE))
if ((code == InsetOld::FOOT_CODE) || (code == InsetOld::MARGIN_CODE)
|| (code == InsetOld::FLOAT_CODE))
return false;
return InsetCollapsable::insetAllowed(code);
}

View File

@ -26,7 +26,7 @@ public:
///
void write(Buffer const * buf, std::ostream & os) const;
///
bool insetAllowed(Inset::Code) const;
bool insetAllowed(InsetOld::Code) const;
/** returns true if, when outputing LaTeX, font changes should
be closed before generating this inset. This is needed for
insets that may contain several paragraphs */

View File

@ -144,7 +144,7 @@ InsetGraphics::InsetGraphics()
InsetGraphics::InsetGraphics(InsetGraphics const & ig)
: Inset(ig),
: InsetOld(ig),
boost::signals::trackable(),
graphic_label(uniqueID()),
graphic_(new GraphicRenderer(*ig.graphic_))
@ -198,7 +198,7 @@ dispatch_result InsetGraphics::localDispatch(FuncRequest const & cmd)
return DISPATCHED;
default:
return Inset::localDispatch(cmd);
return InsetOld::localDispatch(cmd);
}
}
@ -216,7 +216,7 @@ void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
}
Inset::EDITABLE InsetGraphics::editable() const
InsetOld::EDITABLE InsetGraphics::editable() const
{
return IS_EDITABLE;
}

View File

@ -25,7 +25,7 @@ class GraphicRenderer;
class LaTeXFeatures;
///
class InsetGraphics : public Inset, public boost::signals::trackable {
class InsetGraphics : public InsetOld, public boost::signals::trackable {
public:
///
InsetGraphics();
@ -65,7 +65,7 @@ public:
void validate(LaTeXFeatures & features) const;
/// returns LyX code associated with the inset. Used for TOC, ...)
Inset::Code lyxCode() const { return Inset::GRAPHICS_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::GRAPHICS_CODE; }
///
virtual std::auto_ptr<InsetBase> clone() const;

View File

@ -26,7 +26,7 @@ public:
///
string const getScreenLabel(Buffer const *) const { return getContents(); }
///
Inset::Code lyxCode() const { return Inset::HFILL_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::HFILL_CODE; }
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;

View File

@ -113,7 +113,7 @@ InsetInclude::InsetInclude(InsetCommandParams const & p, Buffer const & b)
InsetInclude::InsetInclude(InsetInclude const & other)
: Inset(other),
: InsetOld(other),
params_(other.params_),
include_label(other.include_label),
preview_(new PreviewImpl(*this)),
@ -153,7 +153,7 @@ dispatch_result InsetInclude::localDispatch(FuncRequest const & cmd)
return DISPATCHED;
default:
return Inset::localDispatch(cmd);
return InsetOld::localDispatch(cmd);
}
}

View File

@ -24,7 +24,7 @@ struct LaTeXFeatures;
// Created by AAS 970521
/// for including tex/lyx files
class InsetInclude: public Inset {
class InsetInclude: public InsetOld {
public:
/// the type of inclusion
enum Flags {
@ -76,7 +76,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::INCLUDE_CODE; }
/// This returns the list of labels on the child buffer
void getLabelList(std::vector<string> &) const;
/// This returns the list of bibkeys on the child buffer

View File

@ -65,9 +65,9 @@ int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
}
Inset::Code InsetIndex::lyxCode() const
InsetOld::Code InsetIndex::lyxCode() const
{
return Inset::INDEX_CODE;
return InsetOld::INDEX_CODE;
}
@ -98,7 +98,7 @@ void InsetPrintIndex::validate(LaTeXFeatures & features) const
}
Inset::Code InsetPrintIndex::lyxCode() const
InsetOld::Code InsetPrintIndex::lyxCode() const
{
return Inset::INDEX_PRINT_CODE;
return InsetOld::INDEX_PRINT_CODE;
}

View File

@ -36,7 +36,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
Inset::Code lyxCode() const;
InsetOld::Code lyxCode() const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
};
@ -61,7 +61,7 @@ public:
///
bool display() const { return true; }
///
Inset::Code lyxCode() const;
InsetOld::Code lyxCode() const;
///
string const getScreenLabel(Buffer const *) const;
///

View File

@ -53,7 +53,7 @@ void InsetLabel::getLabelList(std::vector<string> & list) const
dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
{
Inset::RESULT result = UNDISPATCHED;
InsetOld::RESULT result = UNDISPATCHED;
switch (cmd.action) {

View File

@ -32,7 +32,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
Inset::Code lyxCode() const { return Inset::LABEL_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::LABEL_CODE; }
///
void getLabelList(std::vector<string> &) const;
///

View File

@ -656,9 +656,9 @@ auto_ptr<InsetBase> InsetLatexAccent::clone() const
}
Inset::Code InsetLatexAccent::lyxCode() const
InsetOld::Code InsetLatexAccent::lyxCode() const
{
return Inset::ACCENT_CODE;
return InsetOld::ACCENT_CODE;
}

View File

@ -24,7 +24,7 @@
it also can handle other special characters (e.g. Hstroke)
Initiated by Ivan Schreter, later modified by Lgb.
*/
class InsetLatexAccent : public Inset {
class InsetLatexAccent : public InsetOld {
public:
///
InsetLatexAccent();
@ -59,7 +59,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode()const;
InsetOld::Code lyxCode()const;
///
inline bool canDisplay();
// should this inset be handled like a normal charater

View File

@ -28,7 +28,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::MARGIN_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::MARGIN_CODE; }
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;

View File

@ -276,9 +276,9 @@ int InsetMinipage::latex(Buffer const * buf, ostream & os,
}
bool InsetMinipage::insetAllowed(Inset::Code code) const
bool InsetMinipage::insetAllowed(InsetOld::Code code) const
{
if (code == Inset::FLOAT_CODE || code == Inset::MARGIN_CODE)
if (code == InsetOld::FLOAT_CODE || code == InsetOld::MARGIN_CODE)
return false;
return InsetCollapsable::insetAllowed(code);

View File

@ -70,14 +70,14 @@ public:
///
void metrics(MetricsInfo &, Dimension &) const;
///
Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::MINIPAGE_CODE; }
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;
///
string const editMessage() const;
///
bool insetAllowed(Inset::Code) const;
bool insetAllowed(InsetOld::Code) const;
///
bool needFullRow() const { return false; }
/** returns true if, when outputing LaTeX, font changes should

View File

@ -15,7 +15,7 @@
#include "inset.h"
class InsetNewline : public Inset {
class InsetNewline : public InsetOld {
public:
InsetNewline() {}
@ -24,7 +24,7 @@ public:
return std::auto_ptr<InsetBase>(new InsetNewline);
}
Inset::Code lyxCode() const { return Inset::NEWLINE_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::NEWLINE_CODE; }
void metrics(MetricsInfo &, Dimension &) const;

View File

@ -44,7 +44,7 @@ public:
///
string const editMessage() const;
///
Inset::Code lyxCode() const { return Inset::NOTE_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::NOTE_CODE; }
///
void write(Buffer const *, std::ostream &) const;
///

View File

@ -31,7 +31,7 @@ public:
/// this inset is editable
EDITABLE editable() const { return IS_EDITABLE; }
/// code of the inset
Inset::Code lyxCode() const { return Inset::OPTARG_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::OPTARG_CODE; }
/// return an message upon editing
string const editMessage() const;

View File

@ -361,7 +361,7 @@ auto_ptr<InsetBase> InsetQuotes::clone() const
}
Inset::Code InsetQuotes::lyxCode() const
InsetOld::Code InsetQuotes::lyxCode() const
{
return Inset::QUOTE_CODE;
return InsetOld::QUOTE_CODE;
}

View File

@ -24,7 +24,7 @@ struct LaTeXFeatures;
/** Quotes.
Used for the various quotes. German, English, French, all either
double or single **/
class InsetQuotes : public Inset {
class InsetQuotes : public InsetOld {
public:
///
enum quote_language {
@ -93,7 +93,7 @@ public:
///
void validate(LaTeXFeatures &) const;
///
Inset::Code lyxCode() const;
InsetOld::Code lyxCode() const;
// should this inset be handled like a normal charater
bool isChar() const { return true; }

View File

@ -52,7 +52,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
Inset::Code lyxCode() const { return Inset::REF_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::REF_CODE; }
///
bool display() const { return false; }
///

View File

@ -22,7 +22,7 @@
struct LaTeXFeatures;
/// Used to insert different kinds of spaces
class InsetSpace : public Inset {
class InsetSpace : public InsetOld {
public:
/// The different kinds of spaces we support
@ -73,7 +73,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::SPACE_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::SPACE_CODE; }
/// We don't need \begin_inset and \end_inset
bool directWrite() const { return true; }

View File

@ -21,7 +21,7 @@
struct LaTeXFeatures;
/// Used to insert special chars
class InsetSpecialChar : public Inset {
class InsetSpecialChar : public InsetOld {
public:
/// The different kinds of special chars we support
@ -65,7 +65,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::SPECIALCHAR_CODE; }
/// We don't need \begin_inset and \end_inset
bool directWrite() const { return true; }
///

View File

@ -524,9 +524,9 @@ bool InsetTabular::unlockInsetInInset(BufferView * bv, UpdatableInset * inset,
}
bool InsetTabular::updateInsetInInset(BufferView * bv, Inset * inset)
bool InsetTabular::updateInsetInInset(BufferView * bv, InsetOld * inset)
{
Inset * tl_inset = inset;
InsetOld * tl_inset = inset;
// look if this inset is really inside myself!
while(tl_inset->owner() && tl_inset->owner() != this)
tl_inset = tl_inset->owner();
@ -558,7 +558,7 @@ UpdatableInset * InsetTabular::getLockingInset() const
}
UpdatableInset * InsetTabular::getFirstLockingInsetOfType(Inset::Code c)
UpdatableInset * InsetTabular::getFirstLockingInsetOfType(InsetOld::Code c)
{
if (c == lyxCode())
return this;
@ -568,7 +568,7 @@ UpdatableInset * InsetTabular::getFirstLockingInsetOfType(Inset::Code c)
}
bool InsetTabular::insertInset(BufferView * bv, Inset * inset)
bool InsetTabular::insertInset(BufferView * bv, InsetOld * inset)
{
if (the_locking_inset)
return the_locking_inset->insertInset(bv, inset);
@ -688,7 +688,7 @@ void InsetTabular::lfunMouseMotion(FuncRequest const & cmd)
}
Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
InsetOld::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
{
// We need to save the value of the_locking_inset as the call to
// the_locking_inset->localDispatch might unlock it.
@ -750,7 +750,7 @@ Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
result = DISPATCHED;
// this one have priority over the locked InsetText, if we're not already
// inside another tabular then that one get's priority!
if (getFirstLockingInsetOfType(Inset::TABULAR_CODE) == this) {
if (getFirstLockingInsetOfType(InsetOld::TABULAR_CODE) == this) {
switch (cmd.action) {
case LFUN_MOUSE_PRESS:
lfunMousePress(cmd);
@ -1191,12 +1191,12 @@ int InsetTabular::linuxdoc(Buffer const * buf, ostream & os) const
int InsetTabular::docbook(Buffer const * buf, ostream & os, bool mixcont) const
{
int ret = 0;
Inset * master;
InsetOld * master;
// if the table is inside a float it doesn't need the informaltable
// wrapper. Search for it.
for(master = owner();
master && master->lyxCode() != Inset::FLOAT_CODE;
master && master->lyxCode() != InsetOld::FLOAT_CODE;
master = master->owner());
if (!master) {
@ -1448,7 +1448,7 @@ void InsetTabular::resetPos(BufferView * bv) const
}
Inset::RESULT InsetTabular::moveRight(BufferView * bv, bool lock)
InsetOld::RESULT InsetTabular::moveRight(BufferView * bv, bool lock)
{
if (lock && !old_locking_inset) {
if (activateCellInset(bv))
@ -1466,7 +1466,7 @@ Inset::RESULT InsetTabular::moveRight(BufferView * bv, bool lock)
}
Inset::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock)
InsetOld::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock)
{
bool moved = isRightToLeft(bv) ? moveNextCell(bv) : movePrevCell(bv);
if (!moved)
@ -1480,7 +1480,7 @@ Inset::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock)
}
Inset::RESULT InsetTabular::moveUp(BufferView * bv, bool lock)
InsetOld::RESULT InsetTabular::moveUp(BufferView * bv, bool lock)
{
int const ocell = actcell;
actcell = tabular.getCellAbove(actcell);
@ -1501,7 +1501,7 @@ Inset::RESULT InsetTabular::moveUp(BufferView * bv, bool lock)
}
Inset::RESULT InsetTabular::moveDown(BufferView * bv, bool lock)
InsetOld::RESULT InsetTabular::moveDown(BufferView * bv, bool lock)
{
int const ocell = actcell;
actcell = tabular.getCellBelow(actcell);
@ -2077,7 +2077,7 @@ LyXText * InsetTabular::getLyXText(BufferView const * bv,
{
if (the_locking_inset)
return the_locking_inset->getLyXText(bv, recursive);
return Inset::getLyXText(bv, recursive);
return InsetOld::getLyXText(bv, recursive);
}
@ -2430,18 +2430,18 @@ LyXCursor const & InsetTabular::cursor(BufferView * bv) const
{
if (the_locking_inset)
return the_locking_inset->cursor(bv);
return Inset::cursor(bv);
return InsetOld::cursor(bv);
}
Inset * InsetTabular::getInsetFromID(int id_arg) const
InsetOld * InsetTabular::getInsetFromID(int id_arg) const
{
if (id_arg == id())
return const_cast<InsetTabular *>(this);
for (int i = 0; i < tabular.rows(); ++i) {
for (int j = 0; j < tabular.columns(); ++j) {
Inset * inset = tabular.getCellInset(i, j).getInsetFromID(id_arg);
InsetOld * inset = tabular.getCellInset(i, j).getInsetFromID(id_arg);
if (inset)
return inset;
}
@ -2603,7 +2603,7 @@ bool InsetTabular::searchBackward(BufferView * bv, string const & str,
}
bool InsetTabular::insetAllowed(Inset::Code code) const
bool InsetTabular::insetAllowed(InsetOld::Code code) const
{
if (the_locking_inset)
return the_locking_inset->insetAllowed(code);
@ -2614,7 +2614,7 @@ bool InsetTabular::insetAllowed(Inset::Code code) const
}
bool InsetTabular::forceDefaultParagraphs(Inset const * in) const
bool InsetTabular::forceDefaultParagraphs(InsetOld const * in) const
{
const int cell = tabular.getCellFromInset(in, actcell);

View File

@ -96,17 +96,17 @@ public:
bool unlockInsetInInset(BufferView *, UpdatableInset *,
bool lr = false);
///
bool updateInsetInInset(BufferView *, Inset *);
bool updateInsetInInset(BufferView *, InsetOld *);
///
int insetInInsetY() const;
///
UpdatableInset * getLockingInset() const;
///
UpdatableInset * getFirstLockingInsetOfType(Inset::Code);
UpdatableInset * getFirstLockingInsetOfType(InsetOld::Code);
///
bool insertInset(BufferView *, Inset *);
bool insertInset(BufferView *, InsetOld *);
///
bool insetAllowed(Inset::Code code) const;
bool insetAllowed(InsetOld::Code code) const;
///
bool isTextInset() const { return true; }
/** returns true if, when outputing LaTeX, font changes should
@ -129,7 +129,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
Inset::Code lyxCode() const { return Inset::TABULAR_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::TABULAR_CODE; }
/// FIXME, document
void getCursorPos(BufferView *, int & x, int & y) const;
/// Get the absolute document x,y of the cursor
@ -175,7 +175,7 @@ public:
UpdatableInset::scroll(bv, offset);
}
///
Inset * getInsetFromID(int id) const;
InsetOld * getInsetFromID(int id) const;
///
ParagraphList * getParagraphs(int) const;
///
@ -202,7 +202,7 @@ public:
// this should return true if we have a "normal" cell, otherwise true.
// "normal" means without width set!
bool forceDefaultParagraphs(Inset const * in) const;
bool forceDefaultParagraphs(InsetOld const * in) const;
///
void addPreview(lyx::graphics::PreviewLoader &) const;

View File

@ -277,7 +277,7 @@ void InsetText::read(Buffer const * buf, LyXLex & lex)
void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
{
//lyxerr << "InsetText::metrics: width: " << mi.base.textwidth << "\n";
textwidth_ = mi.base.textwidth;
BufferView * bv = mi.base.bv;
setViewCache(bv);
@ -607,7 +607,7 @@ bool InsetText::unlockInsetInInset(BufferView * bv, UpdatableInset * inset,
}
bool InsetText::updateInsetInInset(BufferView * bv, Inset * inset)
bool InsetText::updateInsetInInset(BufferView * bv, InsetOld * inset)
{
if (!autoBreakRows && paragraphs.size() > 1)
collapseParagraphs(bv);
@ -667,7 +667,7 @@ void InsetText::lfunMousePress(FuncRequest const & cmd)
int tmp_x = cmd.x - drawTextXOffset;
int tmp_y = cmd.y + dim_.asc - getLyXText(bv)->top_y();
Inset * inset = getLyXText(bv)->checkInsetHit(tmp_x, tmp_y);
InsetOld * inset = getLyXText(bv)->checkInsetHit(tmp_x, tmp_y);
if (the_locking_inset) {
if (the_locking_inset == inset) {
@ -751,7 +751,7 @@ bool InsetText::lfunMouseRelease(FuncRequest const & cmd)
int tmp_x = cmd.x - drawTextXOffset;
int tmp_y = cmd.y + dim_.asc - getLyXText(bv)->top_y();
Inset * inset = getLyXText(bv)->checkInsetHit(tmp_x, tmp_y);
InsetOld * inset = getLyXText(bv)->checkInsetHit(tmp_x, tmp_y);
bool ret = false;
if (inset) {
// This code should probably be removed now. Simple insets
@ -809,7 +809,7 @@ void InsetText::lfunMouseMotion(FuncRequest const & cmd)
}
Inset::RESULT InsetText::localDispatch(FuncRequest const & cmd)
InsetOld::RESULT InsetText::localDispatch(FuncRequest const & cmd)
{
BufferView * bv = cmd.view();
setViewCache(bv);
@ -1521,7 +1521,7 @@ void InsetText::fitInsetCursor(BufferView * bv) const
}
Inset::RESULT
InsetOld::RESULT
InsetText::moveRight(BufferView * bv, bool activate_inset, bool selecting)
{
if (text_.cursor.par()->isRightToLeftPar(bv->buffer()->params))
@ -1531,7 +1531,7 @@ InsetText::moveRight(BufferView * bv, bool activate_inset, bool selecting)
}
Inset::RESULT
InsetOld::RESULT
InsetText::moveLeft(BufferView * bv, bool activate_inset, bool selecting)
{
if (text_.cursor.par()->isRightToLeftPar(bv->buffer()->params))
@ -1541,7 +1541,7 @@ InsetText::moveLeft(BufferView * bv, bool activate_inset, bool selecting)
}
Inset::RESULT
InsetOld::RESULT
InsetText::moveRightIntern(BufferView * bv, bool front,
bool activate_inset, bool selecting)
{
@ -1558,7 +1558,7 @@ InsetText::moveRightIntern(BufferView * bv, bool front,
}
Inset::RESULT
InsetOld::RESULT
InsetText::moveLeftIntern(BufferView * bv, bool front,
bool activate_inset, bool selecting)
{
@ -1573,7 +1573,7 @@ InsetText::moveLeftIntern(BufferView * bv, bool front,
}
Inset::RESULT InsetText::moveUp(BufferView * bv)
InsetOld::RESULT InsetText::moveUp(BufferView * bv)
{
if (crow() == text_.rows().begin())
return FINISHED_UP;
@ -1583,7 +1583,7 @@ Inset::RESULT InsetText::moveUp(BufferView * bv)
}
Inset::RESULT InsetText::moveDown(BufferView * bv)
InsetOld::RESULT InsetText::moveDown(BufferView * bv)
{
if (boost::next(crow()) == text_.rows().end())
return FINISHED_DOWN;
@ -1593,7 +1593,7 @@ Inset::RESULT InsetText::moveDown(BufferView * bv)
}
bool InsetText::insertInset(BufferView * bv, Inset * inset)
bool InsetText::insertInset(BufferView * bv, InsetOld * inset)
{
if (the_locking_inset) {
if (the_locking_inset->insetAllowed(inset))
@ -1608,7 +1608,7 @@ bool InsetText::insertInset(BufferView * bv, Inset * inset)
}
bool InsetText::insetAllowed(Inset::Code code) const
bool InsetText::insetAllowed(InsetOld::Code code) const
{
// in_insetAllowed is a really gross hack,
// to allow us to call the owner's insetAllowed
@ -1634,7 +1634,7 @@ UpdatableInset * InsetText::getLockingInset() const
}
UpdatableInset * InsetText::getFirstLockingInsetOfType(Inset::Code c)
UpdatableInset * InsetText::getFirstLockingInsetOfType(InsetOld::Code c)
{
if (c == lyxCode())
return this;
@ -1709,7 +1709,7 @@ void InsetText::setFont(BufferView * bv, LyXFont const & font, bool toggleall,
bool InsetText::checkAndActivateInset(BufferView * bv, bool front)
{
if (cpar()->isInset(cpos())) {
Inset * inset =
InsetOld * inset =
static_cast<UpdatableInset*>(cpar()->getInset(cpos()));
if (!isHighlyEditableInset(inset))
return false;
@ -1730,7 +1730,7 @@ bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
x -= drawTextXOffset;
int dummyx = x;
int dummyy = y + dim_.asc;
Inset * inset = getLyXText(bv)->checkInsetHit(dummyx, dummyy);
InsetOld * inset = getLyXText(bv)->checkInsetHit(dummyx, dummyy);
// we only do the edit() call if the inset was hit by the mouse
// or if it is a highly editable inset. So we should call this
// function from our own edit with button < 0.
@ -2078,7 +2078,7 @@ LyXCursor const & InsetText::cursor(BufferView * bv) const
}
Inset * InsetText::getInsetFromID(int id_arg) const
InsetOld * InsetText::getInsetFromID(int id_arg) const
{
if (id_arg == id())
return const_cast<InsetText *>(this);
@ -2091,7 +2091,7 @@ Inset * InsetText::getInsetFromID(int id_arg) const
for (; it != end; ++it) {
if (it->inset->id() == id_arg)
return it->inset;
Inset * in = it->inset->getInsetFromID(id_arg);
InsetOld * in = it->inset->getInsetFromID(id_arg);
if (in)
return in;
}

View File

@ -105,7 +105,7 @@ public:
bool unlockInsetInInset(BufferView *,
UpdatableInset *, bool lr = false);
///
bool updateInsetInInset(BufferView *, Inset *);
bool updateInsetInInset(BufferView *, InsetOld *);
///
RESULT localDispatch(FuncRequest const &);
///
@ -120,7 +120,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
Inset::Code lyxCode() const { return Inset::TEXT_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::TEXT_CODE; }
/// FIXME, document
void getCursorPos(BufferView *, int & x, int & y) const;
/// Get the absolute document x,y of the cursor
@ -130,13 +130,13 @@ public:
///
void fitInsetCursor(BufferView *) const;
///
bool insertInset(BufferView *, Inset *);
bool insertInset(BufferView *, InsetOld *);
///
bool insetAllowed(Inset::Code) const;
bool insetAllowed(InsetOld::Code) const;
///
UpdatableInset * getLockingInset() const;
///
UpdatableInset * getFirstLockingInsetOfType(Inset::Code);
UpdatableInset * getFirstLockingInsetOfType(InsetOld::Code);
///
void setFont(BufferView *, LyXFont const &,
bool toggleall = false,
@ -185,7 +185,7 @@ public:
///
void clearSelection(BufferView * bv);
///
Inset * getInsetFromID(int id) const;
InsetOld * getInsetFromID(int id) const;
///
ParagraphList * getParagraphs(int) const;
///

View File

@ -45,12 +45,12 @@ string const InsetTOC::getScreenLabel(Buffer const *) const
}
Inset::Code InsetTOC::lyxCode() const
InsetOld::Code InsetTOC::lyxCode() const
{
string const cmdname(getCmdName());
if (cmdname == "tableofcontents")
return Inset::TOC_CODE;
return Inset::NO_CODE;
return InsetOld::TOC_CODE;
return InsetOld::NO_CODE;
}

View File

@ -36,7 +36,7 @@ public:
///
bool display() const { return true; }
///
Inset::Code lyxCode() const;
InsetOld::Code lyxCode() const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
///

View File

@ -33,7 +33,7 @@ public:
///
dispatch_result localDispatch(FuncRequest const & cmd);
///
Inset::Code lyxCode() const { return Inset::URL_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::URL_CODE; }
///
void validate(LaTeXFeatures &) const;
///

View File

@ -205,7 +205,7 @@ int InsetWrap::docbook(Buffer const * buf, ostream & os, bool mixcont) const
}
bool InsetWrap::insetAllowed(Inset::Code code) const
bool InsetWrap::insetAllowed(InsetOld::Code code) const
{
switch(code) {
case FLOAT_CODE:

View File

@ -52,7 +52,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
InsetOld::Code lyxCode() const { return InsetOld::WRAP_CODE; }
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;
@ -61,7 +61,7 @@ public:
///
string const editMessage() const;
///
bool insetAllowed(Inset::Code) const;
bool insetAllowed(InsetOld::Code) const;
///
void addToToc(toc::TocList &, Buffer const *) const;
///

View File

@ -201,7 +201,7 @@ void GraphicRenderer::metrics(MetricsInfo & mi, Dimension & dim) const
if (image_ready) {
dim.wid = loader_.image()->getWidth() +
2 * Inset::TEXT_TO_INSET_OFFSET;
2 * InsetOld::TEXT_TO_INSET_OFFSET;
} else {
int font_width = 0;
@ -270,16 +270,16 @@ void GraphicRenderer::draw(PainterInfo & pi, int x, int y) const
// we draw just a rectangle.
if (readyToDisplay()) {
pi.pain.image(x + Inset::TEXT_TO_INSET_OFFSET,
pi.pain.image(x + InsetOld::TEXT_TO_INSET_OFFSET,
y - dim_.asc,
dim_.wid - 2 * Inset::TEXT_TO_INSET_OFFSET,
dim_.wid - 2 * InsetOld::TEXT_TO_INSET_OFFSET,
dim_.asc + dim_.des,
*loader_.image());
} else {
pi.pain.rectangle(x + Inset::TEXT_TO_INSET_OFFSET,
pi.pain.rectangle(x + InsetOld::TEXT_TO_INSET_OFFSET,
y - dim_.asc,
dim_.wid - 2 * Inset::TEXT_TO_INSET_OFFSET,
dim_.wid - 2 * InsetOld::TEXT_TO_INSET_OFFSET,
dim_.asc + dim_.des);
// Print the file name.
@ -289,7 +289,7 @@ void GraphicRenderer::draw(PainterInfo & pi, int x, int y) const
if (!justname.empty()) {
msgFont.setSize(LyXFont::SIZE_FOOTNOTE);
pi.pain.text(x + Inset::TEXT_TO_INSET_OFFSET + 6,
pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6,
y - font_metrics::maxAscent(msgFont) - 4,
justname, msgFont);
}
@ -298,7 +298,7 @@ void GraphicRenderer::draw(PainterInfo & pi, int x, int y) const
string const msg = statusMessage();
if (!msg.empty()) {
msgFont.setSize(LyXFont::SIZE_TINY);
pi.pain.text(x + Inset::TEXT_TO_INSET_OFFSET + 6,
pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6,
y - 4, msg, msgFont);
}
}

View File

@ -27,12 +27,12 @@ using namespace lyx::support;
// some stuff for inset locking
UpdatableInset::UpdatableInset()
: Inset(), block_drawing_(false)
: InsetOld(), block_drawing_(false)
{}
UpdatableInset::UpdatableInset(UpdatableInset const & in)
: Inset(in), block_drawing_(false)
: InsetOld(in), block_drawing_(false)
{}
@ -43,7 +43,7 @@ void UpdatableInset::insetUnlock(BufferView *)
// An updatable inset is highly editable by definition
Inset::EDITABLE UpdatableInset::editable() const
InsetOld::EDITABLE UpdatableInset::editable() const
{
return HIGHLY_EDITABLE;
}
@ -63,7 +63,7 @@ void UpdatableInset::draw(PainterInfo &, int, int) const
void UpdatableInset::scroll(BufferView * bv, float s) const
{
LyXFont font;
//LyXFont font;
if (!s) {
scx = 0;
@ -112,7 +112,7 @@ void UpdatableInset::scroll(BufferView * bv, int offset) const
/// An updatable inset could handle lyx editing commands
Inset::RESULT UpdatableInset::localDispatch(FuncRequest const & ev)
InsetOld::RESULT UpdatableInset::localDispatch(FuncRequest const & ev)
{
if (ev.action == LFUN_MOUSE_RELEASE)
return (editable() == IS_EDITABLE) ? DISPATCHED : UNDISPATCHED;
@ -133,7 +133,7 @@ Inset::RESULT UpdatableInset::localDispatch(FuncRequest const & ev)
}
LyXCursor const & Inset::cursor(BufferView * bv) const
LyXCursor const & InsetOld::cursor(BufferView * bv) const
{
if (owner())
return owner()->getLyXText(bv, false)->cursor;

View File

@ -33,7 +33,7 @@
*
* During the lock, all button and keyboard events will be modified
* and send to the inset through the following inset-features. Note that
* Inset::insetUnlock will be called from inside UnlockInset. It is meant
* InsetOld::insetUnlock will be called from inside UnlockInset. It is meant
* to contain the code for restoring the menus and things like this.
*
* If a inset wishes any redraw and/or update it just has to call
@ -44,7 +44,7 @@
* Of course the_locking_inset and the insets in the current paragraph/buffer
* are checked first, so no performance problem should occur.
*/
class UpdatableInset : public Inset {
class UpdatableInset : public InsetOld {
public:
///
UpdatableInset();
@ -68,18 +68,18 @@ public:
///
virtual void draw(PainterInfo & pi, int x, int y) const;
///
virtual bool insertInset(BufferView *, Inset *) { return false; }
virtual bool insertInset(BufferView *, InsetOld *) { return false; }
///
virtual UpdatableInset * getLockingInset() const {
return const_cast<UpdatableInset *>(this);
}
///
virtual UpdatableInset * getFirstLockingInsetOfType(Inset::Code c)
virtual UpdatableInset * getFirstLockingInsetOfType(InsetOld::Code c)
{ return (c == lyxCode()) ? this : 0; }
///
virtual int insetInInsetY() const { return 0; }
///
virtual bool updateInsetInInset(BufferView *, Inset *)
virtual bool updateInsetInInset(BufferView *, InsetOld *)
{ return false; }
///
virtual bool lockInsetInInset(BufferView *, UpdatableInset *)
@ -93,7 +93,7 @@ public:
///
int scroll(bool recursive = true) const {
// We need this method to not clobber the real method in Inset
return Inset::scroll(recursive);
return InsetOld::scroll(recursive);
}
///
virtual bool showInsetDialog(BufferView *) const { return false; }

View File

@ -335,8 +335,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
case LFUN_COPY:
if (tli) {
UpdatableInset * in = tli;
if (in->lyxCode() != Inset::TABULAR_CODE) {
in = tli->getFirstLockingInsetOfType(Inset::TABULAR_CODE);
if (in->lyxCode() != InsetOld::TABULAR_CODE) {
in = tli->getFirstLockingInsetOfType(InsetOld::TABULAR_CODE);
}
if (in && static_cast<InsetTabular*>(in)->hasSelection()) {
disable = false;
@ -354,8 +354,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
case LFUN_LAYOUT_TABULAR:
disable = !tli
|| (tli->lyxCode() != Inset::TABULAR_CODE
&& !tli->getFirstLockingInsetOfType(Inset::TABULAR_CODE));
|| (tli->lyxCode() != InsetOld::TABULAR_CODE
&& !tli->getFirstLockingInsetOfType(InsetOld::TABULAR_CODE));
break;
case LFUN_DEPTH_MIN:
@ -368,7 +368,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
case LFUN_LAYOUT:
case LFUN_LAYOUT_PARAGRAPH: {
Inset * inset = TEXT(false)->cursor.par()->inInset();
InsetOld * inset = TEXT(false)->cursor.par()->inInset();
disable = inset && inset->forceDefaultParagraphs(inset);
break;
}
@ -422,14 +422,14 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
if (tli) {
FuncStatus ret;
//ret.disabled(true);
if (tli->lyxCode() == Inset::TABULAR_CODE) {
if (tli->lyxCode() == InsetOld::TABULAR_CODE) {
ret = static_cast<InsetTabular *>(tli)
->getStatus(ev.argument);
flag |= ret;
disable = false;
} else if (tli->getFirstLockingInsetOfType(Inset::TABULAR_CODE)) {
} else if (tli->getFirstLockingInsetOfType(InsetOld::TABULAR_CODE)) {
ret = static_cast<InsetTabular *>
(tli->getFirstLockingInsetOfType(Inset::TABULAR_CODE))
(tli->getFirstLockingInsetOfType(InsetOld::TABULAR_CODE))
->getStatus(ev.argument);
flag |= ret;
disable = false;
@ -495,27 +495,27 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
// jump back to owner if an InsetText, so
// we get back to the InsetTabular or whatever
if (inset->lyxCode() == Inset::TEXT_CODE)
if (inset->lyxCode() == InsetOld::TEXT_CODE)
inset = inset->owner();
Inset::Code code = inset->lyxCode();
InsetOld::Code code = inset->lyxCode();
switch (code) {
case Inset::TABULAR_CODE:
case InsetOld::TABULAR_CODE:
disable = ev.argument != "tabular";
break;
case Inset::ERT_CODE:
case InsetOld::ERT_CODE:
disable = ev.argument != "ert";
break;
case Inset::FLOAT_CODE:
case InsetOld::FLOAT_CODE:
disable = ev.argument != "float";
break;
case Inset::MINIPAGE_CODE:
case InsetOld::MINIPAGE_CODE:
disable = ev.argument != "minipage";
break;
case Inset::WRAP_CODE:
case InsetOld::WRAP_CODE:
disable = ev.argument != "wrap";
break;
case Inset::NOTE_CODE:
case InsetOld::NOTE_CODE:
disable = ev.argument != "note";
break;
default:
@ -558,7 +558,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
lyxrc.print_command == "none";
} else if (name == "character") {
UpdatableInset * tli = view()->theLockingInset();
disable = tli && tli->lyxCode() == Inset::ERT_CODE;
disable = tli && tli->lyxCode() == InsetOld::ERT_CODE;
} else if (name == "vclog") {
disable = !buf->lyxvc.inUse();
} else if (name == "latexlog") {
@ -572,101 +572,101 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
}
// the functions which insert insets
Inset::Code code = Inset::NO_CODE;
InsetOld::Code code = InsetOld::NO_CODE;
switch (ev.action) {
case LFUN_DIALOG_SHOW_NEW_INSET:
if (ev.argument == "bibitem")
code = Inset::BIBITEM_CODE;
code = InsetOld::BIBITEM_CODE;
else if (ev.argument == "bibtex")
code = Inset::BIBTEX_CODE;
code = InsetOld::BIBTEX_CODE;
else if (ev.argument == "citation")
code = Inset::CITE_CODE;
code = InsetOld::CITE_CODE;
else if (ev.argument == "ert")
code = Inset::ERT_CODE;
code = InsetOld::ERT_CODE;
else if (ev.argument == "external")
code = Inset::EXTERNAL_CODE;
code = InsetOld::EXTERNAL_CODE;
else if (ev.argument == "float")
code = Inset::FLOAT_CODE;
code = InsetOld::FLOAT_CODE;
else if (ev.argument == "graphics")
code = Inset::GRAPHICS_CODE;
code = InsetOld::GRAPHICS_CODE;
else if (ev.argument == "include")
code = Inset::INCLUDE_CODE;
code = InsetOld::INCLUDE_CODE;
else if (ev.argument == "index")
code = Inset::INDEX_CODE;
code = InsetOld::INDEX_CODE;
else if (ev.argument == "label")
code = Inset::LABEL_CODE;
code = InsetOld::LABEL_CODE;
else if (ev.argument == "minipage")
code = Inset::MINIPAGE_CODE;
code = InsetOld::MINIPAGE_CODE;
else if (ev.argument == "ref")
code = Inset::REF_CODE;
code = InsetOld::REF_CODE;
else if (ev.argument == "toc")
code = Inset::TOC_CODE;
code = InsetOld::TOC_CODE;
else if (ev.argument == "url")
code = Inset::URL_CODE;
code = InsetOld::URL_CODE;
else if (ev.argument == "wrap")
code = Inset::WRAP_CODE;
code = InsetOld::WRAP_CODE;
break;
case LFUN_INSET_ERT:
code = Inset::ERT_CODE;
code = InsetOld::ERT_CODE;
break;
case LFUN_INSET_FOOTNOTE:
code = Inset::FOOT_CODE;
code = InsetOld::FOOT_CODE;
break;
case LFUN_TABULAR_INSERT:
code = Inset::TABULAR_CODE;
code = InsetOld::TABULAR_CODE;
break;
case LFUN_INSET_MARGINAL:
code = Inset::MARGIN_CODE;
code = InsetOld::MARGIN_CODE;
break;
case LFUN_INSET_MINIPAGE:
code = Inset::MINIPAGE_CODE;
code = InsetOld::MINIPAGE_CODE;
break;
case LFUN_INSET_FLOAT:
case LFUN_INSET_WIDE_FLOAT:
code = Inset::FLOAT_CODE;
code = InsetOld::FLOAT_CODE;
break;
case LFUN_INSET_WRAP:
code = Inset::WRAP_CODE;
code = InsetOld::WRAP_CODE;
break;
case LFUN_FLOAT_LIST:
code = Inset::FLOAT_LIST_CODE;
code = InsetOld::FLOAT_LIST_CODE;
break;
#if 0
case LFUN_INSET_LIST:
code = Inset::LIST_CODE;
code = InsetOld::LIST_CODE;
break;
case LFUN_INSET_THEOREM:
code = Inset::THEOREM_CODE;
code = InsetOld::THEOREM_CODE;
break;
#endif
case LFUN_INSET_CAPTION:
code = Inset::CAPTION_CODE;
code = InsetOld::CAPTION_CODE;
break;
case LFUN_INSERT_NOTE:
code = Inset::NOTE_CODE;
code = InsetOld::NOTE_CODE;
break;
case LFUN_INSERT_LABEL:
code = Inset::LABEL_CODE;
code = InsetOld::LABEL_CODE;
break;
case LFUN_INSET_OPTARG:
code = Inset::OPTARG_CODE;
code = InsetOld::OPTARG_CODE;
break;
case LFUN_ENVIRONMENT_INSERT:
code = Inset::MINIPAGE_CODE;
code = InsetOld::MINIPAGE_CODE;
break;
case LFUN_INDEX_INSERT:
code = Inset::INDEX_CODE;
code = InsetOld::INDEX_CODE;
break;
case LFUN_INDEX_PRINT:
code = Inset::INDEX_PRINT_CODE;
code = InsetOld::INDEX_PRINT_CODE;
break;
case LFUN_TOC_INSERT:
code = Inset::TOC_CODE;
code = InsetOld::TOC_CODE;
break;
case LFUN_HTMLURL:
case LFUN_URL:
code = Inset::URL_CODE;
code = InsetOld::URL_CODE;
break;
case LFUN_QUOTE:
// always allow this, since we will inset a raw quote
@ -678,17 +678,17 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
case LFUN_MENU_SEPARATOR:
case LFUN_LDOTS:
case LFUN_END_OF_SENTENCE:
code = Inset::SPECIALCHAR_CODE;
code = InsetOld::SPECIALCHAR_CODE;
break;
case LFUN_SPACE_INSERT:
// slight hack: we know this is allowed in math mode
if (!mathcursor)
code = Inset::SPACE_CODE;
code = InsetOld::SPACE_CODE;
break;
default:
break;
}
if (code != Inset::NO_CODE && tli && !tli->insetAllowed(code))
if (code != InsetOld::NO_CODE && tli && !tli->insetAllowed(code))
disable = true;
if (disable)
@ -822,8 +822,10 @@ namespace {
return buf.isClean();
}
} //namespace anon
void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
{
lyxerr[Debug::ACTION] << "LyXFunc::dispatch: action[" << ev.action
@ -859,7 +861,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
view()->hideCursor();
if (view()->available() && view()->theLockingInset()) {
Inset::RESULT result;
InsetOld::RESULT result;
if ((action > 1) || ((action == LFUN_UNKNOWN_ACTION) &&
(!keyseq.deleted())))
{
@ -1299,14 +1301,14 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
case LFUN_LAYOUT_TABULAR:
if (view()->theLockingInset()) {
if (view()->theLockingInset()->lyxCode()==Inset::TABULAR_CODE) {
if (view()->theLockingInset()->lyxCode()== InsetOld::TABULAR_CODE) {
InsetTabular * inset = static_cast<InsetTabular *>
(view()->theLockingInset());
inset->openLayoutDialog(view());
} else if (view()->theLockingInset()->
getFirstLockingInsetOfType(Inset::TABULAR_CODE)!=0) {
getFirstLockingInsetOfType(InsetOld::TABULAR_CODE)!=0) {
InsetTabular * inset = static_cast<InsetTabular *>(
view()->theLockingInset()->getFirstLockingInsetOfType(Inset::TABULAR_CODE));
view()->theLockingInset()->getFirstLockingInsetOfType(InsetOld::TABULAR_CODE));
inset->openLayoutDialog(view());
}
}

View File

@ -47,7 +47,7 @@ bool nextRowIsAllInset(Row const & row, pos_type last)
if (!pit->isInset(last + 1))
return false;
Inset const * i = pit->getInset(last + 1);
InsetOld const * i = pit->getInset(last + 1);
return i->needFullRow() || i->display();
}

View File

@ -159,7 +159,7 @@ public:
*/
void insertChar(char c);
///
void insertInset(Inset * inset);
void insertInset(InsetOld * inset);
/// Completes the insertion with a rebreak from 'need_break_row' on
void partialRebreak();
@ -178,7 +178,7 @@ public:
void postPaint();
///
Inset::RESULT dispatch(FuncRequest const & cmd);
InsetOld::RESULT dispatch(FuncRequest const & cmd);
BufferView * bv();
@ -250,7 +250,7 @@ public:
/// just selects the word the cursor is in
void selectWord(lyx::word_location loc);
/// returns the inset at cursor (if it exists), 0 otherwise
Inset * getInset() const;
InsetOld * getInset() const;
/// accept selected change
void acceptChange();
@ -385,25 +385,25 @@ public:
void insertStringAsParagraphs(string const & str);
/// Find next inset of some specified type.
bool gotoNextInset(std::vector<Inset::Code> const & codes,
bool gotoNextInset(std::vector<InsetOld::Code> const & codes,
string const & contents = string());
///
void gotoInset(std::vector<Inset::Code> const & codes,
void gotoInset(std::vector<InsetOld::Code> const & codes,
bool same_content);
///
void gotoInset(Inset::Code code, bool same_content);
void gotoInset(InsetOld::Code code, bool same_content);
///
/* for the greater insets */
/// returns false if inset wasn't found
bool updateInset(Inset *);
bool updateInset(InsetOld *);
///
void checkParagraph(ParagraphList::iterator pit, lyx::pos_type pos);
///
int workWidth() const;
/// returns width of row containing inset
int workWidth(Inset const * inset) const;
int workWidth(InsetOld const * inset) const;
///
void computeBidiTables(Buffer const *, RowList::iterator row) const;
@ -467,7 +467,7 @@ public:
* Returns an inset if inset was hit, or 0 if not.
* If hit, the coordinates are changed relative to the inset.
*/
Inset * checkInsetHit(int & x, int & y);
InsetOld * checkInsetHit(int & x, int & y);
///
int singleWidth(ParagraphList::iterator pit, lyx::pos_type pos) const;

View File

@ -1,5 +1,7 @@
2003-07-25 Lars Gullik Bjønnes <larsbj@gullik.net>
* rename Inset to InsetOld
* all inset files (clone) return a auto_ptr<InsetBase>
2003-07-21 Angus Leeming <leeming@lyx.org>

View File

@ -251,9 +251,9 @@ void InsetFormula::getLabelList(std::vector<string> & res) const
}
Inset::Code InsetFormula::lyxCode() const
InsetOld::Code InsetFormula::lyxCode() const
{
return Inset::MATH_CODE;
return InsetOld::MATH_CODE;
}
@ -263,12 +263,12 @@ void InsetFormula::validate(LaTeXFeatures & features) const
}
bool InsetFormula::insetAllowed(Inset::Code code) const
bool InsetFormula::insetAllowed(InsetOld::Code code) const
{
return
code == Inset::LABEL_CODE
|| code == Inset::REF_CODE
|| code == Inset::ERT_CODE;
code == InsetOld::LABEL_CODE
|| code == InsetOld::REF_CODE
|| code == InsetOld::ERT_CODE;
}

View File

@ -58,9 +58,9 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
Inset::Code lyxCode() const;
InsetOld::Code lyxCode() const;
///
bool insetAllowed(Inset::Code code) const;
bool insetAllowed(InsetOld::Code code) const;
///
void getLabelList(std::vector<string> &) const;
///

View File

@ -784,9 +784,9 @@ void InsetFormulaBase::revealCodes(BufferView * bv) const
}
Inset::Code InsetFormulaBase::lyxCode() const
InsetOld::Code InsetFormulaBase::lyxCode() const
{
return Inset::MATH_CODE;
return InsetOld::MATH_CODE;
}

View File

@ -44,7 +44,7 @@ public:
// user-accessible way to override "false positives"
virtual void validate(LaTeXFeatures &) const;
///
virtual Inset::Code lyxCode() const;
virtual InsetOld::Code lyxCode() const;
/// what appears in the minibuffer when opening
virtual string const editMessage() const;
///

View File

@ -152,9 +152,9 @@ MathAtom & InsetFormulaMacro::par()
}
Inset::Code InsetFormulaMacro::lyxCode() const
InsetOld::Code InsetFormulaMacro::lyxCode() const
{
return Inset::MATHMACRO_CODE;
return InsetOld::MATHMACRO_CODE;
}

View File

@ -54,7 +54,7 @@ public:
///
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const;
InsetOld::Code lyxCode() const;
///
MathAtom const & par() const;
///

View File

@ -528,10 +528,10 @@ void MathCursor::macroModeClose()
if (s == "\\")
return;
string name = s.substr(1);
string const name = s.substr(1);
// prevent entering of recursive macros
if (formula()->lyxCode() == Inset::MATHMACRO_CODE
if (formula()->lyxCode() == InsetOld::MATHMACRO_CODE
&& formula()->getInsetName() == name)
lyxerr << "can't enter recursive macro\n";

View File

@ -64,7 +64,7 @@ namespace {
char minibuffer_char;
LyXFont minibuffer_font;
Inset * minibuffer_inset;
InsetOld * minibuffer_inset;
} // namespace anon
@ -93,7 +93,7 @@ Paragraph::Paragraph(Paragraph const & lp)
InsetList::iterator end = insetlist.end();
for (; it != end; ++it) {
// currently we hold Inset*, not InsetBase*
it->inset = static_cast<Inset*>(it->inset->clone().release());
it->inset = static_cast<InsetOld*>(it->inset->clone().release());
// tell the new inset who is the boss now
it->inset->parOwner(this);
}
@ -120,7 +120,7 @@ void Paragraph::operator=(Paragraph const & lp)
InsetList::iterator it = insetlist.begin();
InsetList::iterator end = insetlist.end();
for (; it != end; ++it) {
it->inset = static_cast<Inset*>(it->inset->clone().release());
it->inset = static_cast<InsetOld*>(it->inset->clone().release());
// tell the new inset who is the boss now
it->inset->parOwner(this);
}
@ -188,7 +188,7 @@ void Paragraph::write(Buffer const * buf, ostream & os,
switch (c) {
case META_INSET:
{
Inset const * inset = getInset(i);
InsetOld const * inset = getInset(i);
if (inset)
if (inset->directWrite()) {
// international char, let it write
@ -259,7 +259,7 @@ void Paragraph::copyIntoMinibuffer(Buffer const & buffer, pos_type pos) const
minibuffer_inset = 0;
if (minibuffer_char == Paragraph::META_INSET) {
if (getInset(pos)) {
minibuffer_inset = static_cast<Inset *>(getInset(pos)->clone().release());
minibuffer_inset = static_cast<InsetOld *>(getInset(pos)->clone().release());
} else {
minibuffer_inset = 0;
minibuffer_char = ' ';
@ -351,20 +351,20 @@ void Paragraph::insertChar(pos_type pos, Paragraph::value_type c,
}
void Paragraph::insertInset(pos_type pos, Inset * inset)
void Paragraph::insertInset(pos_type pos, InsetOld * inset)
{
LyXFont const f(LyXFont::ALL_INHERIT);
insertInset(pos, inset, f);
}
void Paragraph::insertInset(pos_type pos, Inset * inset, LyXFont const & font, Change change)
void Paragraph::insertInset(pos_type pos, InsetOld * inset, LyXFont const & font, Change change)
{
pimpl_->insertInset(pos, inset, font, change);
}
bool Paragraph::insetAllowed(Inset::Code code)
bool Paragraph::insetAllowed(InsetOld::Code code)
{
//lyxerr << "Paragraph::InsertInsetAllowed" << endl;
if (pimpl_->inset_owner)
@ -373,14 +373,14 @@ bool Paragraph::insetAllowed(Inset::Code code)
}
Inset * Paragraph::getInset(pos_type pos)
InsetOld * Paragraph::getInset(pos_type pos)
{
Assert(pos < size());
return insetlist.get(pos);
}
Inset const * Paragraph::getInset(pos_type pos) const
InsetOld const * Paragraph::getInset(pos_type pos) const
{
Assert(pos < size());
return insetlist.get(pos);
@ -735,7 +735,7 @@ int Paragraph::beginningOfBody() const
// returns -1 if inset not found
int Paragraph::getPositionOfInset(Inset const * inset) const
int Paragraph::getPositionOfInset(InsetOld const * inset) const
{
// Find the entry.
InsetList::const_iterator it = insetlist.begin();
@ -750,7 +750,7 @@ int Paragraph::getPositionOfInset(Inset const * inset) const
InsetBibitem * Paragraph::bibitem() const
{
InsetList::const_iterator it = insetlist.begin();
if (it != insetlist.end() && it->inset->lyxCode() == Inset::BIBTEX_CODE)
if (it != insetlist.end() && it->inset->lyxCode() == InsetOld::BIBTEX_CODE)
return static_cast<InsetBibitem *>(it->inset);
return 0;
}
@ -1080,7 +1080,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
bool Paragraph::isHfill(pos_type pos) const
{
return IsInsetChar(getChar(pos))
&& getInset(pos)->lyxCode() == Inset::HFILL_CODE;
&& getInset(pos)->lyxCode() == InsetOld::HFILL_CODE;
}
@ -1093,7 +1093,7 @@ bool Paragraph::isInset(pos_type pos) const
bool Paragraph::isNewline(pos_type pos) const
{
return IsInsetChar(getChar(pos))
&& getInset(pos)->lyxCode() == Inset::NEWLINE_CODE;
&& getInset(pos)->lyxCode() == InsetOld::NEWLINE_CODE;
}
@ -1158,7 +1158,7 @@ bool Paragraph::isRightToLeftPar(BufferParams const & bparams) const
return lyxrc.rtl_support
&& getParLanguage(bparams)->RightToLeft()
&& !(inInset() && inInset()->owner() &&
inInset()->owner()->lyxCode() == Inset::ERT_CODE);
inInset()->owner()->lyxCode() == InsetOld::ERT_CODE);
}
@ -1204,7 +1204,7 @@ string const Paragraph::asString(Buffer const * buffer, bool label) const
if (IsPrintable(c))
s += c;
else if (c == META_INSET &&
getInset(i)->lyxCode() == Inset::MATH_CODE) {
getInset(i)->lyxCode() == InsetOld::MATH_CODE) {
ostringstream ost;
getInset(i)->ascii(buffer, ost);
s += subst(STRCONV(ost.str()),'\n',' ');
@ -1371,8 +1371,8 @@ void Paragraph::id(int i)
LyXLayout_ptr const & Paragraph::layout() const
{
/*
Inset * inset = inInset();
if (inset && inset->lyxCode() == Inset::ENVIRONMENT_CODE)
InsetOld * inset = inInset();
if (inset && inset->lyxCode() == InsetOld::ENVIRONMENT_CODE)
return static_cast<InsetEnvironment*>(inset)->layout();
*/
return layout_;
@ -1420,9 +1420,9 @@ bool Paragraph::isFreeSpacing() const
return true;
// for now we just need this, later should we need this in some
// other way we can always add a function to Inset::() too.
// other way we can always add a function to InsetOld::() too.
if (pimpl_->inset_owner && pimpl_->inset_owner->owner())
return (pimpl_->inset_owner->owner()->lyxCode() == Inset::ERT_CODE);
return (pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE);
return false;
}
@ -1432,7 +1432,7 @@ bool Paragraph::allowEmpty() const
if (layout()->keepempty)
return true;
if (pimpl_->inset_owner && pimpl_->inset_owner->owner())
return (pimpl_->inset_owner->owner()->lyxCode() == Inset::ERT_CODE);
return (pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE);
return false;
}

View File

@ -13,7 +13,7 @@
#include "lyxfont.h" // Just for LyXFont::FONT_SIZE
#include "InsetList.h"
#include "insets/inset.h" // Just for Inset::Code
#include "insets/inset.h" // Just for InsetOld::Code
#include "support/types.h"
#include "changes.h"
@ -242,18 +242,18 @@ public:
///
bool checkInsertChar(LyXFont &);
///
void insertInset(lyx::pos_type pos, Inset * inset);
void insertInset(lyx::pos_type pos, InsetOld * inset);
///
void insertInset(lyx::pos_type pos, Inset * inset, LyXFont const &, Change change = Change(Change::INSERTED));
void insertInset(lyx::pos_type pos, InsetOld * inset, LyXFont const &, Change change = Change(Change::INSERTED));
///
bool insetAllowed(Inset::Code code);
bool insetAllowed(InsetOld::Code code);
///
Inset * getInset(lyx::pos_type pos);
InsetOld * getInset(lyx::pos_type pos);
///
Inset const * getInset(lyx::pos_type pos) const;
InsetOld const * getInset(lyx::pos_type pos) const;
/** important for cut and paste
Temporary change from BufferParams to Buffer. Will revert when we
get rid of the argument to Inset::clone(Buffer const &) */
get rid of the argument to InsetOld::clone(Buffer const &) */
void copyIntoMinibuffer(Buffer const &, lyx::pos_type pos) const;
///
void cutIntoMinibuffer(BufferParams const &, lyx::pos_type pos);
@ -278,7 +278,7 @@ public:
bool isWord(lyx::pos_type pos) const;
/// returns -1 if inset not found
int getPositionOfInset(Inset const * inset) const;
int getPositionOfInset(InsetOld const * inset) const;
///
int stripLeadingSpaces();

View File

@ -429,8 +429,8 @@ InsetOptArg * optArgInset(Paragraph const & par)
InsetList::const_iterator it = par.insetlist.begin();
InsetList::const_iterator end = par.insetlist.end();
for (; it != end; ++it) {
Inset * ins = it->inset;
if (ins->lyxCode() == Inset::OPTARG_CODE) {
InsetOld * ins = it->inset;
if (ins->lyxCode() == InsetOld::OPTARG_CODE) {
return static_cast<InsetOptArg *>(ins);
}
}
@ -450,7 +450,7 @@ TeXOnePar(Buffer const * buf,
<< "'" << endl;
BufferParams const & bparams = buf->params;
Inset const * in = pit->inInset();
InsetOld const * in = pit->inInset();
bool further_blank_line = false;
LyXLayout_ptr style;
@ -709,7 +709,7 @@ void latexParagraphs(Buffer const * buf,
// if only_body
while (par != endpar) {
Inset * in = par->inInset();
InsetOld * in = par->inInset();
// well we have to check if we are in an inset with unlimited
// length (all in one row) if that is true then we don't allow
// any special options in the paragraph and also we don't allow
@ -862,7 +862,7 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok
istringstream is(ss.str());
LyXLex tmplex(0, 0);
tmplex.setStream(is);
Inset * inset = new InsetCaption;
InsetOld * inset = new InsetCaption;
inset->Read(this, tmplex);
par.insertInset(pos, inset, font);
++pos;
@ -888,7 +888,7 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok
// But insets should read it, it is a part of
// the inset isn't it? Lgb.
} else if (token == "\\begin_inset") {
Inset * i = readInset(lex, buf);
InsetOld * i = readInset(lex, buf);
par.insertInset(par.size(), i, font, change);
} else if (token == "\\family") {
lex.next();
@ -955,7 +955,7 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok
}
}
} else {
Inset * inset = 0;
InsetOld * inset = 0;
if (token == "\\SpecialChar" )
inset = new InsetSpecialChar;
else
@ -964,17 +964,17 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok
par.insertInset(par.size(), inset, font, change);
}
} else if (token == "\\i") {
Inset * inset = new InsetLatexAccent;
InsetOld * inset = new InsetLatexAccent;
inset->read(&buf, lex);
par.insertInset(par.size(), inset, font, change);
} else if (token == "\\backslash") {
par.insertChar(par.size(), '\\', font, change);
} else if (token == "\\newline") {
Inset * inset = new InsetNewline;
InsetOld * inset = new InsetNewline;
inset->read(&buf, lex);
par.insertInset(par.size(), inset, font, change);
} else if (token == "\\LyXTable") {
Inset * inset = new InsetTabular(buf);
InsetOld * inset = new InsetTabular(buf);
inset->read(&buf, lex);
par.insertInset(par.size(), inset, font, change);
} else if (token == "\\bibitem") {

View File

@ -318,7 +318,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
void Paragraph::Pimpl::insertInset(pos_type pos,
Inset * inset, LyXFont const & font, Change change)
InsetOld * inset, LyXFont const & font, Change change)
{
Assert(inset);
Assert(pos <= size());
@ -390,7 +390,7 @@ bool Paragraph::Pimpl::erase(pos_type pos)
// only allow the actual removal if it was /new/ text
if (changetype != Change::INSERTED) {
if (text[pos] == Paragraph::META_INSET) {
Inset * i(owner_->getInset(pos));
InsetOld * i(owner_->getInset(pos));
i->markErased();
}
return false;
@ -499,7 +499,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
if (c != '\0')
os << c;
} else {
Inset const * inset = owner_->getInset(i);
InsetOld const * inset = owner_->getInset(i);
inset->ascii(buf, os, 0);
}
return;
@ -510,14 +510,14 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
// and then split to handle the two modes separately.
switch (c) {
case Paragraph::META_INSET: {
Inset * inset = owner_->getInset(i);
InsetOld * inset = owner_->getInset(i);
// FIXME: remove this check
if (!inset)
break;
// FIXME: move this to InsetNewline::latex
if (inset->lyxCode() == Inset::NEWLINE_CODE) {
if (inset->lyxCode() == InsetOld::NEWLINE_CODE) {
// newlines are handled differently here than
// the default in simpleTeXSpecialChars().
if (!style.newline_allowed) {
@ -553,9 +553,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
bool close = false;
int const len = os.tellp();
//ostream::pos_type const len = os.tellp();
if ((inset->lyxCode() == Inset::GRAPHICS_CODE
|| inset->lyxCode() == Inset::MATH_CODE
|| inset->lyxCode() == Inset::URL_CODE)
if ((inset->lyxCode() == InsetOld::GRAPHICS_CODE
|| inset->lyxCode() == InsetOld::MATH_CODE
|| inset->lyxCode() == InsetOld::URL_CODE)
&& running_font.isRightToLeft()) {
os << "\\L{";
close = true;
@ -824,7 +824,7 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features,
if (icit->inset) {
icit->inset->validate(features);
if (layout.needprotect &&
icit->inset->lyxCode() == Inset::FOOT_CODE)
icit->inset->lyxCode() == InsetOld::FOOT_CODE)
features.require("NeedLyXFootnoteCode");
}
}

View File

@ -76,7 +76,7 @@ struct Paragraph::Pimpl {
///
void insertChar(lyx::pos_type pos, value_type c, LyXFont const & font, Change change = Change(Change::INSERTED));
///
void insertInset(lyx::pos_type pos, Inset * inset, LyXFont const & font, Change change = Change(Change::INSERTED));
void insertInset(lyx::pos_type pos, InsetOld * inset, LyXFont const & font, Change change = Change(Change::INSERTED));
/// definite erase
void eraseIntern(lyx::pos_type pos);
/// erase the given position. Returns true if it was actually erased

View File

@ -175,7 +175,7 @@ int RowPainter::leftMargin() const
void RowPainter::paintInset(pos_type const pos)
{
Inset * inset = const_cast<Inset*>(pit_->getInset(pos));
InsetOld * inset = const_cast<InsetOld*>(pit_->getInset(pos));
Assert(inset);

View File

@ -1074,7 +1074,7 @@ int LyXTabular::getLastCellInRow(int row) const
void LyXTabular::calculate_width_of_column(int column)
{
int maximum = 0;
for (int i = 0; i < rows_; ++i)
for (int i = 0; i < rows_; ++i)
maximum = max(cell_info[i][column].width_of_cell, maximum);
column_info[column].width_of_column = maximum;
}
@ -2557,7 +2557,7 @@ InsetText & LyXTabular::getCellInset(int row, int column) const
}
int LyXTabular::getCellFromInset(Inset const * inset, int maybe_cell) const
int LyXTabular::getCellFromInset(InsetOld const * inset, int maybe_cell) const
{
// is this inset part of the tabular?
if (!inset || inset->owner() != owner_) {

View File

@ -225,10 +225,10 @@ public:
void setLeftLine(int cell, bool line, bool onlycolumn = false);
///
void setRightLine(int cell, bool line, bool onlycolumn = false);
///
///
void setAlignment(int cell, LyXAlignment align,
bool onlycolumn = false);
///
///
void setVAlignment(int cell, VAlignment align,
bool onlycolumn = false);
///
@ -365,7 +365,7 @@ public:
InsetText & getCellInset(int row, int column) const;
/// Search for \param inset in the tabular, with the
/// additional hint that it could be at \param maybe_cell
int getCellFromInset(Inset const * inset, int maybe_cell = -1) const;
int getCellFromInset(InsetOld const * inset, int maybe_cell = -1) const;
///
int rows() const { return rows_; }
///

View File

@ -148,7 +148,7 @@ int LyXText::workWidth() const
}
int LyXText::workWidth(Inset const * inset) const
int LyXText::workWidth(InsetOld const * inset) const
{
ParagraphList::iterator par = std::find(ownerParagraphs().begin(),
ownerParagraphs().end(),
@ -305,9 +305,9 @@ int LyXText::singleWidth(ParagraphList::iterator pit,
}
if (c == Paragraph::META_INSET) {
Inset * tmpinset = pit->getInset(pos);
InsetOld * tmpinset = pit->getInset(pos);
if (tmpinset) {
if (tmpinset->lyxCode() == Inset::HFILL_CODE) {
if (tmpinset->lyxCode() == InsetOld::HFILL_CODE) {
// Because of the representation as vertical lines
return 3;
}
@ -379,9 +379,9 @@ void LyXText::computeBidiTables(Buffer const * buf,
ParagraphList::iterator row_par = row->par();
Inset * inset = row_par->inInset();
InsetOld * inset = row_par->inInset();
if (inset && inset->owner() &&
inset->owner()->lyxCode() == Inset::ERT_CODE) {
inset->owner()->lyxCode() == InsetOld::ERT_CODE) {
bidi_start = -1;
return;
}
@ -534,7 +534,7 @@ bool LyXText::isBoundary(Buffer const * buf, Paragraph const & par,
int LyXText::leftMargin(Row const & row) const
{
Inset * ins;
InsetOld * ins;
if (row.pos() < row.par()->size())
if ((row.par()->getChar(row.pos()) == Paragraph::META_INSET) &&
@ -709,8 +709,8 @@ int LyXText::leftMargin(Row const & row) const
&& !row.par()->params().noindent()
// in tabulars and ert paragraphs are never indented!
&& (!row.par()->inInset() || !row.par()->inInset()->owner() ||
(row.par()->inInset()->owner()->lyxCode() != Inset::TABULAR_CODE &&
row.par()->inInset()->owner()->lyxCode() != Inset::ERT_CODE))
(row.par()->inInset()->owner()->lyxCode() != InsetOld::TABULAR_CODE &&
row.par()->inInset()->owner()->lyxCode() != InsetOld::ERT_CODE))
&& (row.par()->layout() != tclass.defaultLayout() ||
bv()->buffer()->params.paragraph_separation ==
BufferParams::PARSEP_INDENT)) {
@ -728,7 +728,7 @@ int LyXText::leftMargin(Row const & row) const
int LyXText::rightMargin(Buffer const & buf, Row const & row) const
{
Inset * ins;
InsetOld * ins;
if (row.pos() < row.par()->size())
if ((row.par()->getChar(row.pos()) == Paragraph::META_INSET) &&
@ -845,7 +845,7 @@ pos_type LyXText::rowBreakPoint(Row const & row) const
x += thiswidth;
chunkwidth += thiswidth;
Inset * in = pit->isInset(i) ? pit->getInset(i) : 0;
InsetOld * in = pit->isInset(i) ? pit->getInset(i) : 0;
fullrow = (in && (in->display() || in->needFullRow()));
// break before a character that will fall off
@ -1029,7 +1029,7 @@ void LyXText::setHeightOfRow(RowList::iterator rit)
float layoutdesc = 0;
float tmptop = 0;
LyXFont tmpfont;
Inset * tmpinset = 0;
InsetOld * tmpinset = 0;
// ok, let us initialize the maxasc and maxdesc value.
// This depends in LaTeX of the font of the last character
@ -1674,7 +1674,7 @@ void LyXText::insertChar(char c)
// the display inset stuff
if (cursorRow()->pos() < cursorRow()->par()->size()
&& cursorRow()->par()->isInset(cursorRow()->pos())) {
Inset * inset = cursorRow()->par()->getInset(cursorRow()->pos());
InsetOld * inset = cursorRow()->par()->getInset(cursorRow()->pos());
if (inset && (inset->display() || inset->needFullRow())) {
// force a new break
cursorRow()->fill(-1); // to force a new break
@ -1885,17 +1885,17 @@ void LyXText::prepareToPrint(RowList::iterator rit, int & x,
}
// center displayed insets
Inset * inset = 0;
InsetOld * inset = 0;
if (rit->pos() < pit->size()
&& pit->isInset(rit->pos())
&& (inset = pit->getInset(rit->pos()))
&& (inset->display())) // || (inset->scroll() < 0)))
align = (inset->lyxCode() == Inset::MATHMACRO_CODE)
align = (inset->lyxCode() == InsetOld::MATHMACRO_CODE)
? LYX_ALIGN_BLOCK : LYX_ALIGN_CENTER;
// ERT insets should always be LEFT ALIGNED on screen
inset = pit->inInset();
if (inset && inset->owner() &&
inset->owner()->lyxCode() == Inset::ERT_CODE)
inset->owner()->lyxCode() == InsetOld::ERT_CODE)
{
align = LYX_ALIGN_LEFT;
}

View File

@ -206,7 +206,7 @@ void LyXText::setCharFont(ParagraphList::iterator pit,
font.update(fnt, buf->params.language, toggleall);
// Let the insets convert their font
if (pit->isInset(pos)) {
Inset * inset = pit->getInset(pos);
InsetOld * inset = pit->getInset(pos);
if (isEditableInset(inset)) {
UpdatableInset * uinset =
static_cast<UpdatableInset *>(inset);
@ -302,7 +302,7 @@ void LyXText::insertParagraph(ParagraphList::iterator pit,
}
Inset * LyXText::getInset() const
InsetOld * LyXText::getInset() const
{
ParagraphList::iterator pit = cursor.par();
pos_type const pos = cursor.pos();
@ -316,7 +316,7 @@ Inset * LyXText::getInset() const
void LyXText::toggleInset()
{
Inset * inset = getInset();
InsetOld * inset = getInset();
// is there an editable inset at cursor position?
if (!isEditableInset(inset)) {
// No, try to see if we are inside a collapsable inset
@ -437,7 +437,7 @@ void LyXText::setLayout(string const & layout)
bv()->owner()->dispatch(FuncRequest(LFUN_HOME));
bv()->owner()->dispatch(FuncRequest(LFUN_ENDSEL));
bv()->owner()->dispatch(FuncRequest(LFUN_CUT));
Inset * inset = new InsetEnvironment(params, layout);
InsetOld * inset = new InsetEnvironment(params, layout);
if (bv()->insertInset(inset)) {
//inset->edit(bv());
//bv()->owner()->dispatch(FuncRequest(LFUN_PASTE));
@ -1119,14 +1119,14 @@ void LyXText::setCounter(Buffer const * buf, ParagraphList::iterator pit)
// the caption hack:
if (layout->labeltype == LABEL_SENSITIVE) {
ParagraphList::iterator tmppit = pit;
Inset * in = 0;
InsetOld * in = 0;
bool isOK = false;
while (tmppit != ownerParagraphs().end() &&
tmppit->inInset()
// the single '=' is intended below
&& (in = tmppit->inInset()->owner())) {
if (in->lyxCode() == Inset::FLOAT_CODE ||
in->lyxCode() == Inset::WRAP_CODE) {
if (in->lyxCode() == InsetOld::FLOAT_CODE ||
in->lyxCode() == InsetOld::WRAP_CODE) {
isOK = true;
break;
} else {
@ -1137,9 +1137,9 @@ void LyXText::setCounter(Buffer const * buf, ParagraphList::iterator pit)
if (isOK) {
string type;
if (in->lyxCode() == Inset::FLOAT_CODE)
if (in->lyxCode() == InsetOld::FLOAT_CODE)
type = static_cast<InsetFloat*>(in)->params().type;
else if (in->lyxCode() == Inset::WRAP_CODE)
else if (in->lyxCode() == InsetOld::WRAP_CODE)
type = static_cast<InsetWrap*>(in)->params().type;
else
Assert(0);
@ -1213,7 +1213,7 @@ void LyXText::updateCounters()
}
void LyXText::insertInset(Inset * inset)
void LyXText::insertInset(InsetOld * inset)
{
if (!cursor.par()->insetAllowed(inset->lyxCode()))
return;
@ -1523,7 +1523,7 @@ void LyXText::checkParagraph(ParagraphList::iterator pit, pos_type pos)
// returns false if inset wasn't found
bool LyXText::updateInset(Inset * inset)
bool LyXText::updateInset(InsetOld * inset)
{
// first check the current paragraph
int pos = cursor.par()->getPositionOfInset(inset);
@ -1584,7 +1584,7 @@ void LyXText::setCursor(LyXCursor & cur, ParagraphList::iterator pit,
boost::prior(row)->par() == row->par() &&
pos < pit->size() &&
pit->getChar(pos) == Paragraph::META_INSET) {
Inset * ins = pit->getInset(pos);
InsetOld * ins = pit->getInset(pos);
if (ins && (ins->needFullRow() || ins->display())) {
--row;
y -= row->height();
@ -1921,7 +1921,7 @@ namespace {
|| !cur.par()->isInset(cur.pos()))
return false;
Inset const * inset = cur.par()->getInset(cur.pos());
InsetOld const * inset = cur.par()->getInset(cur.pos());
if (inset->needFullRow() || inset->display())
return true;
@ -2001,7 +2001,7 @@ void LyXText::cursorUp(bool selecting)
int y1 = cursor.iy() - topy;
int y2 = y1;
y -= topy;
Inset * inset_hit = checkInsetHit(x, y1);
InsetOld * inset_hit = checkInsetHit(x, y1);
if (inset_hit && isHighlyEditableInset(inset_hit)) {
inset_hit->localDispatch(
FuncRequest(bv(), LFUN_INSET_EDIT, x, y - (y2 - y1), mouse_button::none));
@ -2025,7 +2025,7 @@ void LyXText::cursorDown(bool selecting)
int y1 = cursor.iy() - topy;
int y2 = y1;
y -= topy;
Inset * inset_hit = checkInsetHit(x, y1);
InsetOld * inset_hit = checkInsetHit(x, y1);
if (inset_hit && isHighlyEditableInset(inset_hit)) {
FuncRequest cmd(bv(), LFUN_INSET_EDIT, x, y - (y2 - y1), mouse_button::none);
inset_hit->localDispatch(cmd);

View File

@ -96,7 +96,7 @@ namespace {
// check if the given co-ordinates are inside an inset at the
// given cursor, if one exists. If so, the inset is returned,
// and the co-ordinates are made relative. Otherwise, 0 is returned.
Inset * checkInset(BufferView * bv, LyXText & text,
InsetOld * checkInset(BufferView * bv, LyXText & text,
LyXCursor const & cur, int & x, int & y)
{
lyx::pos_type const pos = cur.pos();
@ -105,7 +105,7 @@ namespace {
if (pos >= par->size() || !par->isInset(pos))
return 0;
Inset /*const*/ * inset = par->getInset(pos);
InsetOld /*const*/ * inset = par->getInset(pos);
if (!isEditableInset(inset))
return 0;
@ -145,14 +145,14 @@ namespace {
} // anon namespace
Inset * LyXText::checkInsetHit(int & x, int & y)
InsetOld * LyXText::checkInsetHit(int & x, int & y)
{
int y_tmp = y + top_y();
LyXCursor cur;
setCursorFromCoordinates(cur, x, y_tmp);
Inset * inset = checkInset(bv(), *this, cur, x, y_tmp);
InsetOld * inset = checkInset(bv(), *this, cur, x, y_tmp);
if (inset) {
y = y_tmp;
return inset;
@ -172,14 +172,14 @@ Inset * LyXText::checkInsetHit(int & x, int & y)
}
bool LyXText::gotoNextInset(vector<Inset::Code> const & codes,
bool LyXText::gotoNextInset(vector<InsetOld::Code> const & codes,
string const & contents)
{
ParagraphList::iterator end = ownerParagraphs().end();
ParagraphList::iterator pit = cursor.par();
pos_type pos = cursor.pos();
Inset * inset;
InsetOld * inset;
do {
if (pos + 1 < pit->size()) {
++pos;
@ -204,7 +204,7 @@ bool LyXText::gotoNextInset(vector<Inset::Code> const & codes,
}
void LyXText::gotoInset(vector<Inset::Code> const & codes,
void LyXText::gotoInset(vector<InsetOld::Code> const & codes,
bool same_content)
{
bv()->beforeChange(this);
@ -213,7 +213,7 @@ void LyXText::gotoInset(vector<Inset::Code> const & codes,
string contents;
if (same_content && cursor.pos() < cursor.par()->size()
&& cursor.par()->isInset(cursor.pos())) {
Inset const * inset = cursor.par()->getInset(cursor.pos());
InsetOld const * inset = cursor.par()->getInset(cursor.pos());
if (find(codes.begin(), codes.end(), inset->lyxCode())
!= codes.end())
contents = static_cast<InsetCommand const *>(inset)->getContents();
@ -237,9 +237,9 @@ void LyXText::gotoInset(vector<Inset::Code> const & codes,
}
void LyXText::gotoInset(Inset::Code code, bool same_content)
void LyXText::gotoInset(InsetOld::Code code, bool same_content)
{
gotoInset(vector<Inset::Code>(1, code), same_content);
gotoInset(vector<InsetOld::Code>(1, code), same_content);
}
@ -382,7 +382,7 @@ void specialChar(LyXText * lt, BufferView * bv, InsetSpecialChar::Kind kind)
void doInsertInset(LyXText * lt, FuncRequest const & cmd,
bool edit, bool pastesel)
{
Inset * inset = createInset(cmd);
InsetOld * inset = createInset(cmd);
BufferView * bv = cmd.view();
if (inset) {
@ -406,7 +406,7 @@ void doInsertInset(LyXText * lt, FuncRequest const & cmd,
}
Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
{
lyxerr[Debug::ACTION] << "LyXFunc::dispatch: action[" << cmd.action
<<"] arg[" << cmd.argument << ']' << endl;
@ -613,7 +613,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
if (cursor.pos() < cursor.par()->size()
&& cursor.par()->isInset(cursor.pos())
&& isHighlyEditableInset(cursor.par()->getInset(cursor.pos()))) {
Inset * tmpinset = cursor.par()->getInset(cursor.pos());
InsetOld * tmpinset = cursor.par()->getInset(cursor.pos());
cmd.message(tmpinset->editMessage());
FuncRequest cmd1(bv, LFUN_INSET_EDIT, is_rtl ? "right" : "left");
tmpinset->localDispatch(cmd1);
@ -639,7 +639,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
cursor.pos() < cursor.par()->size() &&
cursor.par()->isInset(cursor.pos()) &&
isHighlyEditableInset(cursor.par()->getInset(cursor.pos()))) {
Inset * tmpinset = cursor.par()->getInset(cursor.pos());
InsetOld * tmpinset = cursor.par()->getInset(cursor.pos());
cmd.message(tmpinset->editMessage());
FuncRequest cmd1(bv, LFUN_INSET_EDIT, is_rtl ? "left" : "right");
tmpinset->localDispatch(cmd1);
@ -1183,18 +1183,18 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
}
case LFUN_GOTOERROR:
gotoInset(Inset::ERROR_CODE, false);
gotoInset(InsetOld::ERROR_CODE, false);
break;
case LFUN_GOTONOTE:
gotoInset(Inset::NOTE_CODE, false);
gotoInset(InsetOld::NOTE_CODE, false);
break;
case LFUN_REFERENCE_GOTO:
{
vector<Inset::Code> tmp;
tmp.push_back(Inset::LABEL_CODE);
tmp.push_back(Inset::REF_CODE);
vector<InsetOld::Code> tmp;
tmp.push_back(InsetOld::LABEL_CODE);
tmp.push_back(InsetOld::REF_CODE);
gotoInset(tmp, true);
break;
}
@ -1293,7 +1293,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
// Check for inset locking
if (bv->theLockingInset()) {
Inset * tli = bv->theLockingInset();
InsetOld * tli = bv->theLockingInset();
LyXCursor cursor = bv->text->cursor;
LyXFont font = bv->text->getFont(bv->buffer(),
cursor.par(), cursor.pos());
@ -1366,7 +1366,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
int x = cmd.x;
int y = cmd.y;
Inset * inset_hit = bv->text->checkInsetHit(x, y);
InsetOld * inset_hit = bv->text->checkInsetHit(x, y);
// Middle button press pastes if we have a selection
// We do this here as if the selection was inside an inset
@ -1461,7 +1461,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
// inset, inset_hit is 0, and inset_x == x, inset_y == y.
int x = cmd.x;
int y = cmd.y;
Inset * inset_hit = bv->text->checkInsetHit(x, y);
InsetOld * inset_hit = bv->text->checkInsetHit(x, y);
if (bv->theLockingInset()) {
// We are in inset locking mode.
@ -1521,7 +1521,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
// (Joacim)
// ...or maybe the SetCursorParUndo()
// below isn't necessary at all anylonger?
if (inset_hit->lyxCode() == Inset::REF_CODE)
if (inset_hit->lyxCode() == InsetOld::REF_CODE)
recordUndo(bv, Undo::ATOMIC);
bv->owner()->message(inset_hit->editMessage());

View File

@ -97,11 +97,11 @@ TocList const getTocList(Buffer const * buf)
InsetList::const_iterator it = pit->insetlist.begin();
InsetList::const_iterator end = pit->insetlist.end();
for (; it != end; ++it) {
if (it->inset->lyxCode() == Inset::FLOAT_CODE) {
if (it->inset->lyxCode() == InsetOld::FLOAT_CODE) {
InsetFloat * il =
static_cast<InsetFloat*>(it->inset);
il->addToToc(toclist, buf);
} else if (it->inset->lyxCode() == Inset::WRAP_CODE) {
} else if (it->inset->lyxCode() == InsetOld::WRAP_CODE) {
InsetWrap * il =
static_cast<InsetWrap*>(it->inset);
il->addToToc(toclist, buf);