the clone auto_ptr patch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7356 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-07-25 17:11:25 +00:00
parent 8a2e3e4d73
commit 4ba8a4d6f6
171 changed files with 432 additions and 331 deletions

View File

@ -92,6 +92,7 @@ src/frontends/xforms/FormBibtex.C
src/frontends/xforms/FormChanges.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormColorpicker.C
src/frontends/xforms/FormDialogView.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormERT.C
@ -130,7 +131,6 @@ src/frontends/xforms/FormVCLog.C
src/frontends/xforms/FormWrap.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/XMiniBuffer.C
src/frontends/xforms/a.C
src/frontends/xforms/xformsBC.h
src/frontends/xforms/xforms_helpers.C
src/gettext.h

View File

@ -172,7 +172,7 @@ void BufferView::Pimpl::disconnectBuffer()
}
bool BufferView::Pimpl::newFile(string const & filename,
bool BufferView::Pimpl::newFile(string const & filename,
string const & tname,
bool isNamed)
{
@ -960,10 +960,10 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filen)
string const disp_fn = MakeDisplayPath(filename);
owner_->message(bformat(_("Inserting document %1$s..."), disp_fn));
if (bv_->insertLyXFile(filename))
owner_->message(bformat(_("Document %1$s inserted."),
owner_->message(bformat(_("Document %1$s inserted."),
disp_fn));
else
owner_->message(bformat(_("Could not insert document %1$s"),
owner_->message(bformat(_("Could not insert document %1$s"),
disp_fn));
}

View File

@ -1,3 +1,9 @@
2003-07-25 Lars Gullik Bjønnes <larsbj@gullik.net>
* paragraph.C (Paragraph): adjust for new clone return type
(operator==): ditto
(copyIntoMinibuffer): ditto
2003-07-25 Asger Alstrup <alstrup@lyx.org>
* undo_funcs.C (textHandleUndo): Fix undo crash in first paragraph
@ -72,11 +78,11 @@
* lyx_main.C: fix a crash in batch mode if no files specified
* converter.C: ws
2003-07-17 Alfredo Braunstein <abraunst@libero.it>
* format.[Ch] (papersize): moved to BufferParams
* converter.[Ch] (dvips_options): moved to BufferParams
* converter.[Ch] (dvips_options): moved to BufferParams
(dvipdfm_options): moved to anon namespace
* bufferparams.[Ch]: added above functions.
@ -116,7 +122,7 @@
* lyxtext.h (init): remove reinit argument (act as if always true)
* text2.C: adjust to that
2003-07-14 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* bufferview_funcs.[Ch]: introduce function replaceSelection()
@ -135,18 +141,18 @@
2003-07-14 Alfredo Braunstein <abraunst@libero.it>
* text2.C (init): fix a crash fired on resize
2003-07-11 Alfredo Braunstein <abraunst@libero.it>
* buffer.[Ch]: added new closing signal
* BufferView_pimpl.[Ch]: connect/disconnect to new signal
* lyxfunc.C: removed BufferView::buffer(0) call now handled in
* lyxfunc.C: removed BufferView::buffer(0) call now handled in
BufferView::Pimpl via the closing the signal
2003-07-10 Alfredo Braunstein <abraunst@libero.it>
* buffer.[Ch]: take out all bv-related from buffer
* BufferView.C:
* BufferView.C:
* BufferView_pimpl.[Ch]: connect to new signals
* CutAndPaste.C: removed useless asserts
* bufferview_funcs.[Ch] (resizeInsets): moved from buffer

View File

@ -263,7 +263,7 @@ int Buffer::readHeader(LyXLex & lex)
"%1$s %2$s\n"),
token,
lex.getString());
error(ErrorItem(_("Header error"), s,
error(ErrorItem(_("Header error"), s,
-1, 0, 0));
}
}

View File

@ -477,4 +477,3 @@ void LyXScreen::drawFromTo(LyXText * text, BufferView * bv,
LColor::bottomarea);
}
}

View File

@ -1,3 +1,7 @@
2003-07-25 Lars Gullik Bjønnes <larsbj@gullik.net>
* all inset files (clone): return a auto_ptr<InsetBase>
2003-07-23 Angus Leeming <leeming@lyx.org>
* insetexternal.[Ch] (setParams): pass it a Buffer const *.
@ -87,7 +91,7 @@
* insettext.[Ch]:
* insettabular.[Ch]: remove unneeded in_update_ members
* insettext.[Ch]: remove unneeded InsetText::old_max_width member
* insettext.[Ch]: remove unneeded InsetText::old_max_width member
2003-07-16 André Pönitz <poenitz@gmx.net>
@ -95,7 +99,7 @@
2003-07-16 John Levon <levon@movementarian.org>
* insetnote.h:
* insetnote.h:
* insetnote.C: implement showInsetDialog()
2003-07-15 André Pönitz <poenitz@gmx.net>
@ -106,7 +110,7 @@
2003-07-15 Alfredo Braunstein <abraunst@libero.it>
* insettext.C: adjust call to LyXText::init
2003-07-14 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* insettext.C: use bufferview_funcs->replaceSelection()

View File

@ -69,7 +69,7 @@ public:
/// virtual base class destructor
virtual ~InsetBase() {}
/// replicate ourselves
virtual InsetBase * clone() const = 0;
virtual std::auto_ptr<InsetBase> clone() const = 0;
// the real dispatcher
virtual dispatch_result dispatch

View File

@ -23,6 +23,7 @@
using namespace lyx::support;
using std::max;
using std::auto_ptr;
int InsetBibitem::key_counter = 0;
@ -44,11 +45,11 @@ InsetBibitem::~InsetBibitem()
}
InsetBase * InsetBibitem::clone() const
auto_ptr<InsetBase> InsetBibitem::clone() const
{
InsetBibitem * b = new InsetBibitem(params());
b->setCounter(counter);
return b;
return auto_ptr<InsetBase>(b);
}
@ -132,7 +133,7 @@ string const InsetBibitem::getScreenLabel(Buffer const *) const
// ale070405 This function maybe shouldn't be here. We'll fix this at 0.13.
int bibitemMaxWidth(BufferView * bv, LyXFont const & font)
int bibitemMaxWidth(BufferView * bv, LyXFont const &)
{
int w = 0;
// Ha, now we are mainly at 1.2.0 and it is still here (Jug)

View File

@ -29,7 +29,7 @@ public:
///
~InsetBibitem();
///
InsetBase * clone() const;
std::auto_ptr<InsetBase> clone() const;
///
virtual dispatch_result localDispatch(FuncRequest const & cmd);
/** Currently \bibitem is used as a LyX2.x command,

View File

@ -27,8 +27,8 @@ public:
///
~InsetBibtex();
///
InsetBase * clone() const {
return new InsetBibtex(params());
std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetBibtex(params()));
}
/// small wrapper for the time being
virtual dispatch_result localDispatch(FuncRequest const & cmd);

View File

@ -25,8 +25,8 @@ public:
///
~InsetCitation();
///
InsetBase * clone() const {
return new InsetCitation(params());
std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetCitation(params()));
}
///
string const getScreenLabel(Buffer const *) const;

View File

@ -23,6 +23,7 @@
using std::ostream;
using std::endl;
using std::auto_ptr;
InsetEnvironment::InsetEnvironment
@ -40,9 +41,9 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
{}
InsetBase * InsetEnvironment::clone() const
auto_ptr<InsetBase> InsetEnvironment::clone() const
{
return new InsetEnvironment(*this);
return auto_ptr<InsetBase>(new InsetEnvironment(*this));
}

View File

@ -26,7 +26,7 @@ public:
///
void read(Buffer const * buf, LyXLex & lex);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; }
///

View File

@ -35,11 +35,12 @@
using namespace lyx::support;
using lyx::pos_type;
using std::ostream;
using std::min;
using std::endl;
using lyx::pos_type;
using std::auto_ptr;
void InsetERT::init()
@ -71,9 +72,9 @@ InsetERT::InsetERT(InsetERT const & in)
}
InsetBase * InsetERT::clone() const
auto_ptr<InsetBase> InsetERT::clone() const
{
return new InsetERT(*this);
return auto_ptr<InsetBase>(new InsetERT(*this));
}

View File

@ -40,7 +40,7 @@ public:
///
InsetERT(InsetERT const &);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
InsetERT(BufferParams const &,
Language const *, string const & contents, bool collapsed);

View File

@ -48,6 +48,7 @@ using namespace lyx::support;
using std::ostream;
using std::endl;
using std::auto_ptr;
namespace {
@ -100,10 +101,9 @@ InsetExternal::InsetExternal(InsetExternal const & other)
}
InsetBase * InsetExternal::clone() const
auto_ptr<InsetBase> InsetExternal::clone() const
{
InsetExternal * inset = new InsetExternal(*this);
return inset;
return auto_ptr<InsetBase>(new InsetExternal(*this));
}

View File

@ -82,7 +82,7 @@ public:
virtual Inset::Code lyxCode() const { return EXTERNAL_CODE; }
///
virtual InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
/// return a copy of our current params
Params const & params() const;

View File

@ -40,6 +40,7 @@ using namespace lyx::support;
using std::ostream;
using std::endl;
using std::auto_ptr;
// With this inset it will be possible to support the latex package
@ -261,9 +262,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const
}
InsetBase * InsetFloat::clone() const
auto_ptr<InsetBase> InsetFloat::clone() const
{
return new InsetFloat(*this);
return auto_ptr<InsetBase>(new InsetFloat(*this));
}

View File

@ -53,7 +53,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
///

View File

@ -26,8 +26,8 @@ public:
///
~InsetFloatList();
///
InsetBase * clone() const {
return new InsetFloatList(getCmdName());
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetFloatList(getCmdName()));
}
///
dispatch_result localDispatch(FuncRequest const & cmd);

View File

@ -28,6 +28,7 @@
using std::ostream;
using std::auto_ptr;
InsetFoot::InsetFoot(BufferParams const & bp)
@ -46,9 +47,9 @@ InsetFoot::InsetFoot(InsetFoot const & in)
}
InsetBase * InsetFoot::clone() const
auto_ptr<InsetBase> InsetFoot::clone() const
{
return new InsetFoot(*this);
return auto_ptr<InsetBase>(new InsetFoot(*this));
}

View File

@ -27,7 +27,7 @@ public:
///
InsetFoot(InsetFoot const &);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
///

View File

@ -89,6 +89,7 @@ using namespace lyx::support;
using std::ostream;
using std::endl;
using std::auto_ptr;
namespace {
@ -153,9 +154,9 @@ InsetGraphics::InsetGraphics(InsetGraphics const & ig)
}
InsetBase * InsetGraphics::clone() const
auto_ptr<InsetBase> InsetGraphics::clone() const
{
return new InsetGraphics(*this);
return auto_ptr<InsetBase>(new InsetGraphics(*this));
}
@ -468,7 +469,7 @@ int InsetGraphics::latex(Buffer const * buf, ostream & os,
<< "insetgraphics::latex: Filename = "
<< params().filename.absFilename() << endl;
string const relative_file =
string const relative_file =
params().filename.relFilename(buf->filePath());
// A missing (e)ps-extension is no problem for LaTeX, so
@ -625,7 +626,7 @@ string const InsetGraphicsMailer::inset2string(Buffer const & buffer) const
void InsetGraphicsMailer::string2params(string const & in,
Buffer const & buffer,
InsetGraphicsParams & params)
InsetGraphicsParams & params)
{
params = InsetGraphicsParams();

View File

@ -68,7 +68,7 @@ public:
Inset::Code lyxCode() const { return Inset::GRAPHICS_CODE; }
///
virtual InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
/** Set the inset parameters, used by the GUIndependent dialog.
Return true of new params are different from what was so far.

View File

@ -20,8 +20,8 @@ public:
///
InsetHFill();
///
virtual InsetBase * clone() const {
return new InsetHFill;
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetHFill);
}
///
string const getScreenLabel(Buffer const *) const { return getContents(); }

View File

@ -49,6 +49,8 @@ using std::ostream;
using std::endl;
using std::vector;
using std::pair;
using std::auto_ptr;
extern BufferList bufferlist;
@ -206,13 +208,13 @@ void InsetInclude::set(Params const & p)
}
InsetBase * InsetInclude::clone() const
auto_ptr<InsetBase> InsetInclude::clone() const
{
//Params p(params_);
//p.masterFilename_ = buffer.fileName();
#warning FIXME: broken cross-doc copy/paste - must fix
return new InsetInclude(params_);
return auto_ptr<InsetBase>(new InsetInclude(params_));
}

View File

@ -74,7 +74,7 @@ public:
void set(Params const & params);
///
virtual InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; }
/// This returns the list of labels on the child buffer

View File

@ -26,8 +26,8 @@ public:
///
~InsetIndex();
///
virtual InsetBase * clone() const {
return new InsetIndex(params());
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetIndex(params()));
}
///
dispatch_result localDispatch(FuncRequest const & cmd);
@ -49,8 +49,8 @@ public:
///
~InsetPrintIndex();
///
InsetBase * clone() const {
return new InsetPrintIndex(params());
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetPrintIndex(params()));
}
///
//dispatch_result localDispatch(FuncRequest const & cmd);

View File

@ -22,8 +22,8 @@ public:
///
~InsetLabel();
///
virtual InsetBase * clone() const {
return new InsetLabel(params());
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetLabel(params()));
}
///
virtual dispatch_result localDispatch(FuncRequest const & cmd);

View File

@ -26,6 +26,7 @@ using namespace lyx::support;
using std::ostream;
using std::endl;
using std::auto_ptr;
/* LatexAccent. Proper handling of accented characters */
@ -359,7 +360,6 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
// overhaul. Different ways of drawing (what metrics to use)
// should also be considered.
BufferView * bv = pi.base.bv;
LyXFont font = pi.base.font;
if (lyxrc.font_norm_type == LyXRC::ISO_10646_1)
font.setLanguage(english_language);
@ -650,9 +650,9 @@ bool InsetLatexAccent::directWrite() const
}
InsetBase * InsetLatexAccent::clone() const
auto_ptr<InsetBase> InsetLatexAccent::clone() const
{
return new InsetLatexAccent(contents);
return auto_ptr<InsetBase>(new InsetLatexAccent(contents));
}

View File

@ -57,7 +57,7 @@ public:
///
bool directWrite() const;
///
virtual InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode()const;
///

View File

@ -23,6 +23,7 @@
using std::ostream;
using std::auto_ptr;
InsetMarginal::InsetMarginal(BufferParams const & bp)
@ -41,9 +42,9 @@ InsetMarginal::InsetMarginal(InsetMarginal const & in)
}
InsetBase * InsetMarginal::clone() const
auto_ptr<InsetBase> InsetMarginal::clone() const
{
return new InsetMarginal(*this);
return auto_ptr<InsetBase>(new InsetMarginal(*this));
}

View File

@ -26,7 +26,7 @@ public:
///
InsetMarginal(InsetMarginal const &);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::MARGIN_CODE; }
///

View File

@ -33,6 +33,7 @@
using std::ostream;
using std::endl;
using std::auto_ptr;
// Some information about Minipages in LaTeX:
@ -94,9 +95,9 @@ InsetMinipage::InsetMinipage(InsetMinipage const & in)
{}
InsetBase * InsetMinipage::clone() const
auto_ptr<InsetBase> InsetMinipage::clone() const
{
return new InsetMinipage(*this);
return auto_ptr<InsetBase>(new InsetMinipage(*this));
}

View File

@ -66,7 +66,7 @@ public:
///
void read(Buffer const * buf, LyXLex & lex);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo &, Dimension &) const;
///

View File

@ -20,8 +20,8 @@ public:
InsetNewline() {}
virtual InsetBase * clone() const {
return new InsetNewline;
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetNewline);
}
Inset::Code lyxCode() const { return Inset::NEWLINE_CODE; }

View File

@ -26,6 +26,7 @@
#include "debug.h"
using std::ostream;
using std::auto_ptr;
void InsetNote::init()
@ -58,9 +59,9 @@ InsetNote::~InsetNote() // MV
}
InsetBase * InsetNote::clone() const
auto_ptr<InsetBase> InsetNote::clone() const
{
return new InsetNote(*this);
return auto_ptr<InsetBase>(new InsetNote(*this));
}
@ -124,14 +125,14 @@ dispatch_result InsetNote::localDispatch(FuncRequest const & cmd)
return DISPATCHED;
}
case LFUN_INSET_EDIT:
if (cmd.button() != mouse_button::button3)
if (cmd.button() != mouse_button::button3)
return InsetCollapsable::localDispatch(cmd);
return UNDISPATCHED;
case LFUN_INSET_DIALOG_UPDATE:
InsetNoteMailer("note", *this).updateDialog(bv);
return DISPATCHED;
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3 && cmd.x < button_length
if (cmd.button() == mouse_button::button3 && cmd.x < button_length
&& cmd.y >= button_top_y && cmd.y <= button_bottom_y) {
InsetNoteMailer("note", *this).showDialog(bv);
return DISPATCHED;
@ -159,8 +160,8 @@ int InsetNote::latex(Buffer const * buf, ostream & os,
if (pt == "Comment") {
os << "%\n\\end{comment}\n";
i += 3;
} else if (pt == "Greyedout") {
i += 3;
} else if (pt == "Greyedout") {
os << "\\normalcolor%\n}";
i += 2;
}
@ -169,8 +170,8 @@ int InsetNote::latex(Buffer const * buf, ostream & os,
int InsetNote::linuxdoc(Buffer const *, std::ostream &) const
{
return 0;
{
return 0;
}
@ -179,9 +180,9 @@ int InsetNote::docbook(Buffer const * buf, std::ostream & os, bool mixcont) cons
int i = 0;
string const pt = params_.type;
// incomplete, untested - MV
if (pt != "Note")
if (pt != "Note")
i = inset.docbook(buf, os, mixcont);
return i;
return i;
}
@ -200,7 +201,7 @@ int InsetNote::ascii(Buffer const * buf, std::ostream & os, int ll) const
void InsetNote::validate(LaTeXFeatures & features) const
{
if (params_.type == "Comment")
if (params_.type == "Comment")
features.require("verbatim");
if (params_.type == "Greyedout")
features.require("color");
@ -265,4 +266,3 @@ void InsetNoteParams::read(LyXLex & lex)
type = lex.getString();
}
}

View File

@ -15,17 +15,17 @@
#include "insetcollapsable.h"
struct InsetNoteParams {
///
void write(std::ostream & os) const;
///
void read(LyXLex & lex);
///
string type;
///
void write(std::ostream & os) const;
///
void read(LyXLex & lex);
///
string type;
};
/** The PostIt note inset, and other annotations
*/
@ -33,14 +33,14 @@ class InsetNote : public InsetCollapsable {
public:
///
InsetNote(BufferParams const &, string const &);
/// Copy constructor
InsetNote(InsetNote const &);
///
~InsetNote();
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
string const editMessage() const;
///

View File

@ -26,6 +26,8 @@
using std::ostream;
using std::vector;
using std::pair;
using std::auto_ptr;
InsetOptArg::InsetOptArg(BufferParams const & ins)
: InsetCollapsable(ins, true)
@ -47,9 +49,9 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in)
}
InsetBase * InsetOptArg::clone() const
auto_ptr<InsetBase> InsetOptArg::clone() const
{
return new InsetOptArg(*this);
return auto_ptr<InsetBase>(new InsetOptArg(*this));
}

View File

@ -27,7 +27,7 @@ public:
InsetOptArg(InsetOptArg const &);
/// make a duplicate of this inset
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
/// this inset is editable
EDITABLE editable() const { return IS_EDITABLE; }
/// code of the inset

View File

@ -33,6 +33,7 @@ using namespace lyx::support;
using std::ostream;
using std::endl;
using std::auto_ptr;
namespace {
@ -354,9 +355,9 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
}
InsetBase * InsetQuotes::clone() const
auto_ptr<InsetBase> InsetQuotes::clone() const
{
return new InsetQuotes(language_, side_, times_);
return auto_ptr<InsetBase>(new InsetQuotes(language_, side_, times_));
}

View File

@ -68,7 +68,7 @@ public:
/// Create the right quote inset after character c
InsetQuotes(char c, BufferParams const & params);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo &, Dimension &) const;
///

View File

@ -42,8 +42,8 @@ public:
~InsetRef();
///
virtual InsetBase * clone() const {
return new InsetRef(*this);
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetRef(*this));
}
///
dispatch_result localDispatch(FuncRequest const & cmd);

View File

@ -28,6 +28,7 @@
using std::ostream;
using std::max;
using std::auto_ptr;
InsetSpace::InsetSpace()
@ -251,9 +252,9 @@ int InsetSpace::docbook(Buffer const *, ostream & os, bool) const
}
InsetBase * InsetSpace::clone() const
auto_ptr<InsetBase> InsetSpace::clone() const
{
return new InsetSpace(kind_);
return auto_ptr<InsetBase>(new InsetSpace(kind_));
}

View File

@ -71,7 +71,7 @@ public:
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
virtual InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::SPACE_CODE; }
/// We don't need \begin_inset and \end_inset

View File

@ -26,6 +26,7 @@
using std::ostream;
using std::max;
using std::auto_ptr;
InsetSpecialChar::InsetSpecialChar(Kind k)
@ -239,9 +240,9 @@ int InsetSpecialChar::docbook(Buffer const *, ostream & os, bool) const
}
InsetBase * InsetSpecialChar::clone() const
auto_ptr<InsetBase> InsetSpecialChar::clone() const
{
return new InsetSpecialChar(kind_);
return auto_ptr<InsetBase>(new InsetSpecialChar(kind_));
}

View File

@ -63,7 +63,7 @@ public:
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
virtual InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; }
/// We don't need \begin_inset and \end_inset

View File

@ -58,6 +58,7 @@ using std::max;
using std::endl;
using std::swap;
using std::max;
using std::auto_ptr;
namespace {
@ -196,9 +197,9 @@ InsetTabular::~InsetTabular()
}
InsetBase * InsetTabular::clone() const
auto_ptr<InsetBase> InsetTabular::clone() const
{
return new InsetTabular(*this);
return auto_ptr<InsetBase>(new InsetTabular(*this));
}
@ -260,9 +261,9 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
lyxerr << "InsetTabular::metrics: need bv\n";
Assert(0);
}
calculate_dimensions_of_cells(mi);
dim.asc = tabular.getAscentOfRow(0);
dim.des = tabular.getHeightOfTabular() - tabular.getAscentOfRow(0) + 1;
dim.wid = tabular.getWidthOfTabular() + 2 * ADD_TO_TABULAR_WIDTH;

View File

@ -75,7 +75,7 @@ public:
///
~InsetTabular();
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void read(Buffer const *, LyXLex &);
///

View File

@ -70,6 +70,7 @@ using std::make_pair;
using std::vector;
using std::pair;
using std::for_each;
using std::auto_ptr;
using namespace lyx::support;
using namespace lyx::graphics;
@ -204,9 +205,9 @@ void InsetText::clear(bool just_mark_erased)
}
InsetBase * InsetText::clone() const
auto_ptr<InsetBase> InsetText::clone() const
{
return new InsetText(*this);
return auto_ptr<InsetBase>(new InsetText(*this));
}
@ -1924,7 +1925,7 @@ void InsetText::deleteLyXText(BufferView * bv, bool recursive) const
}
void InsetText::resizeLyXText(BufferView * bv, bool force) const
void InsetText::resizeLyXText(BufferView * bv, bool /*force*/) const
{
if (paragraphs.size() == 1 && paragraphs.begin()->empty()) {
// no data, resize not neccessary!

View File

@ -76,7 +76,7 @@ public:
///
explicit InsetText(InsetText const &);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
InsetText & operator=(InsetText const & it);
/// empty inset to empty par, or just mark as erased

View File

@ -24,8 +24,8 @@ public:
///
~InsetTOC();
///
virtual InsetBase * clone() const {
return new InsetTOC(params());
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetTOC(params()));
}
///
dispatch_result localDispatch(FuncRequest const & cmd);

View File

@ -27,8 +27,8 @@ public:
///
~InsetUrl();
///
virtual InsetBase * clone() const {
return new InsetUrl(params());
virtual std::auto_ptr<InsetBase> clone() const {
return std::auto_ptr<InsetBase>(new InsetUrl(params()));
}
///
dispatch_result localDispatch(FuncRequest const & cmd);

View File

@ -34,7 +34,7 @@
using std::ostream;
using std::endl;
using std::auto_ptr;
namespace {
@ -95,7 +95,7 @@ dispatch_result InsetWrap::localDispatch(FuncRequest const & cmd)
return DISPATCHED;
}
case LFUN_INSET_DIALOG_UPDATE:
case LFUN_INSET_DIALOG_UPDATE:
InsetWrapMailer(*this).updateDialog(cmd.view());
return DISPATCHED;
@ -167,9 +167,9 @@ void InsetWrap::validate(LaTeXFeatures & features) const
}
InsetBase * InsetWrap::clone() const
auto_ptr<InsetBase> InsetWrap::clone() const
{
return new InsetWrap(*this);
return auto_ptr<InsetBase>(new InsetWrap(*this));
}

View File

@ -1,3 +1,4 @@
// -*- C++ -*-
/**
* \file insetwrap.h
* This file is part of LyX, the document processor.
@ -49,7 +50,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
///

View File

@ -808,16 +808,16 @@ namespace {
Buffer & buf = *bv->buffer();
if (buf.isClean())
return true;
string const file = MakeDisplayPath(buf.fileName(), 30);
string text = bformat(_("The document %1$s has unsaved "
"changes.\n\nDo you want to save "
"the document?"), file);
int const ret = Alert::prompt(_("Save changed document?"),
text, 0, 1, _("&Save"),
text, 0, 1, _("&Save"),
_("&Cancel"));
if (ret == 0)
if (ret == 0)
bv->owner()->dispatch(FuncRequest(LFUN_MENUWRITE));
return buf.isClean();
@ -1915,7 +1915,7 @@ void LyXFunc::closeBuffer()
{
if (bufferlist.close(owner->buffer(), true) && !quitting) {
if (bufferlist.empty()) {
// need this otherwise SEGV may occur while
// need this otherwise SEGV may occur while
// trying to set variables that don't exist
// since there's no current buffer
owner->getDialogs().hideBufferDependent();

View File

@ -1,3 +1,7 @@
2003-07-25 Lars Gullik Bjønnes <larsbj@gullik.net>
* all inset files (clone) return a auto_ptr<InsetBase>
2003-07-21 Angus Leeming <leeming@lyx.org>
* formula.C (c-tor, addPreview): use namespace lyx::graphics rather

View File

@ -1,9 +1,10 @@
#include "command_inset.h"
#include "math_mathmlstream.h"
#include "funcrequest.h"
#include "Lsstream.h"
using std::auto_ptr;
CommandInset::CommandInset(string const & name)
: MathNestInset(2),
@ -14,9 +15,9 @@ CommandInset::CommandInset(string const & name)
}
InsetBase * CommandInset::clone() const
auto_ptr<InsetBase> CommandInset::clone() const
{
return new CommandInset(*this);
return auto_ptr<InsetBase>(new CommandInset(*this));
}

View File

@ -25,7 +25,7 @@ public:
///
explicit CommandInset(string const & name);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -51,6 +51,7 @@
using std::ostream;
using std::vector;
using std::auto_ptr;
class InsetFormula::PreviewImpl : public lyx::graphics::PreviewedInset {
@ -112,9 +113,9 @@ InsetFormula::~InsetFormula()
{}
Inset * InsetFormula::clone() const
auto_ptr<InsetBase> InsetFormula::clone() const
{
return new InsetFormula(*this);
return auto_ptr<InsetBase>(new InsetFormula(*this));
}

View File

@ -54,7 +54,7 @@ public:
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
Inset * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void validate(LaTeXFeatures & features) const;
///

View File

@ -29,8 +29,6 @@ class InsetFormulaBase : public UpdatableInset {
public:
///
InsetFormulaBase();
///
Inset * clone() const = 0;
/// lowest x coordinate
virtual int xlow() const;
/// highest x coordinate

View File

@ -39,6 +39,7 @@
using namespace lyx::support;
using std::ostream;
using std::auto_ptr;
extern MathCursor * mathcursor;
@ -65,9 +66,9 @@ InsetFormulaMacro::InsetFormulaMacro(string const & s)
}
Inset * InsetFormulaMacro::clone() const
auto_ptr<InsetBase> InsetFormulaMacro::clone() const
{
return new InsetFormulaMacro(*this);
return auto_ptr<InsetBase>(new InsetFormulaMacro(*this));
}

View File

@ -52,7 +52,7 @@ public:
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
Inset * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
Inset::Code lyxCode() const;
///

View File

@ -7,6 +7,8 @@
#include "math_support.h"
#include "Lsstream.h"
using std::auto_ptr;
MathAMSArrayInset::MathAMSArrayInset(string const & name, int m, int n)
: MathGridInset(m, n), name_(name)
@ -18,9 +20,9 @@ MathAMSArrayInset::MathAMSArrayInset(string const & name)
{}
InsetBase * MathAMSArrayInset::clone() const
auto_ptr<InsetBase> MathAMSArrayInset::clone() const
{
return new MathAMSArrayInset(*this);
return auto_ptr<InsetBase>(new MathAMSArrayInset(*this));
}

View File

@ -20,7 +20,7 @@ public:
///
MathAMSArrayInset(string const & name);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -14,6 +14,7 @@ using std::vector;
using std::istringstream;
using std::getline;
using std::istream_iterator;
using std::auto_ptr;
MathArrayInset::MathArrayInset(string const & name, int m, int n)
@ -57,9 +58,9 @@ MathArrayInset::MathArrayInset(string const & name, string const & str)
}
InsetBase * MathArrayInset::clone() const
auto_ptr<InsetBase> MathArrayInset::clone() const
{
return new MathArrayInset(*this);
return auto_ptr<InsetBase>(new MathArrayInset(*this));
}

View File

@ -25,7 +25,7 @@ public:
/// convienience constructor from whitespace/newline seperated data
MathArrayInset(string const &, string const & str);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -32,8 +32,11 @@ MathAtom::MathAtom(InsetBase * p)
MathAtom::MathAtom(MathAtom const & at)
: nucleus_(at.nucleus_ ? static_cast<MathInset *>(at.nucleus_->clone()) : 0)
{}
: nucleus_(0)
{
if (at.nucleus_)
nucleus_ = static_cast<MathInset*>(at.nucleus_->clone().release());
}
void MathAtom::operator=(MathAtom const & at)

View File

@ -6,15 +6,17 @@
#include "math_mathmlstream.h"
#include "math_streamstr.h"
using std::auto_ptr;
MathBigInset::MathBigInset(string const & name, string const & delim)
: name_(name), delim_(delim)
{}
InsetBase * MathBigInset::clone() const
auto_ptr<InsetBase> MathBigInset::clone() const
{
return new MathBigInset(*this);
return auto_ptr<InsetBase>(new MathBigInset(*this));
}

View File

@ -24,7 +24,7 @@ public:
///
MathBigInset(string const & name, string const & delim);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -7,6 +7,7 @@
using std::max;
using std::auto_ptr;
MathBinomInset::MathBinomInset(bool choose)
@ -14,9 +15,9 @@ MathBinomInset::MathBinomInset(bool choose)
{}
InsetBase * MathBinomInset::clone() const
auto_ptr<InsetBase> MathBinomInset::clone() const
{
return new MathBinomInset(*this);
return auto_ptr<InsetBase>(new MathBinomInset(*this));
}

View File

@ -13,7 +13,7 @@ public:
///
explicit MathBinomInset(bool choose = false);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void write(WriteStream & os) const;
///

View File

@ -6,15 +6,17 @@
#include "math_streamstr.h"
#include "support/LOstream.h"
using std::auto_ptr;
MathBoxInset::MathBoxInset(string const & name)
: MathNestInset(1), name_(name)
{}
InsetBase * MathBoxInset::clone() const
auto_ptr<InsetBase> MathBoxInset::clone() const
{
return new MathBoxInset(*this);
return auto_ptr<InsetBase>(new MathBoxInset(*this));
}

View File

@ -15,7 +15,7 @@ public:
///
explicit MathBoxInset(string const & name);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
mode_type currentMode() const { return TEXT_MODE; }
///

View File

@ -7,6 +7,7 @@
#include "support/LOstream.h"
using std::max;
using std::auto_ptr;
MathBraceInset::MathBraceInset()
@ -21,9 +22,9 @@ MathBraceInset::MathBraceInset(MathArray const & ar)
}
InsetBase * MathBraceInset::clone() const
auto_ptr<InsetBase> MathBraceInset::clone() const
{
return new MathBraceInset(*this);
return auto_ptr<InsetBase>(new MathBraceInset(*this));
}

View File

@ -18,7 +18,7 @@ public:
///
MathBraceInset(MathArray const & ar);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
/// we write extra braces in any case...
bool extraBraces() const { return true; }
///

View File

@ -8,15 +8,17 @@
#include "LaTeXFeatures.h"
#include "support/LOstream.h"
using std::auto_ptr;
MathCasesInset::MathCasesInset(row_type n)
: MathGridInset(2, n, 'c', "ll")
{}
InsetBase * MathCasesInset::clone() const
auto_ptr<InsetBase> MathCasesInset::clone() const
{
return new MathCasesInset(*this);
return auto_ptr<InsetBase>(new MathCasesInset(*this));
}

View File

@ -12,7 +12,7 @@ public:
///
explicit MathCasesInset(row_type rows = 1u);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -18,6 +18,7 @@
using std::ostream;
using std::endl;
using std::auto_ptr;
#ifndef CXX_GLOBAL_CSTD
using std::strchr;
@ -49,9 +50,9 @@ MathCharInset::MathCharInset(char c)
InsetBase * MathCharInset::clone() const
auto_ptr<InsetBase> MathCharInset::clone() const
{
return new MathCharInset(*this);
return auto_ptr<InsetBase>(new MathCharInset(*this));
}

View File

@ -16,7 +16,7 @@ public:
///
explicit MathCharInset(char c);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -8,6 +8,8 @@
#include "support/LOstream.h"
#include "textpainter.h"
using std::auto_ptr;
MathCommentInset::MathCommentInset()
: MathNestInset(1)
@ -21,9 +23,9 @@ MathCommentInset::MathCommentInset(string const & str)
}
InsetBase * MathCommentInset::clone() const
auto_ptr<InsetBase> MathCommentInset::clone() const
{
return new MathCommentInset(*this);
return auto_ptr<InsetBase>(new MathCommentInset(*this));
}

View File

@ -20,7 +20,7 @@ public:
///
explicit MathCommentInset(string const &);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -8,15 +8,17 @@
#include "math_streamstr.h"
#include "support/LOstream.h"
using std::auto_ptr;
MathDecorationInset::MathDecorationInset(latexkeys const * key)
: MathNestInset(1), key_(key)
{}
InsetBase * MathDecorationInset::clone() const
auto_ptr<InsetBase> MathDecorationInset::clone() const
{
return new MathDecorationInset(*this);
return auto_ptr<InsetBase>(new MathDecorationInset(*this));
}

View File

@ -19,7 +19,7 @@ public:
///
explicit MathDecorationInset(latexkeys const * key);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void draw(PainterInfo &, int x, int y) const;
///

View File

@ -9,6 +9,7 @@
using std::max;
using std::auto_ptr;
namespace {
@ -52,9 +53,9 @@ MathDelimInset::MathDelimInset
}
InsetBase * MathDelimInset::clone() const
auto_ptr<InsetBase> MathDelimInset::clone() const
{
return new MathDelimInset(*this);
return auto_ptr<InsetBase>(new MathDelimInset(*this));
}

View File

@ -19,7 +19,7 @@ public:
///
MathDelimInset(string const & left, string const & right, MathArray const &);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
MathDelimInset * asDelimInset() { return this; }
///

View File

@ -1,19 +1,20 @@
#include "math_diffinset.h"
#include "math_support.h"
#include "math_mathmlstream.h"
#include "math_symbolinset.h"
#include "debug.h"
using std::auto_ptr;
MathDiffInset::MathDiffInset()
: MathNestInset(1)
{}
InsetBase * MathDiffInset::clone() const
auto_ptr<InsetBase> MathDiffInset::clone() const
{
return new MathDiffInset(*this);
return auto_ptr<InsetBase>(new MathDiffInset(*this));
}

View File

@ -13,7 +13,7 @@ public:
///
explicit MathDiffInset();
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void addDer(MathArray const & der);
///

View File

@ -6,15 +6,17 @@
#include "math_support.h"
#include "math_parser.h"
using std::auto_ptr;
MathDotsInset::MathDotsInset(latexkeys const * key)
: key_(key)
{}
InsetBase * MathDotsInset::clone() const
auto_ptr<InsetBase> MathDotsInset::clone() const
{
return new MathDotsInset(*this);
return auto_ptr<InsetBase>(new MathDotsInset(*this));
}

View File

@ -13,7 +13,7 @@ public:
///
explicit MathDotsInset(latexkeys const * l);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -5,15 +5,17 @@
#include "math_streamstr.h"
#include "support/LOstream.h"
using std::auto_ptr;
MathEnvInset::MathEnvInset(string const & name)
: MathNestInset(1), name_(name)
{}
InsetBase * MathEnvInset::clone() const
auto_ptr<InsetBase> MathEnvInset::clone() const
{
return new MathEnvInset(*this);
return auto_ptr<InsetBase>(new MathEnvInset(*this));
}

View File

@ -17,7 +17,7 @@ public:
///
MathEnvInset(string const & name_);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void draw(PainterInfo &, int x, int y) const;
///

View File

@ -1,14 +1,15 @@
#include <config.h>
#include "math_ertinset.h"
#include "math_mathmlstream.h"
#include "support/LOstream.h"
using std::auto_ptr;
InsetBase * MathErtInset::clone() const
auto_ptr<InsetBase> MathErtInset::clone() const
{
return new MathErtInset(*this);
return auto_ptr<InsetBase>(new MathErtInset(*this));
}

View File

@ -1,3 +1,4 @@
// -*- C++ -*-
#ifndef MATH_ERTINSET_H
#define MATH_ERTINSET_H
@ -11,7 +12,7 @@ public:
///
MathErtInset() {}
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
mode_type currentMode() const { return TEXT_MODE; }
///

View File

@ -5,6 +5,8 @@
#include "math_mathmlstream.h"
#include "math_streamstr.h"
using std::auto_ptr;
MathExFuncInset::MathExFuncInset(string const & name)
: MathNestInset(1), name_(name)
@ -18,9 +20,9 @@ MathExFuncInset::MathExFuncInset(string const & name, MathArray const & ar)
}
InsetBase * MathExFuncInset::clone() const
auto_ptr<InsetBase> MathExFuncInset::clone() const
{
return new MathExFuncInset(*this);
return auto_ptr<InsetBase>(new MathExFuncInset(*this));
}

View File

@ -15,7 +15,7 @@ public:
///
MathExFuncInset(string const & name, MathArray const & ar);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -1,4 +1,3 @@
#include <config.h>
#include "math_exintinset.h"
@ -10,6 +9,8 @@
#include <boost/scoped_ptr.hpp>
using std::auto_ptr;
MathExIntInset::MathExIntInset(string const & name)
: MathNestInset(4), symbol_(name)
@ -21,9 +22,9 @@ MathExIntInset::MathExIntInset(string const & name)
// 3 - upper
InsetBase * MathExIntInset::clone() const
auto_ptr<InsetBase> MathExIntInset::clone() const
{
return new MathExIntInset(*this);
return auto_ptr<InsetBase>(new MathExIntInset(*this));
}

View File

@ -14,7 +14,7 @@ public:
///
explicit MathExIntInset(string const & name_);
///
InsetBase * clone() const;
virtual std::auto_ptr<InsetBase> clone() const;
///
void symbol(string const &);
///

View File

@ -7,6 +7,7 @@
#include "math_parser.h"
#include "frontends/Painter.h"
using std::auto_ptr;
MathFboxInset::MathFboxInset(latexkeys const * key)
@ -14,9 +15,9 @@ MathFboxInset::MathFboxInset(latexkeys const * key)
{}
InsetBase * MathFboxInset::clone() const
auto_ptr<InsetBase> MathFboxInset::clone() const
{
return new MathFboxInset(*this);
return auto_ptr<InsetBase>(new MathFboxInset(*this));
}

Some files were not shown because too many files have changed in this diff Show More