InsetOld -> InsetBase renaming

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9310 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2004-11-25 19:13:07 +00:00
parent 78948fb552
commit 686f1e276f
71 changed files with 177 additions and 170 deletions

View File

@ -203,7 +203,7 @@ src/output_linuxdoc.C
src/output_plaintext.C
src/paragraph.C
src/rowpainter.C
src/support/globbing.C
src/support/filefilterlist.C
src/support/path_defines.C.in
src/text.C
src/text2.C

View File

@ -27,7 +27,6 @@ class DocIterator;
class ErrorList;
class FuncRequest;
class FuncStatus;
class InsetOld;
class Language;
class LCursor;
class LyXText;

View File

@ -1,3 +1,7 @@
2004-11-25 Lars Gullik Bjonnes <larsbj@gullik.net>
* rename a lot of InsetOld to InsetBase
2004-11-25 Angus Leeming <leeming@lyx.org>
* BufferView_pimpl.C:
@ -13,11 +17,11 @@
* FuncStatus.C (message): new methods. Used to provide an error
message indicating why a command is disabled.
(clear, |=, FuncStatus): update for message.
2004-11-23 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* lyxfunc.C (dispatch): always call sendDispatchMessage
2004-11-24 Alfredo Braunstein <abraunst@lyx.org>
* BufferView.C:
@ -47,11 +51,11 @@
(rowstruct): use initialization
(columnstruct): use initialization
(ltType): use initialization
* lyxlength.h (swap): new function
* LColor.[Ch] (operator=): use the common semantics
* lyxlength.h (swap): new function
* LColor.[Ch] (operator=): use the common semantics
2004-11-22 Jean-Marc Lasgouttes <lasgouttes@lyx.org>

View File

@ -168,7 +168,7 @@ pasteSelectionHelper(Buffer const & buffer, ParagraphList & pars,
for (; lit != eit; ++lit) {
switch (lit->inset->lyxCode()) {
case InsetOld::TABULAR_CODE: {
case InsetBase::TABULAR_CODE: {
InsetTabular * it = static_cast<InsetTabular*>(lit->inset);
it->buffer(&buffer);
break;

View File

@ -1254,15 +1254,15 @@ void Buffer::fillWithBibKeys(std::vector<std::pair<string, string> > & keys)
}
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() == InsetOld::BIBTEX_CODE) {
if (it->lyxCode() == InsetBase::BIBTEX_CODE) {
InsetBibtex const & inset =
dynamic_cast<InsetBibtex const &>(*it);
inset.fillWithBibKeys(*this, keys);
} else if (it->lyxCode() == InsetOld::INCLUDE_CODE) {
} else if (it->lyxCode() == InsetBase::INCLUDE_CODE) {
InsetInclude const & inset =
dynamic_cast<InsetInclude const &>(*it);
inset.fillWithBibKeys(*this, keys);
} else if (it->lyxCode() == InsetOld::BIBITEM_CODE) {
} else if (it->lyxCode() == InsetBase::BIBITEM_CODE) {
InsetBibitem const & inset =
dynamic_cast<InsetBibitem const &>(*it);
string const key = inset.getContents();

View File

@ -1,7 +1,11 @@
2004-11-25 Lars Gullik Bjonnes <larsbj@gullik.net>
* rename a lot of InsetOld to InsetBase
2004-11-20 Lars Gullik Bjonnes <larsbj@gullik.net>
* GraphicsCache.C: include <map> to fix compilation with boost
1.32.0
1.32.0
2004-11-09 Georg Baum <Georg.Baum@post.rwth-aachen.de>

View File

@ -29,8 +29,6 @@
#include <boost/scoped_ptr.hpp>
#include <boost/signal.hpp>
class InsetOld;
namespace lyx {
namespace graphics {

View File

@ -15,8 +15,6 @@
#include <boost/scoped_ptr.hpp>
#include <string>
class InsetOld;
namespace lyx {
namespace graphics {

View File

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

View File

@ -1,3 +1,7 @@
2004-11-25 Lars Gullik Bjonnes <larsbj@gullik.net>
* rename a lot of InsetOld to InsetBase
2004-11-25 Alfredo Braunstein <abraunst@lyx.org>
* insettabular.C:

View File

@ -65,7 +65,7 @@ protected:
private:
InsetOld & operator=(InsetOld const &) const;
///
std::string name_;
/** We store the LColor::color value as an int to get LColor.h out
@ -75,14 +75,14 @@ private:
};
/** \c InsetOld_code is a wrapper for InsetOld::Code.
/** \c InsetBase_code is a wrapper for InsetBase::Code.
* It can be forward-declared and passed as a function argument without
* having to expose inset.h.
*/
class InsetOld_code {
class InsetBase_code {
InsetBase::Code val_;
public:
InsetOld_code(InsetBase::Code val) : val_(val) {}
InsetBase_code(InsetBase::Code val) : val_(val) {}
operator InsetBase::Code() const { return val_; }
};

View File

@ -208,7 +208,7 @@ 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 InsetOld::Code
its own enum code. Actually the notion of an InsetBase::Code
should be avoided, but I am not sure how this could be done
in a cleaner way. */
enum Code {

View File

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

View File

@ -27,7 +27,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const { return InsetOld::BIBTEX_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::BIBTEX_CODE; }
///
bool display() const { return true; }
///

View File

@ -61,7 +61,7 @@ public:
///
std::string const editMessage() const;
///
InsetOld::Code lyxCode() const { return InsetOld::BOX_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
///
void write(Buffer const &, std::ostream &) const;
///

View File

@ -42,7 +42,7 @@ public:
///
std::string const editMessage() const;
///
InsetOld::Code lyxCode() const { return InsetOld::BRANCH_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::BRANCH_CODE; }
///
void write(Buffer const &, std::ostream &) const;
///

View File

@ -88,8 +88,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.
#if 0
InsetOld * i1 = owner();
InsetOld * i2 = i1 ? i1->owner() : 0;
InsetBase * i1 = owner();
InsetBase * i2 = i1 ? i1->owner() : 0;
string type;
if (i2->lyxCode() == FLOAT_CODE)
#ifdef WITH_WARNINGS

View File

@ -28,7 +28,7 @@ public:
///
virtual bool display() const;
///
virtual InsetOld::Code lyxCode() const;
virtual InsetBase::Code lyxCode() const;
///
virtual std::string const editMessage() const;
///
@ -53,7 +53,7 @@ bool InsetCaption::display() const
inline
InsetOld::Code InsetCaption::lyxCode() const
InsetBase::Code InsetCaption::lyxCode() const
{
return CAPTION_CODE;
}

View File

@ -47,7 +47,7 @@ public:
///
std::string const editMessage() const;
///
InsetOld::Code lyxCode() const { return InsetOld::CHARSTYLE_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
///
void write(Buffer const &, std::ostream &) const;
///

View File

@ -29,7 +29,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const { return InsetOld::CITE_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::CITE_CODE; }
///
int plaintext(Buffer const &, std::ostream &, OutputParams const &) const;
///

View File

@ -192,7 +192,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
}
InsetOld::EDITABLE InsetCollapsable::editable() const
InsetBase::EDITABLE InsetCollapsable::editable() const
{
return status_ != Collapsed ? HIGHLY_EDITABLE : IS_EDITABLE;
}

View File

@ -129,7 +129,7 @@ void InsetCommand::doDispatch(LCursor & cur, FuncRequest & cmd)
}
default:
InsetOld::doDispatch(cur, cmd);
InsetBase::doDispatch(cur, cmd);
break;
}

View File

@ -59,7 +59,7 @@ public:
virtual int docbook(Buffer const &, std::ostream &,
OutputParams const & runparams) const;
///
InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::NO_CODE; }
///
InsetCommandParams const & params() const { return p_; }

View File

@ -25,14 +25,14 @@ public:
///
void read(Buffer const & buf, LyXLex & lex);
///
InsetOld::Code lyxCode() const { return InsetOld::ENVIRONMENT_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::ENVIRONMENT_CODE; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;
///
std::string const editMessage() const;
///
InsetOld::EDITABLE editable() const { return HIGHLY_EDITABLE; }
InsetBase::EDITABLE editable() const { return HIGHLY_EDITABLE; }
///
bool isTextInset() const { return true; }
///

View File

@ -263,9 +263,9 @@ void InsetERT::setButtonLabel()
}
bool InsetERT::insetAllowed(InsetOld::Code code) const
bool InsetERT::insetAllowed(InsetBase::Code code) const
{
return code == InsetOld::NEWLINE_CODE;
return code == InsetBase::NEWLINE_CODE;
}

View File

@ -37,13 +37,13 @@ public:
///
~InsetERT();
///
InsetOld::Code lyxCode() const { return InsetOld::ERT_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; }
///
void write(Buffer const & buf, std::ostream & os) const;
///
std::string const editMessage() const;
///
bool insetAllowed(InsetOld::Code code) const;
bool insetAllowed(InsetBase::Code code) const;
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;

View File

@ -462,7 +462,7 @@ void InsetExternal::doDispatch(LCursor & cur, FuncRequest & cmd)
break;
default:
InsetOld::doDispatch(cur, cmd);
InsetBase::doDispatch(cur, cmd);
}
}

View File

@ -107,7 +107,7 @@ public:
///
virtual ~InsetExternal();
///
virtual InsetOld::Code lyxCode() const { return EXTERNAL_CODE; }
virtual InsetBase::Code lyxCode() const { return EXTERNAL_CODE; }
///
virtual EDITABLE editable() const { return IS_EDITABLE; }

View File

@ -381,11 +381,11 @@ int InsetFloat::docbook(Buffer const & buf, ostream & os,
}
bool InsetFloat::insetAllowed(InsetOld::Code code) const
bool InsetFloat::insetAllowed(InsetBase::Code code) const
{
return code != InsetOld::FLOAT_CODE
&& code != InsetOld::FOOT_CODE
&& code != InsetOld::MARGIN_CODE;
return code != InsetBase::FLOAT_CODE
&& code != InsetBase::FOOT_CODE
&& code != InsetBase::MARGIN_CODE;
}

View File

@ -51,7 +51,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;
@ -64,7 +64,7 @@ public:
///
std::string const editMessage() const;
///
bool insetAllowed(InsetOld::Code) const;
bool insetAllowed(InsetBase::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

@ -57,9 +57,9 @@ string const InsetFloatList::getScreenLabel(Buffer const & buf) const
}
InsetOld::Code InsetFloatList::lyxCode() const
InsetBase::Code InsetFloatList::lyxCode() const
{
return InsetOld::FLOAT_LIST_CODE;
return InsetBase::FLOAT_LIST_CODE;
}

View File

@ -28,7 +28,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const;
InsetBase::Code lyxCode() const;
///
bool display() const { return true; }
///

View File

@ -23,7 +23,7 @@ public:
///
InsetFoot(BufferParams const &);
///
InsetOld::Code lyxCode() const { return InsetOld::FOOT_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::FOOT_CODE; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;

View File

@ -49,10 +49,10 @@ void InsetFootlike::write(Buffer const & buf, ostream & os) const
}
bool InsetFootlike::insetAllowed(InsetOld::Code code) const
bool InsetFootlike::insetAllowed(InsetBase::Code code) const
{
if (code == InsetOld::FOOT_CODE || code == InsetOld::MARGIN_CODE
|| code == InsetOld::FLOAT_CODE)
if (code == InsetBase::FOOT_CODE || code == InsetBase::MARGIN_CODE
|| code == InsetBase::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(InsetOld::Code) const;
bool insetAllowed(InsetBase::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

@ -210,7 +210,7 @@ void InsetGraphics::doDispatch(LCursor & cur, FuncRequest & cmd)
break;
default:
InsetOld::doDispatch(cur, cmd);
InsetBase::doDispatch(cur, cmd);
break;
}
}
@ -236,7 +236,7 @@ void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
}
InsetOld::EDITABLE InsetGraphics::editable() const
InsetBase::EDITABLE InsetGraphics::editable() const
{
return IS_EDITABLE;
}

View File

@ -61,7 +61,7 @@ public:
void validate(LaTeXFeatures & features) const;
/// returns LyX code associated with the inset. Used for TOC, ...)
InsetOld::Code lyxCode() const { return InsetOld::GRAPHICS_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::GRAPHICS_CODE; }
/** Set the inset parameters, used by the GUIndependent dialog.
Return true of new params are different from what was so far.

View File

@ -24,7 +24,7 @@ public:
///
std::string const getScreenLabel(Buffer const &) const;
///
InsetOld::Code lyxCode() const { return InsetOld::HFILL_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::HFILL_CODE; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;

View File

@ -143,7 +143,7 @@ void InsetInclude::doDispatch(LCursor & cur, FuncRequest & cmd)
break;
default:
InsetOld::doDispatch(cur, cmd);
InsetBase::doDispatch(cur, cmd);
break;
}
}

View File

@ -41,7 +41,7 @@ public:
InsetCommandParams const & params(void) const;
///
InsetOld::Code lyxCode() const { return InsetOld::INCLUDE_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::INCLUDE_CODE; }
/** Fills \c list
* \param buffer the Buffer containing this inset.
* \param list the list of labels in the child buffer.

View File

@ -49,9 +49,9 @@ int InsetIndex::docbook(Buffer const &, ostream & os,
}
InsetOld::Code InsetIndex::lyxCode() const
InsetBase::Code InsetIndex::lyxCode() const
{
return InsetOld::INDEX_CODE;
return InsetBase::INDEX_CODE;
}
@ -78,7 +78,7 @@ void InsetPrintIndex::validate(LaTeXFeatures & features) const
}
InsetOld::Code InsetPrintIndex::lyxCode() const
InsetBase::Code InsetPrintIndex::lyxCode() const
{
return InsetOld::INDEX_PRINT_CODE;
return InsetBase::INDEX_PRINT_CODE;
}

View File

@ -28,7 +28,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const;
InsetBase::Code lyxCode() const;
///
int docbook(Buffer const &, std::ostream &,
OutputParams const &) const;
@ -48,7 +48,7 @@ public:
///
EDITABLE editable() const { return NOT_EDITABLE; }
///
InsetOld::Code lyxCode() const;
InsetBase::Code lyxCode() const;
///
bool display() const { return true; }
///

View File

@ -23,7 +23,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const { return InsetOld::LABEL_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::LABEL_CODE; }
/// Appends \c list with this label
void getLabelList(Buffer const &, std::vector<std::string> & list) const;
///

View File

@ -640,9 +640,9 @@ bool InsetLatexAccent::directWrite() const
}
InsetOld::Code InsetLatexAccent::lyxCode() const
InsetBase::Code InsetLatexAccent::lyxCode() const
{
return InsetOld::ACCENT_CODE;
return InsetBase::ACCENT_CODE;
}

View File

@ -60,7 +60,7 @@ public:
///
bool directWrite() const;
///
InsetOld::Code lyxCode()const;
InsetBase::Code lyxCode()const;
///
inline bool canDisplay();
// should this inset be handled like a normal charater

View File

@ -20,7 +20,7 @@ public:
InsetLine() {}
InsetOld::Code lyxCode() const { return InsetOld::LINE_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::LINE_CODE; }
void metrics(MetricsInfo &, Dimension &) const;

View File

@ -24,7 +24,7 @@ public:
///
InsetMarginal(BufferParams const &);
///
InsetOld::Code lyxCode() const { return InsetOld::MARGIN_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::MARGIN_CODE; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;

View File

@ -20,7 +20,7 @@ public:
InsetNewline() {}
InsetOld::Code lyxCode() const { return InsetOld::NEWLINE_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::NEWLINE_CODE; }
void metrics(MetricsInfo &, Dimension &) const;

View File

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

View File

@ -25,7 +25,7 @@ public:
InsetOptArg(BufferParams const &);
/// code of the inset
InsetOld::Code lyxCode() const { return InsetOld::OPTARG_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::OPTARG_CODE; }
/// return an message upon editing
std::string const editMessage() const;

View File

@ -20,7 +20,7 @@ public:
InsetPagebreak() {}
InsetOld::Code lyxCode() const { return InsetOld::LINE_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::LINE_CODE; }
void metrics(MetricsInfo &, Dimension &) const;

View File

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

View File

@ -96,7 +96,7 @@ public:
///
void validate(LaTeXFeatures &) const;
///
InsetOld::Code lyxCode() const;
InsetBase::Code lyxCode() const;
// should this inset be handled like a normal character
bool isChar() const { return true; }

View File

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

View File

@ -73,7 +73,7 @@ public:
int docbook(Buffer const &, std::ostream &,
OutputParams const &) const;
///
InsetOld::Code lyxCode() const { return InsetOld::SPACE_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::SPACE_CODE; }
/// We don't need \begin_inset and \end_inset
bool directWrite() const { return true; }

View File

@ -65,7 +65,7 @@ public:
int docbook(Buffer const &, std::ostream &,
OutputParams const &) const;
///
InsetOld::Code lyxCode() const { return InsetOld::SPECIALCHAR_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::SPECIALCHAR_CODE; }
/// We don't need \begin_inset and \end_inset
bool directWrite() const { return true; }
///

View File

@ -911,7 +911,7 @@ int InsetTabular::docbook(Buffer const & buf, ostream & os,
OutputParams const & runparams) const
{
int ret = 0;
InsetOld * master = 0;
InsetBase * master = 0;
#ifdef WITH_WARNINGS
#warning Why not pass a proper DocIterator here?
@ -920,7 +920,7 @@ int InsetTabular::docbook(Buffer const & buf, ostream & os,
// if the table is inside a float it doesn't need the informaltable
// wrapper. Search for it.
for (master = owner(); master; master = master->owner())
if (master->lyxCode() == InsetOld::FLOAT_CODE)
if (master->lyxCode() == InsetBase::FLOAT_CODE)
break;
#endif

View File

@ -44,11 +44,11 @@ string const InsetTOC::getScreenLabel(Buffer const &) const
}
InsetOld::Code InsetTOC::lyxCode() const
InsetBase::Code InsetTOC::lyxCode() const
{
if (getCmdName() == "tableofcontents")
return InsetOld::TOC_CODE;
return InsetOld::NO_CODE;
return InsetBase::TOC_CODE;
return InsetBase::NO_CODE;
}

View File

@ -25,7 +25,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const;
InsetBase::Code lyxCode() const;
///
bool display() const { return true; }
///

View File

@ -25,7 +25,7 @@ public:
explicit
InsetUrl(InsetCommandParams const &);
///
InsetOld::Code lyxCode() const { return InsetOld::URL_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::URL_CODE; }
///
void validate(LaTeXFeatures &) const;
///

View File

@ -74,7 +74,7 @@ void InsetVSpace::doDispatch(LCursor & cur, FuncRequest & cmd)
break;
default:
InsetOld::doDispatch(cur, cmd);
InsetBase::doDispatch(cur, cmd);
break;
}
}

View File

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

View File

@ -47,7 +47,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
InsetOld::Code lyxCode() const { return InsetOld::WRAP_CODE; }
InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;
@ -57,7 +57,7 @@ public:
///
std::string const editMessage() const;
///
bool insetAllowed(InsetOld::Code) const;
bool insetAllowed(InsetBase::Code) const;
///
void addToToc(lyx::toc::TocList &, Buffer const &) const;
///

View File

@ -33,7 +33,7 @@ using lyx::support::strToInt;
// An updatable inset is highly editable by definition
InsetOld::EDITABLE UpdatableInset::editable() const
InsetBase::EDITABLE UpdatableInset::editable() const
{
return HIGHLY_EDITABLE;
}
@ -106,7 +106,7 @@ void UpdatableInset::doDispatch(LCursor & cur, FuncRequest & cmd)
break;
default:
InsetOld::dispatch(cur, cmd);
InsetBase::dispatch(cur, cmd);
}
}

View File

@ -396,27 +396,27 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
if (!inset)
break;
InsetOld::Code code = inset->lyxCode();
InsetBase::Code code = inset->lyxCode();
switch (code) {
case InsetOld::TABULAR_CODE:
case InsetBase::TABULAR_CODE:
enable = cmd.argument == "tabular";
break;
case InsetOld::ERT_CODE:
case InsetBase::ERT_CODE:
enable = cmd.argument == "ert";
break;
case InsetOld::FLOAT_CODE:
case InsetBase::FLOAT_CODE:
enable = cmd.argument == "float";
break;
case InsetOld::WRAP_CODE:
case InsetBase::WRAP_CODE:
enable = cmd.argument == "wrap";
break;
case InsetOld::NOTE_CODE:
case InsetBase::NOTE_CODE:
enable = cmd.argument == "note";
break;
case InsetOld::BRANCH_CODE:
case InsetBase::BRANCH_CODE:
enable = cmd.argument == "branch";
break;
case InsetOld::BOX_CODE:
case InsetBase::BOX_CODE:
enable = cmd.argument == "box";
break;
default:
@ -437,7 +437,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
enable = Exporter::IsExportable(*buf, "dvi")
&& lyxrc.print_command != "none";
else if (name == "character")
enable = cur.inset().lyxCode() != InsetOld::ERT_CODE;
enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
else if (name == "vclog")
enable = buf->lyxvc().inUse();
else if (name == "latexlog")

View File

@ -30,7 +30,7 @@ class BufferView;
class CursorSlice;
class Dimension;
class InsetBase;
class InsetOld_code;
class InsetBase_code;
class FuncRequest;
class FuncStatus;
class LColor_color;
@ -255,13 +255,13 @@ public:
/// Find next inset of some specified type.
bool gotoNextInset(LCursor & cur,
std::vector<InsetOld_code> const & codes,
std::vector<InsetBase_code> const & codes,
std::string const & contents = std::string());
///
void gotoInset(LCursor & cur,
std::vector<InsetOld_code> const & codes, bool same_content);
std::vector<InsetBase_code> const & codes, bool same_content);
///
void gotoInset(LCursor & cur, InsetOld_code code, bool same_content);
void gotoInset(LCursor & cur, InsetBase_code code, bool same_content);
/// current text width
int width() const;

View File

@ -45,7 +45,7 @@ void linuxdocParagraphs(Buffer const & buf,
// treat <toc> as a special case for compatibility with old code
if (!pit->empty() && pit->isInset(0)) {
InsetBase const * inset = pit->getInset(0);
if (inset->lyxCode() == InsetOld::TOC_CODE) {
if (inset->lyxCode() == InsetBase::TOC_CODE) {
string const temp = "toc";
sgml::openTag(os, temp);
continue;

View File

@ -306,7 +306,7 @@ void Paragraph::insertInset(pos_type pos, InsetBase * inset,
}
bool Paragraph::insetAllowed(InsetOld_code code)
bool Paragraph::insetAllowed(InsetBase_code code)
{
return !pimpl_->inset_owner || pimpl_->inset_owner->insetAllowed(code);
}

View File

@ -35,7 +35,7 @@ class BufferView;
class Counters;
class InsetBase;
class InsetBibitem;
class InsetOld_code;
class InsetBase_code;
class Language;
class LaTeXFeatures;
class OutputParams;
@ -319,7 +319,7 @@ public:
void insertInset(lyx::pos_type pos, InsetBase * inset,
LyXFont const &, Change change = Change(Change::INSERTED));
///
bool insetAllowed(InsetOld_code code);
bool insetAllowed(InsetBase_code code);
///
InsetBase * getInset(lyx::pos_type pos);
///

View File

@ -185,7 +185,7 @@ string const freefont2string()
}
bool LyXText::gotoNextInset(LCursor & cur,
vector<InsetOld_code> const & codes, string const & contents)
vector<InsetBase_code> const & codes, string const & contents)
{
BOOST_ASSERT(this == cur.text());
pit_type end = paragraphs().size();
@ -218,7 +218,7 @@ bool LyXText::gotoNextInset(LCursor & cur,
void LyXText::gotoInset(LCursor & cur,
vector<InsetOld_code> const & codes, bool same_content)
vector<InsetBase_code> const & codes, bool same_content)
{
cur.clearSelection();
@ -249,9 +249,9 @@ void LyXText::gotoInset(LCursor & cur,
}
void LyXText::gotoInset(LCursor & cur, InsetOld_code code, bool same_content)
void LyXText::gotoInset(LCursor & cur, InsetBase_code code, bool same_content)
{
gotoInset(cur, vector<InsetOld_code>(1, code), same_content);
gotoInset(cur, vector<InsetBase_code>(1, code), same_content);
}
@ -981,7 +981,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
break;
case LFUN_REFERENCE_GOTO: {
vector<InsetOld_code> tmp;
vector<InsetBase_code> tmp;
tmp.push_back(InsetBase::LABEL_CODE);
tmp.push_back(InsetBase::REF_CODE);
gotoInset(cur, tmp, true);
@ -1594,7 +1594,7 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
break;
case LFUN_INSET_OPTARG:
enable = numberOfOptArgs(cur.paragraph())
enable = numberOfOptArgs(cur.paragraph())
< cur.paragraph().layout()->optionalargs;
break;
@ -1604,117 +1604,117 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
#if 0
// the functions which insert insets
InsetOld::Code code = InsetOld::NO_CODE;
InsetBase::Code code = InsetBase::NO_CODE;
switch (cmd.action) {
case LFUN_DIALOG_SHOW_NEW_INSET:
if (cmd.argument == "bibitem")
code = InsetOld::BIBITEM_CODE;
code = InsetBase::BIBITEM_CODE;
else if (cmd.argument == "bibtex")
code = InsetOld::BIBTEX_CODE;
code = InsetBase::BIBTEX_CODE;
else if (cmd.argument == "box")
code = InsetOld::BOX_CODE;
code = InsetBase::BOX_CODE;
else if (cmd.argument == "branch")
code = InsetOld::BRANCH_CODE;
code = InsetBase::BRANCH_CODE;
else if (cmd.argument == "citation")
code = InsetOld::CITE_CODE;
code = InsetBase::CITE_CODE;
else if (cmd.argument == "ert")
code = InsetOld::ERT_CODE;
code = InsetBase::ERT_CODE;
else if (cmd.argument == "external")
code = InsetOld::EXTERNAL_CODE;
code = InsetBase::EXTERNAL_CODE;
else if (cmd.argument == "float")
code = InsetOld::FLOAT_CODE;
code = InsetBase::FLOAT_CODE;
else if (cmd.argument == "graphics")
code = InsetOld::GRAPHICS_CODE;
code = InsetBase::GRAPHICS_CODE;
else if (cmd.argument == "include")
code = InsetOld::INCLUDE_CODE;
code = InsetBase::INCLUDE_CODE;
else if (cmd.argument == "index")
code = InsetOld::INDEX_CODE;
code = InsetBase::INDEX_CODE;
else if (cmd.argument == "label")
code = InsetOld::LABEL_CODE;
code = InsetBase::LABEL_CODE;
else if (cmd.argument == "note")
code = InsetOld::NOTE_CODE;
code = InsetBase::NOTE_CODE;
else if (cmd.argument == "ref")
code = InsetOld::REF_CODE;
code = InsetBase::REF_CODE;
else if (cmd.argument == "toc")
code = InsetOld::TOC_CODE;
code = InsetBase::TOC_CODE;
else if (cmd.argument == "url")
code = InsetOld::URL_CODE;
code = InsetBase::URL_CODE;
else if (cmd.argument == "vspace")
code = InsetOld::VSPACE_CODE;
code = InsetBase::VSPACE_CODE;
else if (cmd.argument == "wrap")
code = InsetOld::WRAP_CODE;
code = InsetBase::WRAP_CODE;
break;
case LFUN_INSET_ERT:
code = InsetOld::ERT_CODE;
code = InsetBase::ERT_CODE;
break;
case LFUN_INSET_FOOTNOTE:
code = InsetOld::FOOT_CODE;
code = InsetBase::FOOT_CODE;
break;
case LFUN_TABULAR_INSERT:
code = InsetOld::TABULAR_CODE;
code = InsetBase::TABULAR_CODE;
break;
case LFUN_INSET_MARGINAL:
code = InsetOld::MARGIN_CODE;
code = InsetBase::MARGIN_CODE;
break;
case LFUN_INSET_FLOAT:
case LFUN_INSET_WIDE_FLOAT:
code = InsetOld::FLOAT_CODE;
code = InsetBase::FLOAT_CODE;
break;
case LFUN_INSET_WRAP:
code = InsetOld::WRAP_CODE;
code = InsetBase::WRAP_CODE;
break;
case LFUN_FLOAT_LIST:
code = InsetOld::FLOAT_LIST_CODE;
code = InsetBase::FLOAT_LIST_CODE;
break;
#if 0
case LFUN_INSET_LIST:
code = InsetOld::LIST_CODE;
code = InsetBase::LIST_CODE;
break;
case LFUN_INSET_THEOREM:
code = InsetOld::THEOREM_CODE;
code = InsetBase::THEOREM_CODE;
break;
#endif
case LFUN_INSET_CAPTION:
code = InsetOld::CAPTION_CODE;
code = InsetBase::CAPTION_CODE;
break;
case LFUN_INSERT_NOTE:
code = InsetOld::NOTE_CODE;
code = InsetBase::NOTE_CODE;
break;
case LFUN_INSERT_CHARSTYLE:
code = InsetOld::CHARSTYLE_CODE;
code = InsetBase::CHARSTYLE_CODE;
if (buf->params().getLyXTextClass().charstyles().empty())
enable = false;
break;
case LFUN_INSERT_BOX:
code = InsetOld::BOX_CODE;
code = InsetBase::BOX_CODE;
break;
case LFUN_INSERT_BRANCH:
code = InsetOld::BRANCH_CODE;
code = InsetBase::BRANCH_CODE;
if (buf->params().branchlist().empty())
enable = false;
break;
case LFUN_INSERT_LABEL:
code = InsetOld::LABEL_CODE;
code = InsetBase::LABEL_CODE;
break;
case LFUN_INSET_OPTARG:
code = InsetOld::OPTARG_CODE;
code = InsetBase::OPTARG_CODE;
break;
case LFUN_ENVIRONMENT_INSERT:
code = InsetOld::BOX_CODE;
code = InsetBase::BOX_CODE;
break;
case LFUN_INDEX_INSERT:
code = InsetOld::INDEX_CODE;
code = InsetBase::INDEX_CODE;
break;
case LFUN_INDEX_PRINT:
code = InsetOld::INDEX_PRINT_CODE;
code = InsetBase::INDEX_PRINT_CODE;
break;
case LFUN_TOC_INSERT:
code = InsetOld::TOC_CODE;
code = InsetBase::TOC_CODE;
break;
case LFUN_HTMLURL:
case LFUN_URL:
code = InsetOld::URL_CODE;
code = InsetBase::URL_CODE;
break;
case LFUN_QUOTE:
// always allow this, since we will inset a raw quote
@ -1726,22 +1726,22 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
case LFUN_MENU_SEPARATOR:
case LFUN_LDOTS:
case LFUN_END_OF_SENTENCE:
code = InsetOld::SPECIALCHAR_CODE;
code = InsetBase::SPECIALCHAR_CODE;
break;
case LFUN_SPACE_INSERT:
// slight hack: we know this is allowed in math mode
if (cur.inTexted())
code = InsetOld::SPACE_CODE;
code = InsetBase::SPACE_CODE;
break;
case LFUN_INSET_DIALOG_SHOW: {
InsetBase * inset = cur.nextInset();
enable = inset;
if (inset) {
code = inset->lyxCode();
if (!(code == InsetOld::INCLUDE_CODE
|| code == InsetOld::BIBTEX_CODE
|| code == InsetOld::FLOAT_LIST_CODE
|| code == InsetOld::TOC_CODE))
if (!(code == InsetBase::INCLUDE_CODE
|| code == InsetBase::BIBTEX_CODE
|| code == InsetBase::FLOAT_LIST_CODE
|| code == InsetBase::TOC_CODE))
enable = false;
}
break;
@ -1750,7 +1750,7 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
break;
}
if (code != InsetOld::NO_CODE
if (code != InsetBase::NO_CODE
&& (cur.empty() || !cur.inset().insetAllowed(code)))
enable = false;

View File

@ -86,10 +86,10 @@ 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() == InsetOld::FLOAT_CODE) {
if (it->inset->lyxCode() == InsetBase::FLOAT_CODE) {
static_cast<InsetFloat*>(it->inset)
->addToToc(toclist, buf);
} else if (it->inset->lyxCode() == InsetOld::WRAP_CODE) {
} else if (it->inset->lyxCode() == InsetBase::WRAP_CODE) {
static_cast<InsetWrap*>(it->inset)
->addToToc(toclist, buf);
}