InsetList::iterator it = insetlist.begin();
InsetList::iterator end = insetlist.end();
for (; it != end; ++it)
- it->inset = it->inset->clone().release();
+ it->inset = it->inset->clone();
}
InsetList::iterator it = insetlist.begin();
InsetList::iterator end = insetlist.end();
for (; it != end; ++it)
- it->inset = it->inset->clone().release();
+ it->inset = it->inset->clone();
layout_ = par.layout();
text_ = par.text_;
} // namespace external
} // namespace lyx
+
+
+
{}
-std::auto_ptr<Inset> Inset::clone() const
-{
- std::auto_ptr<Inset> b = doClone();
- BOOST_ASSERT(typeid(*b) == typeid(*this));
- return b;
-}
-
-
Inset::Code Inset::translate(std::string const & name)
{
static TranslatorMap const translator = build_translator();
#ifndef INSETBASE_H
#define INSETBASE_H
-//#include "BiblioInfo.h"
-#include "Changes.h"
#include "Dimension.h"
#include "support/docstream.h"
class Buffer;
class BufferParams;
class BufferView;
-class ParIterator;
-class ParConstIterator;
+class Change;
+class Color_color;
+class Cursor;
class CursorSlice;
-class InsetIterator;
class FuncRequest;
class FuncStatus;
+class InsetIterator;
class InsetLayout;
class InsetMath;
class InsetText;
class LaTeXFeatures;
-class Color_color;
-class Cursor;
class Lexer;
-class Text;
+class MathAtom;
class MetricsInfo;
-class Dimension;
-class PainterInfo;
class OutputParams;
+class PainterInfo;
+class Paragraph;
+class ParConstIterator;
+class ParIterator;
+class Text;
class TocList;
/// virtual base class destructor
virtual ~Inset() {}
- /// replicate ourselves
- std::auto_ptr<Inset> clone() const;
/// identification as math inset
virtual InsetMath * asInsetMath() { return 0; }
protected:
Inset();
+ /// replicate ourselves
+ friend class Paragraph;
+ friend class MathAtom;
+ virtual Inset * clone() const = 0;
+
/** The real dispatcher.
* Gets normally called from Cursor::dispatch(). Cursor::dispatch()
* assumes the common case of 'LFUN handled, need update'.
/// Cached dimensions of the inset.
mutable Dimension dim_;
-private:
- virtual std::auto_ptr<Inset> doClone() const = 0;
};
namespace lyx {
-using support::prefixIs;
-
-using std::max;
-using std::string;
-using std::auto_ptr;
-using std::ostream;
int InsetBibitem::key_counter = 0;
+
+
docstring const key_prefix = from_ascii("key-");
+
InsetBibitem::InsetBibitem(InsetCommandParams const & p)
: InsetCommand(p, "bibitem")
{
}
-auto_ptr<Inset> InsetBibitem::doClone() const
+Inset * InsetBibitem::clone() const
{
- auto_ptr<InsetBibitem> b(new InsetBibitem(params()));
+ InsetBibitem * b = new InsetBibitem(params());
b->autolabel_ = autolabel_;
- return auto_ptr<Inset>(b);
+ return b;
}
{
InsetCommand::read(buf, lex);
- if (prefixIs(getParam("key"), key_prefix)) {
+ if (support::prefixIs(getParam("key"), key_prefix)) {
int const key = convert<int>(getParam("key").substr(key_prefix.length()));
- key_counter = max(key_counter, key);
+ key_counter = std::max(key_counter, key);
}
}
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// The label that is set by updateLabels
docstring autolabel_;
{}
-std::auto_ptr<Inset> InsetBibtex::doClone() const
+Inset * InsetBibtex::clone() const
{
- return std::auto_ptr<Inset>(new InsetBibtex(*this));
+ return new InsetBibtex(*this);
}
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::auto_ptr;
using std::string;
using std::istringstream;
using std::ostream;
}
-auto_ptr<Inset> InsetBox::doClone() const
+Inset * InsetBox::clone() const
{
- return auto_ptr<Inset>(new InsetBox(*this));
+ return new InsetBox(*this);
}
private:
friend class InsetBoxParams;
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// used by the constructors
void init();
namespace lyx {
using std::string;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
}
-auto_ptr<Inset> InsetBranch::doClone() const
+Inset * InsetBranch::clone() const
{
- return auto_ptr<Inset>(new InsetBranch(*this));
+ return new InsetBranch(*this);
}
private:
friend class InsetBranchParams;
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// used by the constructors
void init();
#include <sstream>
-using std::auto_ptr;
using std::endl;
using std::string;
using std::ostream;
namespace lyx {
-using support::bformat;
InsetCaption::InsetCaption(InsetCaption const & ic)
: InsetText(ic), textclass_(ic.textclass_)
void InsetCaption::updateLabels(Buffer const & buf, ParIterator const & it)
{
+ using support::bformat;
TextClass const & tclass = buf.params().getTextClass();
Counters & cnts = tclass.counters();
string const & type = cnts.current_float();
}
-auto_ptr<Inset> InsetCaption::doClone() const
+Inset * InsetCaption::clone() const
{
- return auto_ptr<Inset>(new InsetCaption(*this));
+ return new InsetCaption(*this);
}
private:
///
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
mutable docstring full_label_;
///
namespace lyx {
using std::string;
-using std::auto_ptr;
-using std::istringstream;
-using std::max;
using std::ostream;
-using std::ostringstream;
-
InsetCharStyle::InsetCharStyle(BufferParams const & bp, string const s)
{}
-auto_ptr<Inset> InsetCharStyle::doClone() const
+Inset * InsetCharStyle::clone() const
{
- return auto_ptr<Inset>(new InsetCharStyle(*this));
+ return new InsetCharStyle(*this);
}
private:
friend class InsetCharStyleParams;
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
InsetCharStyleParams params_;
namespace lyx {
-using support::ascii_lowercase;
-using support::contains;
using support::FileName;
using support::getStringFromVector;
using support::getVectorFromString;
using support::tokenPos;
using std::endl;
-using std::replace;
using std::string;
-using std::ostream;
using std::vector;
-using std::map;
namespace fs = boost::filesystem;
docstring const getBasicLabel(docstring const & keyList, docstring const & after)
{
+ using support::contains;
+
docstring keys(keyList);
docstring label;
{
if (tokenPos(getContents(), ',', from) != -1) {
vector<string> items = getVectorFromString(getContents());
- replace(items.begin(), items.end(), from, to);
+ std::replace(items.begin(), items.end(), from, to);
setContents(getStringFromVector(items));
}
}
void replaceContents(std::string const & from, std::string const & to);
private:
- virtual std::auto_ptr<Inset> doClone() const
+ virtual Inset * clone() const
{
- return std::auto_ptr<Inset>(new InsetCitation(params()));
+ return new InsetCitation(params());
}
/// This function does the donkey work of creating the pretty label
namespace lyx {
-using graphics::PreviewLoader;
-
using std::endl;
using std::string;
-using std::max;
-using std::min;
using std::ostream;
bool InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
{
+ using std::max;
+
autoOpen_ = mi.base.bv->cursor().isInside(this);
mi.base.textwidth -= (int) (1.5 * TEXT_TO_INSET_OFFSET);
docstring label;
pos_type const max_length = 15;
pos_type const p_siz = paragraphs().begin()->size();
- pos_type const n = min(max_length, p_siz);
+ pos_type const n = std::min(max_length, p_siz);
pos_type i = 0;
pos_type j = 0;
for (; i < n && j < p_siz; ++j) {
using std::string;
using std::istringstream;
-using std::ostream;
using std::ostringstream;
using std::endl;
using std::min;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
}
-auto_ptr<Inset> InsetERT::doClone() const
+Inset * InsetERT::clone() const
{
- return auto_ptr<Inset>(new InsetERT(*this));
+ return new InsetERT(*this);
}
///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
void init();
///
namespace lyx {
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-
InsetEnvironment::InsetEnvironment
(BufferParams const & bp, docstring const & name)
{}
-auto_ptr<Inset> InsetEnvironment::doClone() const
+Inset * InsetEnvironment::clone() const
{
- return auto_ptr<Inset>(new InsetEnvironment(*this));
+ return new InsetEnvironment(*this);
}
-void InsetEnvironment::write(Buffer const & buf, ostream & os) const
+void InsetEnvironment::write(Buffer const & buf, std::ostream & os) const
{
os << "Environment " << to_utf8(name()) << "\n";
InsetText::write(buf, os);
protected:
InsetEnvironment(InsetEnvironment const &);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// the layout
LayoutPtr layout_;
///
#include <sstream>
-using std::endl;
using std::string;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
{}
-auto_ptr<Inset> InsetExternal::doClone() const
+Inset * InsetExternal::clone() const
{
- return auto_ptr<Inset>(new InsetExternal(*this));
+ return new InsetExternal(*this);
}
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/** This method is connected to the graphics loader, so we are
* informed when the image has been loaded.
namespace lyx {
-using support::contains;
-
using std::endl;
using std::string;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
void InsetFloat::validate(LaTeXFeatures & features) const
{
- if (contains(params_.placement, 'H')) {
+ if (support::contains(params_.placement, 'H')) {
features.require("float");
}
}
-auto_ptr<Inset> InsetFloat::doClone() const
+Inset * InsetFloat::clone() const
{
- return auto_ptr<Inset>(new InsetFloat(*this));
+ return new InsetFloat(*this);
}
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
///
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
InsetFloatParams params_;
///
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const
+ virtual Inset * clone() const
{
- return std::auto_ptr<Inset>(new InsetFloatList(to_ascii(getParam("type"))));
+ return new InsetFloatList(to_ascii(getParam("type")));
}
};
{}
-auto_ptr<Inset> InsetFoot::doClone() const
+Inset * InsetFoot::clone() const
{
- return auto_ptr<Inset>(new InsetFoot(*this));
+ return new InsetFoot(*this);
}
InsetCollapsable::updateLabels(buf, it);
}
+
int InsetFoot::latex(Buffer const & buf, odocstream & os,
OutputParams const & runparams_in) const
{
protected:
InsetFoot(InsetFoot const &);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
#include "BufferParams.h"
#include "MetricsInfo.h"
+
namespace lyx {
+
InsetFootlike::InsetFootlike(BufferParams const & bp)
: InsetCollapsable(bp)
{}
using std::endl;
using std::string;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
}
-auto_ptr<Inset> InsetGraphics::doClone() const
+Inset * InsetGraphics::clone() const
{
- return auto_ptr<Inset>(new InsetGraphics(*this));
+ return new InsetGraphics(*this);
}
private:
friend class InsetGraphicsMailer;
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// Read the inset native format
void readInsetGraphics(Lexer & lex, std::string const & bufpath);
unsigned int const bb_orig_yb = convert<int>(token(tmp, ' ', 1));
// new pars.bb values must be >= zero
- if (pars.bb.xl > bb_orig_xl)
+ if (pars.bb.xl > bb_orig_xl)
pars.bb.xl -= bb_orig_xl;
else
pars.bb.xl = 0;
namespace lyx {
-using std::ostream;
-
InsetHFill::InsetHFill()
: InsetCommand(InsetCommandParams("hfill"), std::string())
{}
-std::auto_ptr<Inset> InsetHFill::doClone() const
+Inset * InsetHFill::clone() const
{
- return std::auto_ptr<Inset>(new InsetHFill);
+ return new InsetHFill;
}
}
-void InsetHFill::write(Buffer const &, ostream & os) const
+void InsetHFill::write(Buffer const &, std::ostream & os) const
{
os << "\n\\hfill\n";
}
// a line separator)?
bool isSpace() const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
using std::endl;
using std::string;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
}
-auto_ptr<Inset> InsetInclude::doClone() const
+Inset * InsetInclude::clone() const
{
- return auto_ptr<Inset>(new InsetInclude(*this));
+ return new InsetInclude(*this);
}
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/** Slot receiving a signal that the external file has changed
* and the preview should be regenerated.
{}
-// InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
-// : InsetCommand(p, false)
-// {}
-
-
docstring const InsetIndex::getScreenLabel(Buffer const &) const
{
return _("Idx");
{}
-// InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
-// : InsetCommand(p, false)
-// {}
-
-
docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
{
return _("Index");
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const {
- return std::auto_ptr<Inset>(new InsetIndex(params()));
+ virtual Inset * clone() const {
+ return new InsetIndex(params());
}
};
///
docstring const getScreenLabel(Buffer const &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const {
- return std::auto_ptr<Inset>(new InsetPrintIndex(params()));
+ virtual Inset * clone() const {
+ return new InsetPrintIndex(params());
}
};
namespace lyx {
-using support::escape;
-
-using std::string;
-using std::vector;
-
InsetLabel::InsetLabel(InsetCommandParams const & p)
: InsetCommand(p, "label")
{}
-std::auto_ptr<Inset> InsetLabel::doClone() const
+Inset * InsetLabel::clone() const
{
- return std::auto_ptr<Inset>(new InsetLabel(params()));
+ return new InsetLabel(params());
}
int InsetLabel::latex(Buffer const &, odocstream & os,
OutputParams const &) const
{
- os << escape(getCommand());
+ os << support::escape(getCommand());
return 0;
}
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
using frontend::Painter;
-using std::endl;
using std::ostream;
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const
+ virtual Inset * clone() const
{
- return std::auto_ptr<Inset>(new InsetLine);
+ return new InsetLine;
}
};
using support::contains;
using support::subst;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
using std::string;
-char const lstinline_delimiters[] = "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";
+char const lstinline_delimiters[] =
+ "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";
void InsetListings::init()
{
}
-auto_ptr<Inset> InsetListings::doClone() const
+Inset * InsetListings::clone() const
{
- return auto_ptr<Inset>(new InsetListings(*this));
+ return new InsetListings(*this);
}
///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
void init();
///
using std::string;
using std::exception;
-namespace lyx
-{
+namespace lyx {
using support::bformat;
using support::trim;
namespace lyx {
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-
InsetMarginal::InsetMarginal(BufferParams const & bp)
: InsetFootlike(bp)
{}
-auto_ptr<Inset> InsetMarginal::doClone() const
+Inset * InsetMarginal::clone() const
{
- return auto_ptr<Inset>(new InsetMarginal(*this));
+ new InsetMarginal(*this);
}
protected:
InsetMarginal(InsetMarginal const &);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
// a line separator)?
bool isSpace() const;
private:
- virtual std::auto_ptr<Inset> doClone() const
+ virtual Inset * clone() const
{
- return std::auto_ptr<Inset>(new InsetNewline);
+ return new InsetNewline;
}
};
///
int docbookGlossary(odocstream &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const {
- return std::auto_ptr<Inset>(new InsetNomencl(params()));
+ virtual Inset * clone() const {
+ return new InsetNomencl(params());
}
/// unique id for this nomenclature entry for docbook export
docstring nomenclature_entry_id;
///
docstring const getScreenLabel(Buffer const &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const {
- return std::auto_ptr<Inset>(new InsetPrintNomencl(params()));
+ virtual Inset * clone() const {
+ return new InsetPrintNomencl(params());
}
};
namespace lyx {
using std::string;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
}
-auto_ptr<Inset> InsetNote::doClone() const
+Inset * InsetNote::clone() const
{
- return auto_ptr<Inset>(new InsetNote(*this));
+ return new InsetNote(*this);
}
private:
friend class InsetNoteParams;
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// used by the constructors
void init();
namespace lyx {
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-
InsetOptArg::InsetOptArg(BufferParams const & ins)
: InsetCollapsable(ins)
}
-auto_ptr<Inset> InsetOptArg::doClone() const
+Inset * InsetOptArg::clone() const
{
- return auto_ptr<Inset>(new InsetOptArg(*this));
+ return new InsetOptArg(*this);
}
}
-void InsetOptArg::write(Buffer const & buf, ostream & os) const
+void InsetOptArg::write(Buffer const & buf, std::ostream & os) const
{
os << "OptArg" << "\n";
InsetCollapsable::write(buf, os);
protected:
InsetOptArg(InsetOptArg const &);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
using frontend::Painter;
-using std::endl;
-using std::ostream;
-
void InsetPagebreak::read(Buffer const &, Lexer &)
{
}
-void InsetPagebreak::write(Buffer const &, ostream & os) const
+void InsetPagebreak::write(Buffer const &, std::ostream & os) const
{
os << "\n" << getCmdName() << '\n';
}
virtual std::string getCmdName() const { return "\\newpage"; }
private:
- virtual std::auto_ptr<Inset> doClone() const
+ virtual Inset * clone() const
{
- return std::auto_ptr<Inset>(new InsetPagebreak);
+ return new InsetPagebreak;
}
};
std::string getCmdName() const { return "\\clearpage"; }
private:
- virtual std::auto_ptr<Inset> doClone() const
+ virtual Inset * clone() const
{
- return std::auto_ptr<Inset>(new InsetClearPage);
+ return new InsetClearPage;
}
};
std::string getCmdName() const { return "\\cleardoublepage"; }
private:
- virtual std::auto_ptr<Inset> doClone() const
+ virtual Inset * clone() const
{
- return std::auto_ptr<Inset>(new InsetClearDoublePage);
+ return new InsetClearDoublePage;
}
};
using std::endl;
using std::string;
-using std::auto_ptr;
using std::ostream;
}
-auto_ptr<Inset> InsetQuotes::doClone() const
+Inset * InsetQuotes::clone() const
{
- return auto_ptr<Inset>(new InsetQuotes(language_, side_, times_));
+ return new InsetQuotes(language_, side_, times_);
}
bool isChar() const { return true; }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
quote_language language_;
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<Inset> doClone() const {
- return std::auto_ptr<Inset>(new InsetRef(*this));
+ virtual Inset * clone() const {
+ return new InsetRef(*this);
}
///
bool isLatex;
using std::string;
using std::max;
-using std::auto_ptr;
using std::ostream;
}
-auto_ptr<Inset> InsetSpace::doClone() const
+Inset * InsetSpace::clone() const
{
- return auto_ptr<Inset>(new InsetSpace(kind_));
+ return new InsetSpace(kind_);
}
// a line separator)?
bool isSpace() const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// And which kind is this?
Kind kind_;
namespace lyx {
using std::string;
-using std::auto_ptr;
using std::ostream;
}
-auto_ptr<Inset> InsetSpecialChar::doClone() const
+Inset * InsetSpecialChar::clone() const
{
- return auto_ptr<Inset>(new InsetSpecialChar(kind_));
+ return new InsetSpecialChar(kind_);
}
void InsetSpecialChar::validate(LaTeXFeatures & features) const
{
- if (kind_ == MENU_SEPARATOR) {
+ if (kind_ == MENU_SEPARATOR)
features.require("lyxarrow");
- }
}
// should we break lines after this inset?
bool isLineSeparator() const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// And which kind is this?
Kind kind_;
{}
-std::auto_ptr<Inset> InsetTOC::doClone() const
+Inset * InsetTOC::clone() const
{
- return std::auto_ptr<Inset>(new InsetTOC(*this));
+ return new InsetTOC(*this);
}
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
#include <limits>
using std::abs;
-using std::auto_ptr;
using std::endl;
using std::getline;
using std::istream;
rotate(cs.rotate),
align_special(cs.align_special),
p_width(cs.p_width),
- inset(dynamic_cast<InsetText*>(cs.inset->clone().release()))
+ inset(dynamic_cast<InsetText*>(cs.inset->clone()))
{}
-Tabular::cellstruct &
-Tabular::cellstruct::operator=(cellstruct cs)
+Tabular::cellstruct & Tabular::cellstruct::operator=(cellstruct cs)
{
swap(cs);
return *this;
}
-void
-Tabular::cellstruct::swap(cellstruct & rhs)
+void Tabular::cellstruct::swap(cellstruct & rhs)
{
std::swap(cellno, rhs.cellno);
std::swap(width_of_cell, rhs.width_of_cell);
}
-auto_ptr<Inset> InsetTabular::doClone() const
+Inset * InsetTabular::clone() const
{
- return auto_ptr<Inset>(new InsetTabular(*this));
+ return new InsetTabular(*this);
}
int scroll() const { return scx_; }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
void drawCellLines(frontend::Painter &, int x, int y, row_type row,
using std::for_each;
using std::max;
using std::string;
-using std::auto_ptr;
using std::ostream;
using std::vector;
}
-auto_ptr<Inset> InsetText::doClone() const
+Inset * InsetText::clone() const
{
- return auto_ptr<Inset>(new InsetText(*this));
+ return new InsetText(*this);
}
class Dimension;
class Color_color;
class ParagraphList;
+class InsetTabular;
/**
// Update the counters of this inset and of its contents
virtual void updateLabels(Buffer const &, ParIterator const &);
+ ///
+ virtual Inset * clone() const;
protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- ///
- virtual std::auto_ptr<Inset> doClone() const;
///
void init();
}
-auto_ptr<Inset> Inset.heorem::doClone() const
+Inset * InsetTheorem::clone() const
{
// FIXME: Is this inset used? If YES this is WRONG!!! (Jug)
- auto_ptr<Inset.heorem> result(new InsetTheorem);
+ InsetTheorem * result = new InsetTheorem;
result->setCollapsed(!isOpen());
-
return result;
}
+
bool Inset.heorem::metrics(MetricsInfo & mi, Dimension & dim) const
{
InsetCollapsable::metrics(mi, dim);
///
virtual docstring const editMessage() const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
mutable unsigned int center_indent_;
virtual int textString(Buffer const &, odocstream &,
OutputParams const &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const {
- return std::auto_ptr<Inset>(new InsetUrl(params()));
+ virtual Inset * clone() const {
+ return new InsetUrl(params());
}
};
}
-std::auto_ptr<Inset> InsetVSpace::doClone() const
+Inset * InsetVSpace::clone() const
{
- return std::auto_ptr<Inset>(new InsetVSpace(*this));
+ return new InsetVSpace(*this);
}
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
docstring const label() const;
using std::string;
using std::endl;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
}
-auto_ptr<Inset> InsetWrap::doClone() const
+Inset * InsetWrap::clone() const
{
- return auto_ptr<Inset>(new InsetWrap(*this));
+ return new InsetWrap(*this);
}
///
virtual docstring name() const { return name_; }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
InsetWrapParams params_;
public:
virtual ~RenderBase() {}
- virtual std::auto_ptr<RenderBase> clone(Inset const *) const = 0;
+ virtual RenderBase * clone(Inset const *) const = 0;
/// compute the size of the object returned in dim.
/// \retval true if the metrics has changed.
namespace lyx {
-using std::string;
-using std::auto_ptr;
-
RenderButton::RenderButton()
: editable_(false)
{}
-auto_ptr<RenderBase> RenderButton::clone(Inset const *) const
+RenderBase * RenderButton::clone(Inset const *) const
{
- return auto_ptr<RenderBase>(new RenderButton(*this));
+ return new RenderButton(*this);
}
public:
RenderButton();
- std::auto_ptr<RenderBase> clone(Inset const *) const;
+ RenderBase * clone(Inset const *) const;
/// compute the size of the object returned in dim
virtual bool metrics(MetricsInfo & mi, Dimension & dim) const;
using support::onlyFilename;
using std::string;
-using std::auto_ptr;
RenderGraphic::RenderGraphic(Inset const * inset)
}
-auto_ptr<RenderBase> RenderGraphic::clone(Inset const * inset) const
+RenderBase * RenderGraphic::clone(Inset const * inset) const
{
- return auto_ptr<RenderBase>(new RenderGraphic(*this, inset));
+ return new RenderGraphic(*this, inset);
}
public:
RenderGraphic(Inset const *);
RenderGraphic(RenderGraphic const &, Inset const *);
- std::auto_ptr<RenderBase> clone(Inset const *) const;
+ RenderBase * clone(Inset const *) const;
/// compute the size of the object returned in dim
bool metrics(MetricsInfo & mi, Dimension & dim) const;
using support::FileName;
using std::string;
-using std::auto_ptr;
LyXRC_PreviewStatus RenderPreview::status()
}
-auto_ptr<RenderBase> RenderPreview::clone(Inset const * inset) const
+RenderBase * RenderPreview::clone(Inset const * inset) const
{
- return auto_ptr<RenderBase>(new RenderPreview(*this, inset));
+ return new RenderPreview(*this, inset);
}
RenderPreview(Inset const *);
RenderPreview(RenderPreview const &, Inset const *);
~RenderPreview();
- std::auto_ptr<RenderBase> clone(Inset const *) const;
+ RenderBase * clone(Inset const *) const;
/// Compute the size of the object, returned in dim
bool metrics(MetricsInfo &, Dimension & dim) const;
namespace lyx {
-using std::auto_ptr;
using std::string;
CommandInset::CommandInset(docstring const & name)
}
-auto_ptr<Inset> CommandInset::doClone() const
+Inset * CommandInset::clone() const
{
- return auto_ptr<Inset>(new CommandInset(*this));
+ return new CommandInset(*this);
}
bool isActive() const { return false; }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
docstring name_;
#include <sstream>
using std::string;
-using std::auto_ptr;
using std::ostream;
using std::endl;
}
-auto_ptr<Inset> InsetFormulaMacro::clone() const
+Inset * InsetFormulaMacro::clone() const
{
- return auto_ptr<Inset>(new InsetFormulaMacro(*this));
+ return new InsetFormulaMacro(*this);
}
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
- ///
- std::auto_ptr<Inset> clone() const;
///
Inset::Code lyxCode() const { return MATHMACRO_CODE; }
///
docstring prefix() const;
///
docstring name_;
+ ///
+ Inset * clone() const;
};
#include "support/lstrings.h"
#include "support/std_ostream.h"
-using std::auto_ptr;
namespace lyx {
{}
-auto_ptr<Inset> InsetMathAMSArray::doClone() const
+Inset * InsetMathAMSArray::clone() const
{
- return auto_ptr<Inset>(new InsetMathAMSArray(*this));
+ return new InsetMathAMSArray(*this);
}
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
char const * name_left() const;
///
namespace lyx {
using std::getline;
-using std::auto_ptr;
using std::istringstream;
using std::istream_iterator;
using std::vector;
}
-auto_ptr<Inset> InsetMathArray::doClone() const
+Inset * InsetMathArray::clone() const
{
- return auto_ptr<Inset>(new InsetMathArray(*this));
+ return new InsetMathArray(*this);
}
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
docstring name_;
};
namespace lyx {
-using std::auto_ptr;
-
InsetMathBig::InsetMathBig(docstring const & name, docstring const & delim)
: name_(name), delim_(delim)
}
-auto_ptr<Inset> InsetMathBig::doClone() const
+Inset * InsetMathBig::clone() const
{
- return auto_ptr<Inset>(new InsetMathBig(*this));
+ return new InsetMathBig(*this);
}
static bool isBigInsetDelim(docstring const &);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
size_type size() const;
///
namespace lyx {
-
-using std::max;
-using std::auto_ptr;
-
-
InsetMathBinom::InsetMathBinom(bool choose)
: choose_(choose)
{}
-auto_ptr<Inset> InsetMathBinom::doClone() const
+Inset * InsetMathBinom::clone() const
{
- return auto_ptr<Inset>(new InsetMathBinom(*this));
+ return new InsetMathBinom(*this);
}
cell(1).metrics(mi);
dim.asc = cell(0).height() + 4 + 5;
dim.des = cell(1).height() + 4 - 5;
- dim.wid = max(cell(0).width(), cell(1).width()) + 2 * dw() + 4;
+ dim.wid = std::max(cell(0).width(), cell(1).width()) + 2 * dw() + 4;
metricsMarkers2(dim);
bool const changed = dim_ != dim;
dim_ = dim;
///
bool extraBraces() const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
int dw() const;
///
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathBoldSymbol::InsetMathBoldSymbol()
: InsetMathNest(1)
{}
-auto_ptr<Inset> InsetMathBoldSymbol::doClone() const
+Inset * InsetMathBoldSymbol::clone() const
{
- return auto_ptr<Inset>(new InsetMathBoldSymbol(*this));
+ return new InsetMathBoldSymbol(*this);
}
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::string;
-using std::auto_ptr;
-
-
InsetMathBox::InsetMathBox(docstring const & name)
: InsetMathNest(1), name_(name)
{}
-auto_ptr<Inset> InsetMathBox::doClone() const
+Inset * InsetMathBox::clone() const
{
- return auto_ptr<Inset>(new InsetMathBox(*this));
+ return new InsetMathBox(*this);
}
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
docstring name_;
};
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathBoxed::InsetMathBoxed()
: InsetMathNest(1)
{}
-auto_ptr<Inset> InsetMathBoxed::doClone() const
+Inset * InsetMathBoxed::clone() const
{
- return auto_ptr<Inset>(new InsetMathBoxed(*this));
+ return new InsetMathBoxed(*this);
}
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::max;
-using std::auto_ptr;
-
-
InsetMathBrace::InsetMathBrace()
: InsetMathNest(1)
{}
}
-auto_ptr<Inset> InsetMathBrace::doClone() const
+Inset * InsetMathBrace::clone() const
{
- return auto_ptr<Inset>(new InsetMathBrace(*this));
+ return new InsetMathBrace(*this);
}
{
cell(0).metrics(mi);
Dimension t = theFontMetrics(mi.base.font).dimension('{');
- dim.asc = max(cell(0).ascent(), t.asc);
- dim.des = max(cell(0).descent(), t.des);
+ dim.asc = std::max(cell(0).ascent(), t.asc);
+ dim.des = std::max(cell(0).descent(), t.des);
dim.wid = cell(0).width() + 2 * t.wid;
metricsMarkers(dim);
if (dim_ == dim)
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
using support::bformat;
using std::endl;
-using std::max;
-using std::min;
-using std::swap;
-using std::auto_ptr;
InsetMathCases::InsetMathCases(row_type n)
{}
-auto_ptr<Inset> InsetMathCases::doClone() const
+Inset * InsetMathCases::clone() const
{
- return auto_ptr<Inset>(new InsetMathCases(*this));
+ return new InsetMathCases(*this);
}
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::auto_ptr;
-
extern bool has_math_fonts;
namespace {
-auto_ptr<Inset> InsetMathChar::doClone() const
+Inset * InsetMathChar::clone() const
{
- return auto_ptr<Inset>(new InsetMathChar(*this));
+ return new InsetMathChar(*this);
}
bool isRelOp() const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// the character
char_type char_;
/// cached kerning for superscript
namespace lyx {
-using std::auto_ptr;
-using std::string;
-
InsetMathColor::InsetMathColor(bool oldstyle, Color_color const & color)
: InsetMathNest(1), oldstyle_(oldstyle),
color_(from_utf8(lcolor.getLaTeXName(color)))
{}
-auto_ptr<Inset> InsetMathColor::doClone() const
+Inset * InsetMathColor::clone() const
{
- return auto_ptr<Inset>(new InsetMathColor(*this));
+ return new InsetMathColor(*this);
}
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// width of '[' in current font
mutable int w_;
///
namespace lyx {
-using std::string;
-using std::auto_ptr;
-
-
InsetMathComment::InsetMathComment()
: InsetMathNest(1)
{}
}
-auto_ptr<Inset> InsetMathComment::doClone() const
+Inset * InsetMathComment::clone() const
{
- return auto_ptr<Inset>(new InsetMathComment(*this));
+ return new InsetMathComment(*this);
}
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
} // namespace lyx
namespace lyx {
-
-using std::string;
-using std::max;
-using std::auto_ptr;
-
-
InsetMathDFrac::InsetMathDFrac()
: InsetMathFrac()
{}
-auto_ptr<Inset> InsetMathDFrac::doClone() const
+Inset * InsetMathDFrac::clone() const
{
- return auto_ptr<Inset>(new InsetMathDFrac(*this));
+ return new InsetMathDFrac(*this);
}
{
cell(0).metrics(mi);
cell(1).metrics(mi);
- dim.wid = max(cell(0).width(), cell(1).width()) + 2;
+ dim.wid = std::max(cell(0).width(), cell(1).width()) + 2;
dim.asc = cell(0).height() + 2 + 5;
dim.des = cell(1).height() + 2 - 5;
if (dim_ == dim)
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
}
-std::auto_ptr<Inset> InsetMathDecoration::doClone() const
+Inset * InsetMathDecoration::clone() const
{
- return std::auto_ptr<Inset>(new InsetMathDecoration(*this));
+ return new InsetMathDecoration(*this);
}
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
bool upper() const;
///
#include "frontends/FontMetrics.h"
-namespace lyx {
-
-
-using std::string;
-using std::max;
-using std::auto_ptr;
+namespace lyx {
static docstring convertDelimToLatexName(docstring const & name)
{
}
-auto_ptr<Inset> InsetMathDelim::doClone() const
+Inset * InsetMathDelim::clone() const
{
- return auto_ptr<Inset>(new InsetMathDelim(*this));
+ return new InsetMathDelim(*this);
}
bool InsetMathDelim::metrics(MetricsInfo & mi, Dimension & dim) const
{
+ using std::max;
cell(0).metrics(mi);
Dimension t = theFontMetrics(mi.base.font).dimension('I');
int h0 = (t.asc + t.des) / 2;
///
docstring right_;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
mutable int dw_;
};
namespace lyx {
-using std::auto_ptr;
using std::endl;
{}
-auto_ptr<Inset> InsetMathDiff::doClone() const
+Inset * InsetMathDiff::clone() const
{
- return auto_ptr<Inset>(new InsetMathDiff(*this));
+ return new InsetMathDiff(*this);
}
///
void write(WriteStream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
#include "frontends/FontMetrics.h"
-namespace lyx {
-
-
-using std::string;
-using std::auto_ptr;
+namespace lyx {
InsetMathDots::InsetMathDots(latexkeys const * key)
: key_(key)
{}
-auto_ptr<Inset> InsetMathDots::doClone() const
+Inset * InsetMathDots::clone() const
{
- return auto_ptr<Inset>(new InsetMathDots(*this));
+ return new InsetMathDots(*this);
}
///
latexkeys const * key_;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
} // namespace lyx
namespace lyx {
-
-using std::string;
-using std::auto_ptr;
-
-
InsetMathEnv::InsetMathEnv(docstring const & name)
: InsetMathNest(1), name_(name)
{}
-auto_ptr<Inset> InsetMathEnv::doClone() const
+Inset * InsetMathEnv::clone() const
{
- return auto_ptr<Inset>(new InsetMathEnv(*this));
+ return new InsetMathEnv(*this);
}
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// name of that environment
docstring name_;
};
namespace lyx {
-using std::auto_ptr;
-using std::vector;
using std::string;
}
-auto_ptr<Inset> InsetMathExFunc::doClone() const
+Inset * InsetMathExFunc::clone() const
{
- return auto_ptr<Inset>(new InsetMathExFunc(*this));
+ return new InsetMathExFunc(*this);
}
void octave(OctaveStream &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
docstring const name_;
};
namespace lyx {
-
-using std::string;
-using std::auto_ptr;
using std::endl;
// 3 - upper
-auto_ptr<Inset> InsetMathExInt::doClone() const
+Inset * InsetMathExInt::clone() const
{
- return auto_ptr<Inset>(new InsetMathExInt(*this));
+ return new InsetMathExInt(*this);
}
///
void write(WriteStream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
bool hasScripts() const;
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathFBox::InsetMathFBox()
: InsetMathNest(1)
{}
-auto_ptr<Inset> InsetMathFBox::doClone() const
+Inset * InsetMathFBox::clone() const
{
- return auto_ptr<Inset>(new InsetMathFBox(*this));
+ return new InsetMathFBox(*this);
}
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathFont::InsetMathFont(latexkeys const * key)
: InsetMathNest(1), key_(key)
{}
-auto_ptr<Inset> InsetMathFont::doClone() const
+Inset * InsetMathFont::clone() const
{
- return auto_ptr<Inset>(new InsetMathFont(*this));
+ return new InsetMathFont(*this);
}
int kerning() const { return cell(0).kerning(); }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// the font to be used on screen
latexkeys const * key_;
};
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathFontOld::InsetMathFontOld(latexkeys const * key)
: InsetMathNest(1), key_(key)
{
}
-auto_ptr<Inset> InsetMathFontOld::doClone() const
+Inset * InsetMathFontOld::clone() const
{
- return auto_ptr<Inset>(new InsetMathFontOld(*this));
+ return new InsetMathFontOld(*this);
}
int kerning() const { return cell(0).kerning(); }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// the font to be used on screen
latexkeys const * key_;
};
namespace lyx {
-
-using std::string;
-using std::max;
-using std::auto_ptr;
-
-
InsetMathFrac::InsetMathFrac(Kind kind)
: kind_(kind)
{}
-auto_ptr<Inset> InsetMathFrac::doClone() const
+Inset * InsetMathFrac::clone() const
{
- return auto_ptr<Inset>(new InsetMathFrac(*this));
+ return new InsetMathFrac(*this);
}
dim.asc = cell(0).height() + 5;
dim.des = cell(1).height() - 5;
} else {
- dim.wid = max(cell(0).width(), cell(1).width()) + 2;
+ dim.wid = std::max(cell(0).width(), cell(1).width()) + 2;
dim.asc = cell(0).height() + 2 + 5;
dim.des = cell(1).height() + 2 - 5;
}
{
cell(0).metricsT(mi, dim);
cell(1).metricsT(mi, dim);
- dim.wid = max(cell(0).width(), cell(1).width());
+ dim.wid = std::max(cell(0).width(), cell(1).width());
dim.asc = cell(0).height() + 1;
dim.des = cell(1).height();
//dim = dim_;
///
void validate(LaTeXFeatures & features) const;
public:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
Kind kind_;
};
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathFrameBox::InsetMathFrameBox()
: InsetMathNest(3)
{}
-auto_ptr<Inset> InsetMathFrameBox::doClone() const
+Inset * InsetMathFrameBox::clone() const
{
- return auto_ptr<Inset>(new InsetMathFrameBox(*this));
+ return new InsetMathFrameBox(*this);
}
///
mode_type currentMode() const { return TEXT_MODE; }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// width of '[' in current font
mutable int w_;
};
using std::swap;
using std::string;
-using std::auto_ptr;
using std::istream;
using std::istringstream;
using std::vector;
}
-auto_ptr<Inset> InsetMathGrid::doClone() const
+Inset * InsetMathGrid::clone() const
{
- return auto_ptr<Inset>(new InsetMathGrid(*this));
+ return new InsetMathGrid(*this);
}
///
char v_align_; // add approp. type
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
using std::endl;
using std::max;
using std::ostream;
-using std::auto_ptr;
using std::istringstream;
using std::ostringstream;
-using std::pair;
using std::swap;
using std::vector;
{}
-auto_ptr<Inset> InsetMathHull::doClone() const
+Inset * InsetMathHull::clone() const
{
- return auto_ptr<Inset>(new InsetMathHull(*this));
+ new InsetMathHull(*this);
}
docstring eolString(row_type row, bool emptyline, bool fragile) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
void setType(HullType type);
///
namespace lyx {
-using std::string;
-using std::auto_ptr;
-
-
InsetMathKern::InsetMathKern()
{
}
}
-auto_ptr<Inset> InsetMathKern::doClone() const
+Inset * InsetMathKern::clone() const
{
- return auto_ptr<Inset>(new InsetMathKern(*this));
+ return new InsetMathKern(*this);
}
///
void normalize(NormalStream & ns) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// width in em
Length wid_;
};
namespace lyx {
-
-using std::string;
-using std::auto_ptr;
-
-
InsetMathLefteqn::InsetMathLefteqn()
: InsetMathNest(1)
{}
-auto_ptr<Inset> InsetMathLefteqn::doClone() const
+Inset * InsetMathLefteqn::clone() const
{
- return auto_ptr<Inset>(new InsetMathLefteqn(*this));
+ return new InsetMathLefteqn(*this);
}
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::auto_ptr;
using std::endl;
}
-auto_ptr<Inset> InsetMathLim::doClone() const
+Inset * InsetMathLim::clone() const
{
- return auto_ptr<Inset>(new InsetMathLim(*this));
+ return new InsetMathLim(*this);
}
///
void write(WriteStream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
#include "TexRow.h"
#include "TextMetrics.h"
-namespace lyx {
-//using support::odocstream;
+namespace lyx {
-using std::auto_ptr;
using std::endl;
}
-auto_ptr<Inset> InsetMathMBox::doClone() const
+Inset * InsetMathMBox::clone() const
{
- return auto_ptr<Inset>(new InsetMathMBox(*this));
+ return new InsetMathMBox(*this);
}
mutable Text text_;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathMakebox::InsetMathMakebox()
: InsetMathNest(3)
{}
-auto_ptr<Inset> InsetMathMakebox::doClone() const
+Inset * InsetMathMakebox::clone() const
{
- return auto_ptr<Inset>(new InsetMathMakebox(*this));
+ return new InsetMathMakebox(*this);
}
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// width of '[' in current font
mutable int w_;
};
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathMatrix::InsetMathMatrix(InsetMathGrid const & p)
: InsetMathGrid(p)
{}
-auto_ptr<Inset> InsetMathMatrix::doClone() const
+Inset * InsetMathMatrix::clone() const
{
- return auto_ptr<Inset>(new InsetMathMatrix(*this));
+ return new InsetMathMatrix(*this);
}
///
void octave(OctaveStream &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::string;
-using std::auto_ptr;
using std::vector;
InsetMathNumber::InsetMathNumber(docstring const & s)
{}
-auto_ptr<Inset> InsetMathNumber::doClone() const
+Inset * InsetMathNumber::clone() const
{
- return auto_ptr<Inset>(new InsetMathNumber(*this));
+ return new InsetMathNumber(*this);
}
void write(WriteStream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// the number as string
docstring str_;
};
namespace lyx {
-using std::max;
-using std::auto_ptr;
-
-
-auto_ptr<Inset> InsetMathOverset::doClone() const
+Inset * InsetMathOverset::clone() const
{
- return auto_ptr<Inset>(new InsetMathOverset(*this));
+ return new InsetMathOverset(*this);
}
cell(1).metrics(mi);
FracChanger dummy(mi.base);
cell(0).metrics(mi);
- dim.wid = max(cell(0).width(), cell(1).width()) + 4;
+ dim.wid = std::max(cell(0).width(), cell(1).width()) + 4;
dim.asc = cell(1).ascent() + cell(0).height() + 4;
dim.des = cell(1).descent();
metricsMarkers(dim);
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-
-using std::auto_ptr;
-
-
InsetMathPar::InsetMathPar(MathData const & ar)
{
cells_[0] = ar;
}
-auto_ptr<Inset> InsetMathPar::doClone() const
+Inset * InsetMathPar::clone() const
{
- return auto_ptr<Inset>(new InsetMathPar(*this));
+ return new InsetMathPar(*this);
}
void write(WriteStream & os) const;
private:
///
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
{}
-std::auto_ptr<Inset> InsetMathPhantom::doClone() const
+Inset * InsetMathPhantom::clone() const
{
- return std::auto_ptr<Inset>(new InsetMathPhantom(*this));
+ return new InsetMathPhantom(*this);
}
void infoize(odocstream & os) const;
private:
///
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
Kind kind_;
};
namespace lyx {
using std::string;
-using std::auto_ptr;
using std::endl;
{}
-auto_ptr<Inset> InsetMathRef::doClone() const
+Inset * InsetMathRef::clone() const
{
- return auto_ptr<Inset>(new InsetMathRef(*this));
+ return new InsetMathRef(*this);
}
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
private:
///
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::max;
-using std::auto_ptr;
-
-
InsetMathRoot::InsetMathRoot()
: InsetMathNest(2)
{}
-auto_ptr<Inset> InsetMathRoot::doClone() const
+Inset * InsetMathRoot::clone() const
{
- return auto_ptr<Inset>(new InsetMathRoot(*this));
+ return new InsetMathRoot(*this);
}
bool InsetMathRoot::metrics(MetricsInfo & mi, Dimension & dim) const
{
+ using std::max;
InsetMathNest::metrics(mi);
dim.asc = max(cell(0).ascent() + 5, cell(1).ascent()) + 2;
dim.des = max(cell(0).descent() - 5, cell(1).descent()) + 2;
///
void octave(OctaveStream &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
using std::string;
using std::max;
-using std::auto_ptr;
using std::endl;
-
-
InsetMathScript::InsetMathScript()
: InsetMathNest(1), cell_1_is_up_(false), limits_(0)
{}
}
-auto_ptr<Inset> InsetMathScript::doClone() const
+Inset * InsetMathScript::clone() const
{
- return auto_ptr<Inset>(new InsetMathScript(*this));
+ return new InsetMathScript(*this);
}
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// returns x offset for main part
int dxx() const;
/// returns width of nucleus if any
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathSize::InsetMathSize(latexkeys const * l)
: InsetMathNest(1), key_(l), style_(Styles(convert<int>(l->extra)))
{}
-auto_ptr<Inset> InsetMathSize::doClone() const
+Inset * InsetMathSize::clone() const
{
- return auto_ptr<Inset>(new InsetMathSize(*this));
+ return new InsetMathSize(*this);
}
///
void infoize(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
latexkeys const * key_;
///
#include "frontends/Painter.h"
using std::string;
-using std::auto_ptr;
-
namespace lyx {
}
-auto_ptr<Inset> InsetMathSpace::doClone() const
+Inset * InsetMathSpace::clone() const
{
- return auto_ptr<Inset>(new InsetMathSpace(*this));
+ return new InsetMathSpace(*this);
}
///
void write(WriteStream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
int space_;
};
using support::bformat;
using std::string;
-using std::auto_ptr;
InsetMathSplit::InsetMathSplit(docstring const & name, char valign)
}
-auto_ptr<Inset> InsetMathSplit::doClone() const
+Inset * InsetMathSplit::clone() const
{
- return auto_ptr<Inset>(new InsetMathSplit(*this));
+ return new InsetMathSplit(*this);
}
char defaultColAlign(col_type);
private:
///
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
docstring name_;
};
namespace lyx {
-using std::auto_ptr;
-
-
InsetMathSqrt::InsetMathSqrt()
: InsetMathNest(1)
{}
-auto_ptr<Inset> InsetMathSqrt::doClone() const
+Inset * InsetMathSqrt::clone() const
{
- return auto_ptr<Inset>(new InsetMathSqrt(*this));
+ return new InsetMathSqrt(*this);
}
///
void mathmlize(MathStream &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-
-using std::max;
-using std::auto_ptr;
-
-
InsetMathStackrel::InsetMathStackrel()
{}
-auto_ptr<Inset> InsetMathStackrel::doClone() const
+Inset * InsetMathStackrel::clone() const
{
- return auto_ptr<Inset>(new InsetMathStackrel(*this));
+ return new InsetMathStackrel(*this);
}
cell(1).metrics(mi);
FracChanger dummy(mi.base);
cell(0).metrics(mi);
- dim.wid = max(cell(0).width(), cell(1).width()) + 4;
+ dim.wid = std::max(cell(0).width(), cell(1).width()) + 4;
dim.asc = cell(1).ascent() + cell(0).height() + 4;
dim.des = cell(1).descent();
metricsMarkers(dim);
///
void normalize(NormalStream &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::auto_ptr;
-using std::vector;
-
-
InsetMathString::InsetMathString(docstring const & s)
: str_(s)
{}
-auto_ptr<Inset> InsetMathString::doClone() const
+Inset * InsetMathString::clone() const
{
- return auto_ptr<Inset>(new InsetMathString(*this));
+ return new InsetMathString(*this);
}
void write(WriteStream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// the string
docstring str_;
};
using support::bformat;
using std::string;
-using std::auto_ptr;
-
InsetMathSubstack::InsetMathSubstack()
: InsetMathGrid(1, 1)
{}
-auto_ptr<Inset> InsetMathSubstack::doClone() const
+Inset * InsetMathSubstack::clone() const
{
- return auto_ptr<Inset>(new InsetMathSubstack(*this));
+ return new InsetMathSubstack(*this);
}
{
switch (cmd.action) {
case LFUN_TABULAR_FEATURE: {
- string const name("substack");
+ string const name = "substack";
docstring const & s = cmd.argument();
if (s == "add-vline-left" || s == "add-vline-right") {
flag.message(bformat(
- from_utf8(N_("Can't add vertical grid lines in '%1$s'")), lyx::from_utf8(name)));
+ from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
+ from_utf8(name)));
flag.enabled(false);
return true;
}
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
#include "support/textutils.h"
-namespace lyx {
-
-using std::string;
-using std::auto_ptr;
+namespace lyx {
InsetMathSymbol::InsetMathSymbol(latexkeys const * l)
: sym_(l), h_(0), scriptable_(false)
{}
-auto_ptr<Inset> InsetMathSymbol::doClone() const
+Inset * InsetMathSymbol::clone() const
{
- return auto_ptr<Inset>(new InsetMathSymbol(*this));
+ return new InsetMathSymbol(*this);
}
void infoize2(odocstream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
latexkeys const * sym_;
///
namespace lyx {
-
-using std::string;
-using std::max;
-using std::auto_ptr;
-
-
InsetMathTFrac::InsetMathTFrac()
: InsetMathFrac()
{}
-auto_ptr<Inset> InsetMathTFrac::doClone() const
+Inset * InsetMathTFrac::clone() const
{
- return auto_ptr<Inset>(new InsetMathTFrac(*this));
+ return new InsetMathTFrac(*this);
}
StyleChanger dummy(mi.base, LM_ST_SCRIPT);
cell(0).metrics(mi);
cell(1).metrics(mi);
- dim.wid = max(cell(0).width(), cell(1).width()) + 2;
+ dim.wid = std::max(cell(0).width(), cell(1).width()) + 2;
dim.asc = cell(0).height() + 2 + 5;
dim.des = cell(1).height() + 2 - 5;
if (dim_ == dim)
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-
-using std::string;
-using std::auto_ptr;
-
-
InsetMathTabular::InsetMathTabular(docstring const & name, int m, int n)
: InsetMathGrid(m, n), name_(name)
{}
{}
-auto_ptr<Inset> InsetMathTabular::doClone() const
+Inset * InsetMathTabular::clone() const
{
- return auto_ptr<Inset>(new InsetMathTabular(*this));
+ return new InsetMathTabular(*this);
}
void maple(MapleStream &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
docstring name_;
};
namespace lyx {
-using std::max;
-using std::auto_ptr;
-
-
-
-auto_ptr<Inset> InsetMathUnderset::doClone() const
+Inset * InsetMathUnderset::clone() const
{
- return auto_ptr<Inset>(new InsetMathUnderset(*this));
+ return new InsetMathUnderset(*this);
}
cell(1).metrics(mi);
FracChanger dummy(mi.base);
cell(0).metrics(mi);
- dim.wid = max(cell(0).width(), cell(1).width()) + 4;
+ dim.wid = std::max(cell(0).width(), cell(1).width()) + 4;
dim.asc = cell(1).ascent();
dim.des = cell(1).descent() + cell(0).height() + 4;
metricsMarkers(dim);
///
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
};
namespace lyx {
-using std::string;
-using std::auto_ptr;
-using std::vector;
-
-
InsetMathUnknown::InsetMathUnknown(docstring const & nm, bool final, bool black)
: name_(nm), final_(final), black_(black)
{}
-auto_ptr<Inset> InsetMathUnknown::doClone() const
+Inset * InsetMathUnknown::clone() const
{
- return auto_ptr<Inset>(new InsetMathUnknown(*this));
+ return new InsetMathUnknown(*this);
}
///
int kerning() const { return kerning_; }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
docstring name_;
/// are we finished creating the name?
namespace lyx {
-using std::string;
-using std::auto_ptr;
-
InsetMathXArrow::InsetMathXArrow(docstring const & name)
: InsetMathFracBase(), name_(name)
{}
-auto_ptr<Inset> InsetMathXArrow::doClone() const
+Inset * InsetMathXArrow::clone() const
{
- return auto_ptr<Inset>(new InsetMathXArrow(*this));
+ return new InsetMathXArrow(*this);
}
void validate(LaTeXFeatures & features) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
bool upper() const;
///
{}
-std::auto_ptr<Inset> InsetMathXYArrow::clone() const
+Inset * InsetMathXYArrow::clone() const
{
- return std::auto_ptr<Inset>(new InsetMathXYArrow(*this));
+ return new InsetMathXYArrow(*this);
}
///
InsetMathXYArrow();
///
- virtual std::auto_ptr<Inset> clone() const;
+ virtual Inset * clone() const;
///
bool metrics(MetricsInfo & mi) const;
///
{}
-std::auto_ptr<Inset> InsetMathXYMatrix::doClone() const
+Inset * InsetMathXYMatrix::clone() const
{
- return std::auto_ptr<Inset>(new InsetMathXYMatrix(*this));
+ new InsetMathXYMatrix(*this);
}
void validate(LaTeXFeatures & features) const;
private:
///
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// extra spacing, may be empty
Length spacing_;
///
: nucleus_(0)
{
if (at.nucleus_)
- nucleus_ = static_cast<InsetMath*>(at.nucleus_->clone().release());
+ nucleus_ = static_cast<InsetMath*>(at.nucleus_->clone());
}
using frontend::function_names;
+using std::auto_ptr;
using std::endl;
using std::find_if;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::swap;
// create extra script inset and move superscript over
InsetMathScript * p = ar[i].nucleus()->asScriptInset();
- auto_ptr<InsetMathScript> q(new InsetMathScript(true));
+ std::auto_ptr<InsetMathScript> q(new InsetMathScript(true));
swap(q->up(), p->up());
p->removeScript(true);
extractScript(exp, jt, ar.end(), true);
// create a proper inset as replacement
- auto_ptr<InsetMathExFunc> p(new InsetMathExFunc(name));
+ std::auto_ptr<InsetMathExFunc> p(new InsetMathExFunc(name));
// jt points to the "argument". Get hold of this.
MathData::iterator st = extractArgument(p->cell(0), jt, ar.end(), true);
}
// create a proper diff inset
- auto_ptr<InsetMathDiff> diff(new InsetMathDiff);
+ std::auto_ptr<InsetMathDiff> diff(new InsetMathDiff);
// collect function, let jt point behind last used item
MathData::iterator jt = it + 1;
using std::string;
using std::max;
-using std::auto_ptr;
-using std::endl;
-using std::vector;
/// This class is the value of a macro argument, technically
int kerning() const { return mathMacro_.cell(idx_).kerning(); }
private:
- std::auto_ptr<Inset> doClone() const;
+ Inset * clone() const;
MathMacro const & mathMacro_;
size_t idx_;
};
-auto_ptr<Inset> MathMacroArgumentValue::doClone() const
+Inset * MathMacroArgumentValue::clone() const
{
- return auto_ptr<Inset>(new MathMacroArgumentValue(*this));
+ return new MathMacroArgumentValue(*this);
}
{}
-auto_ptr<Inset> MathMacro::doClone() const
+Inset * MathMacro::clone() const
{
MathMacro * x = new MathMacro(*this);
x->expanded_ = MathData();
x->macroBackup_ = MacroData();
- return auto_ptr<Inset>(x);
+ return x;
}
MacroData const & macro = MacroTable::globalMacros().get(name());
// create MathMacroArgumentValue object pointing to the cells of the macro
- vector<MathData> values(nargs());
+ std::vector<MathData> values(nargs());
for (size_t i = 0; i != nargs(); ++i)
values[i].insert(0, MathAtom(new MathMacroArgumentValue(*this, i)));
macro.expand(values, expanded_);
void infoize2(odocstream &) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
///
void updateExpansion() const;
namespace lyx {
using std::endl;
-using std::auto_ptr;
using std::size_t;
-using std::vector;
MathMacroArgument::MathMacroArgument(size_t n)
}
-auto_ptr<Inset> MathMacroArgument::doClone() const
+Inset * MathMacroArgument::clone() const
{
- return auto_ptr<Inset>(new MathMacroArgument(*this));
+ new MathMacroArgument(*this);
}
void write(WriteStream & os) const;
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// A number between 1 and 9
std::size_t number_;
///
using support::bformat;
-using std::auto_ptr;
using std::ostream;
using std::endl;
}
-auto_ptr<Inset> MathMacroTemplate::doClone() const
+Inset * MathMacroTemplate::clone() const
{
- return auto_ptr<Inset>(new MathMacroTemplate(*this));
+ return new MathMacroTemplate(*this);
}
Inset::Code lyxCode() const { return MATHMACRO_CODE; }
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ virtual Inset * clone() const;
/// prefix in inset
docstring prefix() const;